示例#1
0
    def __init__(self, freq, tau, T, samplerate, t0=None, phi=0):
       """Initialize signal without any noise.

       Arguments:
        * freq is the frequency of the signal in hertz
        * tau is the decay constant in seconds
        * T is the length of the signal in seconds
        * samplerate in Hz
        * t0 is the time the signal starts
        * dphi is the phase of the signal, 0 means cosine
        """

       Waveform.__init__(self, T, samplerate)

       self.samples = cos(2*pi*freq*self.time)*exp(-self.time/tau)

       if t0:
           self.samples = hstack((zeros(t0/selg.sampleinterval), self.samples))[:len(self.samples)]