Trouble understanding fft norm axis sampling frequency etc

In summary: Similarly, with numpy, if you want to see the frequency of a sinusoid, you just write: x=cos(2*pi*n/2)+cos(2*pi*n/10).and it'll plot out the frequency for you. But if you're looking for the frequency of a particular sample in that sequence, you need to specify the index of that particular sample.
  • #1
eric hardin
6
0
Hello,
I have a question regarding fft's. My experience with working with Fourier transforms is pretty much limited to transforming contrived functions pen and paper style. But now I need something and I think the fft is the appropriate tool, but I'm having a hard time understanding some aspects of it. I figured you EE guys would be the best to ask... please be gentle.
I'm using numpy, I think it's a lot like matlab, please forgive if it's not.
My question deals with reading the normalized frequency axis. I think I understand that you can directly read the frequency and that the frequency is in units of samples per cycle. But I feel like I'm missing something to pull out the real frequency if I don't know the sampling frequency.
So, of course, I started out with simple examples (a week ago) like the sinusoid according to some tutorials:
n=arange(0,30,1)
magicNumber = 10
x=cos(2*pi*n/magicNumber)
N1=2**8
X1 = abs(fft(x,N1))
F1 = linspace(0,N1-1,N1)/N1
pylab.plot(F1,X1)
And I see a spike at 0.1 and 0.9 corresponding to the frequencies 1 and -1. But what I don't understand is how to pull out that frequency if you don't know what I called the magicNumber, which is the sampling frequency, correct? Also what if the signal looks like,
x=cos(2*pi*n/2)+cos(2*pi*n/10).
Those are different sampling frequencies, so to which does the normalized frequency axis correspond.
Sorry if this is an elementary question, but I feel like I've looked around enough to warrant asking people.
As always, because I don't understand the material, I probably gave the wrong details. Please let me know if information is required.
My eternal gratitude,
Eric Hardin
 
Engineering news on Phys.org
  • #2
I saw that some people had a look at this thread. Nobody's responding though. Is it because it's a stupid question or because nobody understands what I'm trying to get at? If you see this and you don't know the answer or what I'm talking about, could you just write something like why you don't know. It might help me get to the answer.
Thanks
 
  • #3
eric hardin said:
I saw that some people had a look at this thread. Nobody's responding though. Is it because it's a stupid question or because nobody understands what I'm trying to get at? If you see this and you don't know the answer or what I'm talking about, could you just write something like why you don't know. It might help me get to the answer.
Thanks

Hahaha, I think it's a mixture of both. Usually when you think too much about a (relatively) well known concept, the solution is to simply work out an example and try to understand what's going on. In matlab, for example, plot a sine wave which you know the properties of. You can take the fft of it, play around with the graph and try to evaluate every value you see; it's there for a reason.
 

1. What is the purpose of using FFT in data analysis?

The Fast Fourier Transform (FFT) is a mathematical algorithm used to convert a time-domain signal into its frequency-domain representation. This allows for easier analysis and understanding of the frequency components present in the signal.

2. What does the "norm" parameter in FFT refer to?

The "norm" parameter in FFT refers to the normalization technique used in the calculation of the FFT output. This can affect the amplitude and magnitude of the frequency components in the resulting spectrum.

3. How do I determine the appropriate axis for plotting FFT results?

The appropriate axis for plotting FFT results depends on the type of signal being analyzed. For a real-valued signal, the frequency axis should range from 0 to the Nyquist frequency (half the sampling frequency). For a complex-valued signal, the frequency axis should range from -Nyquist frequency to +Nyquist frequency.

4. What is the significance of the sampling frequency in FFT?

The sampling frequency is the rate at which the signal is sampled or measured. It determines the maximum frequency that can be accurately represented in the FFT output and affects the resolution and accuracy of the frequency spectrum.

5. Can the sampling frequency be changed after data has been collected?

No, the sampling frequency cannot be changed after data has been collected. Changing the sampling frequency would require resampling the signal, which can introduce errors and affect the accuracy of the FFT results.

Similar threads

  • Electrical Engineering
Replies
4
Views
799
Replies
1
Views
1K
Replies
4
Views
2K
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Electrical Engineering
Replies
2
Views
2K
Replies
6
Views
4K
Replies
26
Views
4K
Replies
14
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
220
Back
Top