Hi all,

I am trying to understand how FFT work, so I wrote the attached script.

The idea is to extract amplitude and phase of a signal and then reconstruct using amplitude and phase information.

As you can see, I create some cosine curve on the interval t0-t1.

Let's start with t0=1.0 and t1=3.0 and consider just y['1'] = cos(1.0*omega*t), the signal is.

The amplitude and phase for each order are:

But if I try to reconstruct the signal using amplitude and phase:

So as you can see there is a shifting of 180 deg.

Now let's consider another case, t0=2 and t1=3, the signal is

y['Signal'] = 1.0*cos(1.0*omega*t) + 2.0*cos(2.0*omega*t) + 3.0*cos(3.0*omega*t + pi/4) + 4.0*cos(4.0*omega*t) + 5.0*cos(5.0*omega*t) + 1.0

The reconstructed signal is very similar to the initial one:

but is not exactly the same.

Any advice?

Thanks

_______________________________________________

NumPy-Discussion mailing list

[hidden email]
https://mail.scipy.org/mailman/listinfo/numpy-discussion