[SciPy-user] Using fftpack.diff

pearu at cens.ioc.ee pearu at cens.ioc.ee
Mon Dec 18 01:31:47 CST 2006



On Tue, 5 Dec 2006, Neilen Marais wrote:

> Hi
> 
> I'm trying to get the DFT of the derivative of a real valued periodic
> signal. If I have the time domain
> signal in ts (where one period is stored in ts), I do:
> 
> fs = scipy.fftpack.fft(ts)
> dfs = scipy.fftpack.diff(fs)
> dts = scipy.fftpack.ifft(dfs)
> 
> However dts seems to be almost purely imaginary whereas ts is purely real.
> I haven't done DFT related stuff for a while, am I misunderstanding
> completely?

Yes, you can do

  dts = scipy.fftpack.diff(ts)

Pearu



More information about the SciPy-user mailing list