Searching \ for '[EE]: Understanding FFT and Frequency Domain' in subject line. () Help us get a faster server
FAQ page: www.piclist.com/techref/logic/dsps.htm?key=fft
Search entire site for: 'Understanding FFT and Frequency Domain'.

Exact match. Not showing close matches.
'[EE]: Understanding FFT and Frequency Domain'
2002\03\07@120909 by  Hello,

I'm hoping someone can give me an intuitive feeling for what an FFT does and
how to interprete data in the frequency domain.  I am using Matlab to do an
FFT on sampled data and am having trouble understanding the resulting
frequency domain picture.

Here is some 'things' that are bugging me:

1. if I sample a sine wave with a frequency of 3Hz at 10Hz then the
resulting frequency domain picture shows
a 'spike' at 3Hz, but there is noticable frequency content around 3Hz.
I understand the 'spike' at 3Hz, but
don't understand why there is so much 'noise' as I am sampling at twice
the highest frequency.

2. say I have completely random data, except that every second on the second
the data is a 1.  does this mean I have frequency content at 1Hz? and no
frequency content elsewhere?

Regards,
Donovan (A confused EE student)

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-request mitvma.mit.edu  FFTs have boggled the greatest minds...

For your 3Hz signal sampled at 10Hz:
You have a dataset of finite length.  Say you have 1024 samples.  That
equates to 102.4 seconds.  So your data is gated or windowed or
multiplied by a square wave with a 102.4 second "1" period and "0"
elsewhere.
If you look up the Fourier transform of the gating function you find it
has some energy at 0 frequency and exponentially less at frequencies
away from 0.  When you multiply your 3Hz signal by the gating function
you get "sidebands" of the gating function on your 3Hz signal.

Did that help at all?

Sherpa Doug

P.S. Gating your data with something other than a square wave is the
subject of many cubic meters of PHD theses.

> {Original Message removed}  Hi Donovan.

FFT is not a _continuous_ spectrum of an infinitely long sampling of a signal.
In that case you would have an infinitely thin, infinitely high spike at 3Hz and
nothing else.

You may have an exactly 3Hz pin in the spectrum, but unless your 3Hz is an
entirely clean sine wave, it will not show as one pin. Even with a 3Hz that is clean,
your FFT is handling a finite number of points - therefore you are not getting an
integral number of full periods of your 3Hz, and your signal may be non-
symmetrical.

Since FFT handles your N samples of a signal as if it were a closed loop, repeating
infinitely, you will get a discontinuity at t=0. This also has to be modelled with a
frequency content.

If you,  with MatLab, construct a 3Hz signal that is symmetrical (easy way, make a
spike at 3 Hz and IFFT) you will notice it is symmetrical.

If you want to determine what frequencies you actually have in a spectrum, you
need to look at formant frequencies. Speech analysis and synthesis has the

You should rather see FFT as a way of determining how to CONSTRUCT the
LOOPED, SAMPLED SECTION signal you are analyzing as a linear combination of
sine wave functions.

Kent

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-request mitvma.mit.edu   Hi Donovan,

Two very good questions. Let me try to answer them:

1) Try sampling at a rate (Fs in Hertz) and take N samples such that your
signal frequency is an integer multiple of Fs/N. Then you should see just a
single spike like you suggest. The problem with looking at a 3Hz signal
sampled at 10Hz is that there are a finite number (N) of frequency slots or
"bins", and probably (I can't tell for sure since I don't know what N you
were using) no single bin exactly corresponded to 3Hz, so it had to spread
out the spike over a few bins. This is called "leakage".

Also, beware of how some mathematical software packages construct time
vectors (or sequences). For example, in MATLAB, if you type:

t=linspace(0,0.1,100)

You would think you are generating a sampling rate of 1kHz (assuming that t
is in seconds). However, matlab is actually creating 100 evenly spaced
samples between 0 and 0.1 inclusive and because it forces itself to include
0 and 0.1, you actually have a time interval that is slightly longer than
0.1 seconds and you get an Fs a little bit lower than 1kHz, so you will get
some leakage even if you use, say, a 100Hz sinusoid as your signal.

2) If I understand you correctly, I think you mean that your signal is the
sum of something essentially random (but zero once per second) plus
something that is just spikes of amplitude 1, once per second, added so
that the spikes and zeros correspond. This will NOT simply have a 1Hz
frequency content, for two reasons. First of all, the random data will have
some frequency spectrum (determined by the autocorrelation of the random
data, and altered by the zeroing every 1 Hz) and even just the spikes
signal will not be simply content at 1Hz. As a matter of fact, the DFT
(Discrete Fourier Transform, the thing that an FFT actually computes, FFT
is just an algorithm for computing a DFT) of a sequence of single-sample
pulses is also itself a sequence of such pulses, with half minus one of
them negative and half plus one of them positive. So, the DFT of the
combination would be the combination of the DFTs (since the DFT is a linear
operation).

Remember, there are many ways of quantifying the idea of frequency.
Certainly, a waveform with pulses once per second has a fundamental
frequency of 1 Hz. However, a DFT represents a change of basis or an
alternative way of representing a complete signal. If I just tell you "I
have a signal that repeats once per second" you won't be able to tell me
what that signal looks like since there are many such signals. However, if
I provide you with the DFT of my signal, you could take the inverse DFT and
get the exact original back again, so the DFT must contain more information
than just the fundamental frequency. This additional information, described
in a "hand-wavy" way is actually a description of how to construct the
waveform from a sum of scaled, shifted sinusoids at various frequencies.

In fact, it is entirely possible to have a waveform that repeats at some
rate (say 1 Hz) which has NO frequency content at 1 Hz in it's DFT.
Consider, for example, the sum of two cosines, one at 3 Hz, one at 5Hz. If
you plot the waveform, you'll see that it repeats at a rate of 1Hz, but
clearly, it should only have frequency content at 3 and 5 Hz.

One final interesting point: the DFT is simply matrix multiplication by an
invertible matrix containing complex entries. An FFT is just a way of doing
multiplication by this special matrix in a fast way.

I hope this is of some help,

Sean

At 10:01 AM 3/7/02 -0800, you wrote:
{Quote hidden}

----------------------------------------------------
Only \$9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-request mitvma.mit.edu   > 1. if I sample a sine wave with a frequency of 3Hz at 10Hz then the
> resulting frequency domain picture shows
>     a 'spike' at 3Hz, but there is noticable frequency content around 3Hz.
> I understand the 'spike' at 3Hz, but
>     don't understand why there is so much 'noise' as I am sampling at
twice
> the highest frequency.

The Nyquist theorum doesn't promise that the sampled data will contain only
the original frequencies if they are sampled fast enough.  It only says that
the original signal can be *resonstructed* from such sampled data.  Go back
to MATLAB and add a reconstruction filter to the 10Hz sampled data.  Ideally
this would be a brick wall frequency cutoff at the highest original
frequency.  You can try to get close to that by convolving with a large sync
function.  An easier way would be to cubically interpolate the 10Hz data to
a higher frequency, like 100Hz for example.  Cubic isn't perfect, but it's
easy to code up so you can see the effect.  Then run the FFT on the 100Hz
data and see what you get.

> 2. say I have completely random data, except that every second on the
second
> the data is a 1.  does this mean I have frequency content at 1Hz? and no
> frequency content elsewhere?

No, you have frequency content everywhere up to 1/2 the sample frequency,
with a little extra at 1Hz.  Random data is the same as sampled white noise.
Remember that pure white noise looks like a flat line in frequency space (it
contains all frequencies equally).

********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olin embedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-request mitvma.mit.edu  I missed some of this thread, so apologies if this was brought up
before.

However, there is a pretty good book in PDF format at http://www.dspguide.com.
Not as rigorous as some books, but very approachable. I have a hardcopy
that one of the DSP vendors was handing out a while back with a special
chapter on their DSP stuff.

Anyway, pretty good stuff. Would be worth the \$64 for a hardcopy, but

Al Williams
AWC
* Easy RS-232 Prototyping
http://www.al-williams.com/awce/rs1.htm

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listserv mitvma.mit.edu with SET PICList DIGEST in the body

More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...