LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT implementation on FPGA

Hi All,

 

I am trying to implement a FFT algorithm on a NI PXIe - 1073 system with an NI PXI-7851r board. Basically I want to see the noise on an analog input channel.

 

In principle I have two problems:

- First I need the output data to be in [ V/sqrt(Hz) ], but I can only chose from VRMS or VRMS^2 when I use the FFT implemented in the FPGA. I managed to select [dB] if I implement the FFT on the computer.

- Second problem is about the level of the signal received. I mean, I've tested with a signal generator, and I've generated a sine-wave with an amplitude of 1V with a frequency of 5kHz for example, but my FFT returned a signal of almost 350mV. I was expecting to see a peak of 1V in the resulted signal. Another interesting fact is that, for the same amplitude, but for different frequencies, I get different results, as follows:

- 1kHz -> 250Vrms

- 5kHz -> 350Vrms

- 10kHz -> 275Vrms

 

I have attached some photos with the program and a result test:

PC_FFT - represent the program that runs on Computer. 

FPGA_FFT - represent the program that runs on FPGA (Up - true case/Down - false case)

gen_sin_1V_5kHz - the image with the results.

 

Any help would be greatly appreciated. Thanks!

Download All
0 Kudos
Message 1 of 4
(4,287 Views)

Hi Alexjdr,

 

The FFT to Spectrum VI that you are using on the host computer side outputs a single-sided (only positive amplitudes), RMS value.  If you want a double-sided, peak value then you would need to perform the appropriate conversions.  I'm inserting a picture of the LabVIEW Help file entry for this VI below.

 

FFT to Spectrum.jpg

 

Hopefully this information is helpful!

 

Josh B
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(4,213 Views)

Hi Joshua-B,

 

So, basically I have a much lower value because, first it is a RMS value not a peak value (how can I configure the FFT to output peak?), and second because the FFT returns results just for the positive amplitude, because is single-sided (how can I do, that conversion?).

 

It is a little bit odd, because if I simulate a sin signal and use the spectral measurement with peak on the PC, I obtain a clean peak exactly as frequency.

 

 

Oh, sorry, I made a mistake when I specified the different results for different frequencies, the output should be in mVrms, as follows:

- 1kHz -> 250 mVrms

- 5kHz -> 350 mVrms

- 10kHz -> 275 mVrms

 

But how can I obtain V/sqrt(Hz) ?. I need the final graph to look similar with this.

 

Thank you for your help.

0 Kudos
Message 3 of 4
(4,165 Views)

Hi Alexjdr,

 

The two VIs you are trying to compare function differently.  I recommend reading through the LabVIEW Help file entry for each one.  I believe you are looking for a power spectral density (PSD) measurement.  This is one of the options on the Spectral Measurements Express VI.  When selecting the PSD option, this VI "returns the FFT power spectral density and displays the results in RMS-squared per Hz units".  Again, this is not the exact units you are asking for, you would need to take the square root to get the units you are asking for.

 

The VIs you are looking at are essentially "functions" provided for you to use.  If they do not meet your needs, then you would need to write your own FPGA algorithm to perform the appropriate math that you need.

Josh B
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(4,126 Views)