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}>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-requestKILLspam
.....mitvma.mit.edu
----------------------------------------------------
Sign Up for NetZero Platinum Today
Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97
--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUT
TakeThisOuTmitvma.mit.edu