LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding the x-axis when performing FFT conversion of the waveform file of HWS file

Solved!
Go to solution

Thank you for your continued support. I'm a beginner in LabVIEW. As shown in the attachment, I am creating an FFT conversion program by copying it, but after FFT conversion, the x-axis becomes the number of measurement points, not the frequency. Where is the problem? Please kindly advise.

If possible, write it in a graphical program.

無題.png

 

0 Kudos
Message 1 of 9
(910 Views)

The problem is that input to the FFT function is not a waveform data type, it is just an array of doubles which does not contain any information about the time domain of each sample in the array.

 

Try reading the data as waveform data type instead of Analog DBL from the HWS if you saved the time domain details. Essentially, all that you need is dt, i.e, delta time between samples in your waveform (inverse of your sampling rate of the waveform).

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 9
(901 Views)

Thank you for your reply.

I'm a beginner, so I kind of understand what you're saying, but would it be possible for you to give me more specific information?

0 Kudos
Message 3 of 9
(879 Views)

Hi kozuka,

 


@kozuka32 wrote:

would it be possible for you to give me more specific information?


It really would help to provide your code, not just an image of code!

(We prefer code for older LabVIEW versions, like LV2019. There's a File->Save for previous menu item!)

 

Right now you provide just an array of samples to your FFT function: did you notice that red coercion dot? (Do you already learned what that coercion dots signifies?)

When your FFT function should work with respect to timing information then you need to provide that information - using the waveform datatype expected by this function! Read the help for the function…

 

Additionally you only use the "magnitudes" array after the FFT function, again a simple 1D array WITHOUT any timing/frequency information! Use the whole cluster coming from FFT as it also includes the f0/df values you need for senseful graphs…

Best regards,
GerdW


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

Thank you for your prompt reply.

I will send you a vi file to convert to Fourier transform. I will also send you an HWS file as a sample. Although it is different from the image I sent earlier, it is a slightly modified version of the LabVIEW sample file. I kindly thank you.

Download All
0 Kudos
Message 5 of 9
(858 Views)

Hi kozuka,

 

I don't have the HWS driver installed, but I still can show the concept of using waveforms:

Best regards,
GerdW


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

Hi GerdW(Sorry if I got the name wrong)

Thank you very much for watching so enthusiastically. I tried following the attached instructions, but I am seeing a problem where the FFT graph part is not displayed. Thank you very much for your advice.

M.Kozuka

0 Kudos
Message 7 of 9
(842 Views)
Solution
Accepted by kozuka32

Hi kozuka,

 


@kozuka32 wrote:

I am seeing a problem where the FFT graph part is not displayed.


When you want to calculate a FFT then you should use the FFT function!

See the attachment…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 9
(838 Views)

Hi GerdW

Sorry for the delay in replying. As you said, I was wrong. I sincerely apologize. I did exactly what you told me to do and was able to completely resolve the issue. Thank you from the bottom of my heart. That was a really big help.

M.Kozuka

0 Kudos
Message 9 of 9
(812 Views)