Showing results for 
Search instead for 
Did you mean: 

FFT length in FPGA FFT function versus length of input array to 'FFT to Spectrum' function

Go to solution

Hello all,


I have an application where I'm using a NI-9146 FPGA to acquire data and do a single-channel single sample FFT (on the FPGA itself). The FPGA FFT function is an Express VI configured as below:


This function outputs a Real component and an Imaginary component. I feed these into DMA FIFOs, which I read in a separate 'host VI'. In this host VI, I have to specify the number of elements to read from the DMA FIFO. Currently it is set as 2048.


The Real and Imaginary arrays coming out of the DMA FIFO Read are fed into the 'FFT to Spectrum' function which outputs the spectrum. This function uses the length of the arrays to compute the number of bins in the spectrum. So I get a spectrum of 1024 bins. 



My question is how does the 512 length of FFT in the FPGA function matter, and how does it figure in the final spectrum, since it seems the bins in the final spectrum are calculated merely based on the length of the Real and Imaginary arrays. 


Basically, I'm looking for some insight into how the FPGA FFT function and the FFT-to-Spectrum function work together. Because if I'm using an FPGA, these are the only functions available as far as I know.



0 Kudos
Message 1 of 4

The FFT VI takes (in your case) real data from the DAQ input and converts it to a spectral output of complex values with real and imaginary parts.

The FFT to Spectrum VI converts a complex output from an FFT operation back to an array of real values.

What you describe is how an FFT operation works. Put in 2048 datapoints, get out a spectral array with 1024 points. Put in 512 points get out 256 points. Note that both arrays will cover the same span of frequencies, the longer array will have greater frequency resolution.




Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4

Sorry, that still didn't answer my question. How does the FFT length in the FPGA Express VI matter at all? If I understand your comment correctly, I could assign any random FFT length in the FPGA Express VI, and then read the desired number of elements to feed into the 'FFT to Spectrum' function and get the desired number of frequency bins.


So essentially, the length of the input array to the 'FFT to Spectrum' function determines the number of bins. The FFT length in the FPGA Express VI doesn't matter at all? Is this correct?



0 Kudos
Message 3 of 4
Accepted by topic author abvenk

I figured it out myself. 


The FFT length in the FFT Express VI is the key factor. When you're reading from the DMA FIFO, you must read exactly the same number of elements as the FFT length, and make sure to have an adequately large DMA FIFO. 


This will ensure that the spectrum is constructed from the full set of data, and not from data that is cut off. 

0 Kudos
Message 4 of 4