## FFT basic question

7 posts / 0 new
Author
Message

Hi Guys,

It's been a while since I looked at the FFT in detail so I have a basic question.

What information do you need to plot the FFT of a signal?
Sampling frequency
How many samples (N)

What else?

I am capturing some real time ADC data through an AVR and want to plot the FFT of this signal. I know (somewhat) my sampling frequency and number of samples in one cycle of the wave. I am getting about 28 samples in one cycle of a 1Khz sine wave which means my sampling frequency is 28 ksps.

I am starting with a known sine wave input of known frequency to test my FFT and then proceed to a real life signal.
Thanks.

I have seen that site before and will look at it once more.

So looks like all I need is sampling frequency and number of FFT points = number of samples in one cycle of a periodic wave?

You need to sample for one period of the lowest frequency of interest, at a rate twice the highest frequency of interest. Lets say you are interested in voice band maybe 125 to 4000... so you need to sample for 8ms at 8khz... 64 samples.... 125hz spacing. You get real and imaginary ampl and phase every 125 hz. 64 lines gets you from 0 to 8000, but the top half is the same as the bottom half, so you get 32 spectra 125 hz apart from 0 to 4000. Get the magnitude of the re and im parts at ea line and convert to db.

Imagecraft compiler user

So for example if I had 256 samples of a signal with sampling frequency of say 10 ksps, my lowest frequency would be about 39 Hz? (10000/256)

You have to talk about a "sample window" of N samples. You REALLY want N to be 2**J, where J is a positive integer. That is, 16, 32, 64, etc.

If you just take the samples over the raw window, you will get some strange effects that decrease slowly as the number of samples in the window increases. These effects can be reduced by "weighting" the samples near the edged of the window. There are a number of styles of weighting. You MAY be able to get by without doing this, but be prepared for some things that you might not expect.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net