11-20-2012 03:17 PM
Hi
I have a quite simple question. I´m using the FFT Power Spectrum and PSD vi. and have a hard time understanding the output frequencies. As I understand it the first row is DC-value and the delta frequency then describe the following frequencies. But when I for example put in 8 points say 4Hz sampling frequency = 2sec of data to analyze, I get back 4 rows of data (incl. 0). If the first is DC, then the 2nd must be 1/2Hz the 3rd row = 1Hz and the 4th row = 3/2Hz, but what about the 2Hz Nyquist frequency, why don´t I get that one? or is there something that I misunderstand?
I also tried the FFT and Power spectrum Units.vi example to understand it but I still don´t get it.
Please help!
Best
Jesper
Solved! Go to Solution.
11-20-2012 03:23 PM
You shouldn't get the Nyquist. To be technical, the Nyquist frequency would alias down to DC.
11-20-2012 03:29 PM - edited 11-20-2012 03:33 PM
FFT's return the power in frequency bins. The frequency of the bins is determined by Fs (sampling frequency) divided by N (number of points), starting at DC (0Hz). For your case the array returned would be:
Bin 0: 0 - 0.5Hz
Bin 1: 0.5 - 1Hz
Bin 2: 1 - 1.5Hz
Bin 3: 1.5 - 2Hz
So effectively Bin 3 holds the average of the power from 1.5 - 2Hz (which contains your Nyquist frequency).
11-20-2012 03:32 PM
Thanks a lot Charles!! It all makes sense now.. Guess it´s been too long since I went to school;-)
11-20-2012 04:38 PM
I just have one extra question that you might be able to help me with Charles:
If I would like to compute the total power over a range of frequences say from 0,5Hz to 2Hz in the exsample about, should I then: A) add the bins of row 2,3,4 or B) take the integral from row 2-4?
And does it make a differens if i use Power Spectrum or Power Spectral Density?
Hope you can help one again:-)
Jesper
11-20-2012 04:50 PM
I believe that depends on if you requested linear or log y axis. If it is linear then yes, simply adding the bins together should work. I'd have to dig into the specific function that you are using to know if log scale is even viable to be summed. I sort of remember an FFT function that outputs a log with the main detected signal always at 0dB. That is great for THD and SINAD analysis but because it has all been randomly shifted to 0dB you can no longer calculate the absolute power. If this doesn't answer your question then please post the code and I'll take a look at it.
11-20-2012 04:52 PM
@jesboy wrote:
Thanks a lot Charles!! It all makes sense now.. Guess it´s been too long since I went to school;-)
FYI, crossrulz is correct, if your signal is EXACTLY on the Nyquist frequency, then it will be aliased to the DC bin, combining its power with the DC signal. Just wanted to make sure you realized that. Never use an FFT where a swept spectrum analyzer will do! 🙂
11-20-2012 05:01 PM
@Charles_CLA wrote:
to know if log scale is even viable to be summed.
@I believe you want to use the Euclidean Norm function on the array of bins if it is in log format. This is going to be relative to the other powers and not absolute. (this is true of anything that is pure dB). Euclidean Norm can be found @ vi.lib\measure\matone.llb\Euclidean Norm.vi
11-20-2012 05:10 PM
Thanks alot:-) It´s linear so no need for dB. I´m using it for Heart Rate Variability Analyses (don´t know if you´ve heard of it.), but I´m accually also trying to figure out the output of the Continues Wavelet Transformation, which I have a hard time understanding. I kind of understand the basic but again the output seems a bit strange to me. You seem to have great knowledge in the area, do you know about the Wavelet Transformation too?
And thanks again.
Best
Jesper
11-20-2012 05:15 PM
I've not dealt with either the Heart Rate Variability Analyses nor the Wavelet Transformation. I spent three and a half years characterizing the dynamic (AC) characteristics of ADC's, which is nearly all FFT analysis.