[Tutor] fourier transform (fwd)

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Tue Aug 2 02:29:51 CEST 2005

---------- Forwarded message ----------
Date: Mon, 1 Aug 2005 16:21:33 -0700 (PDT)
From: Jeff Peery <jeffpeery at yahoo.com>
To: Danny Yoo <dyoo at hkn.eecs.berkeley.edu>
Subject: Re: [Tutor] fourier transform

Danny, thanks for the help. Yes, for an odd square wave the b's of the fourier series are non zero for even values and zero for odd values of n. these are the coefficients for the fourier series.  Although I beleive the fft (fourier transform) should return the amplitude of frequencies that exist. so for example a fft on a 10 hz sin wave with amplitude equal 2 should return all zero amplitudes except for at 10 hz there should be a spike with amplitude 2.  although... this would be bn = 2 for n=1 in the fourier series. If I sample this same signal and use FFT.fft() on it the result is not all zeros except at 10 hz. so I guess I'm still confused as to what the output is telling me. thanks again for everyones help.

Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:

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