[Tutor] fourier transform

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Tue Aug 2 00:18:49 CEST 2005

On Mon, 1 Aug 2005, Jeff Peery wrote:

> thanks for the help. I think I'm understanding this a bit better.
> although I still don't completely understand the output. here is an
> example... for the input I have 1024 samples taken from a 1 Hz square
> wave with amplitude = 1.  for the output I would expect an infinite
> number of frequencies. the output from FFT.fft(myData).real is this:

[data cut]

> I would expect 0.498 at all frequencies? why the oscillation?

That actually sounds fine.  By a square wave, you mean something like:

    -------      -------      -------
          |      |      |     |
          |      |      |     |
           ------       -------

and according to the MathWorld documentation that Christian mentioned,


according to analysis, the square wave does have a Fourier transform that
oscillates the way that you've observing:


where the coefficients are zero on the even n.  So I think you're actually
getting correct values there.

Good luck!

More information about the Tutor mailing list