I want to record a FFT for specific frequency range. The input is a 2D array in which each row represents a record. I just need magnitude und phase of the harmonic (up to the n - controllable). I do not need too many harmonics, so I would like to avoid calculations and make only up to certain frequency the FFT.
I would take this VI, but is there any option to define a range for FFT? Or can another VI get Magn.&Phase for harmonics?
Solved! Go to Solution.
DFT resolution is defined by the record length
DFT max freq. is defined by the samplerate
However I would use the tone detection vi.
run it once on one record to get the main frequency
for n harmonics run it in a loop (n+1 times) on both records and define the search range to detect amplitude and phase of the harmonics. Try the help on tone detection
record length should be >10 periodes of main freq.
Thank you for the fast answer.
I built a VI for test on performance. I know the main frequency, so no detection is needed. In performance the Amplitude and Phase Spectrum VI is (with 8 harmonics) 7ms (~20%) faster than Extract Multiple Tone Information VI. In addition the extract VI works with wvf and "fail" in detection of frequencies. On the other side the spectrum gives me the rms, so there will be an additional multiplication for amplitude (or is there a better way?)
Greetings back from Germany
Sorry can't open your vi, still use 2012 .... (it's really time for an update )
What do you mean by "fail" in detection of frequencies ? OK, if there is no peak at that frequency, it will fail.
...(or is there a better way?)
Well, if you exactly know the spectral positions and the data is clean (no spectral leakage, no truncated periods, etc.), all you need to do is the multiplications with the complex unit waves of the desired frequencies. (see also this to get the amplitude for the fundamental frequency, it can easily expanded for more spectral positions.) Be aware that FFT is very efficient, so if you need a significant amount of spectral positions, it might be faster.