Showing results for 
Search instead for 
Did you mean: 

FFT (till harmonic n) of 2D array

Go to solution

Hello comuunity,

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?

0 Kudos
Message 1 of 5

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 Smiley Wink


record length should be >10 periodes of main freq.



Greetings from Germany

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Message 2 of 5

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

0 Kudos
Message 3 of 5

Sorry can't open your vi, still use 2012 .... (it's really time for an update Smiley Wink )

What do you mean by "fail" in detection of frequencies ?    OK, if there is no peak at that frequency, it will fail.


Greetings from Germany

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

0 Kudos
Message 4 of 5
Accepted by topic author VS_03
08-28-2016 06:17 AM

@VS_03 wrote:

...(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.

LabVIEW Champion Do more with less code and in less time
Message 5 of 5