From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT Error

Solved!
Go to solution

Hi

 

I have only been using Labview for 2 days, I am having problems with my FFT that connects to Test FFT Graph It gives twice the frequency that it should I am not certain how to cure this can someone please help me.

 

I have attached the Vi also a picture of the output the frequency I am using is    .3 Hz please note the FFT response is 6

 

Thank you 

David

Download All
0 Kudos
Message 1 of 10
(1,570 Views)

Hi David,

 


@DPJ1004 wrote:

I have only been using Labview for 2 days, I am having problems with my FFT that connects to Test FFT Graph It gives twice the frequency that it should I am not certain how to cure this can someone please help me.


Please learn the difference between waveform datatype and simple 1D array datatype…

(The waveform also contains timing information next to 1D array of samples.)

 


@DPJ1004 wrote:

I have attached the Vi also a picture of the output the frequency I am using is    .3 Hz please note the FFT response is 6


The "frequency" is detected at ~0.3Hz, which corresponds to the "ADC Input" showing a full period of that sine signal each ~3.3s. Please take note that both of these indicators show data based on waveforms.

The "Test FFT Graph" instead shows data based on a simple 1D array: it is missing all timing information and so the graph X axis only shows the index of the corresponding sample/array element. It does not display any "frequency" on the X axis!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(1,564 Views)

HI

 

Thank you for your response but how do I cure this.

 

Regards

David

0 Kudos
Message 3 of 10
(1,557 Views)

Hi David,

 

some options:

  • apply the correct scaling on the X axis using axis properties
  • use a waveform instead of a plain 1D array and set the correct dt value
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(1,554 Views)

Hi Gerdw

 

Sorry I am very new to this can you show me with the actual vi components please.

 

Best Regards

David

0 Kudos
Message 5 of 10
(1,533 Views)

Hi David,

 

you need to use BuildWaveform between ArraySubset and your TestFFTGraph…

Set the Y data with the array, and also set the dt value as needed.

 

Keep in mind (for this application) dt will correspond to df of the FFT result: do you know how the FFT works and how df is related to dt of the time data?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(1,524 Views)

HI

 

I have built something that works but it seems to messy can you please show me how to correct please see attached

 

Regards

David

0 Kudos
Message 7 of 10
(1,445 Views)

When you attach LabVIEW code (instead of a "picture" of code), you save us the time and trouble of manually re-creating your code (imagine if we asked you for help with C++ and sent a picture of a 5-page printout of the code instead of the .cpp file).  It also helps if we can see all of the code, not just the part that you think is the problem.

 

Bob Schor

0 Kudos
Message 8 of 10
(1,421 Views)

Hi Bob

 

Thanks for responding  I have attached the vi. The problem I have is the FFT and graph, displays bins correctly but I cant work out how to convert to show Frequency in the graph instead of Bins.

 

Thanks for your help

David

0 Kudos
Message 9 of 10
(1,407 Views)
Solution
Accepted by topic author DPJ1004

There is some basic math.  The dX between the bins is the reciprocal of the length of the capture.  So if you have a 4 second waveform capture you performed the FFT on, then the bin interval is 1/4 Hz.  You can then set the properties of the X-scale to start at 0 and a multiplier of 0.25.

0 Kudos
Message 10 of 10
(1,394 Views)