LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array in formula node

Hello everyone,

 

I am new in labview. I would like to display the coherence function with the correct frequency scale. For instance, I want it to be as follow: FreqAxis = 0:Fs/2/(N+1):Fs/2. where Fs is the sampling frequency and N the number of sample. I am trying to write using Formula node, but it is not working.

Thanks for your time and your help.

Axel

0 Kudos
Message 1 of 7
(2,423 Views)

Hi Axel,

 

why do you need a formula node?

Two possible solutions in one snippet:

check.png

You might adapt your settings a little bit, I'm not that familiar with MATLAB expressions…

Best regards,
GerdW


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

Thanks very much GerdW. it worked well Smiley Happy . However, the coherence function was not as good as I expected.The value of the correlation is 1 at all the frequency. Can someone recommend me a better vi? Perhaps there is something I can do to correct my result...cohere.PNG

0 Kudos
Message 3 of 7
(2,379 Views)

Hi Axel,

 

- we don't know your DAQ data.

- There are coercion dots at the Coherence function, they surely have their meaning.

- You can wire f0 instead of your "Sampling Freq" constant…

- When you want to redefine the X axis of your second plot you only need to change the f0 and df values in that cluster, no need to calculate a new array of values…

 

Attach the real VI with real data embedded! (LV2011 preferred)

Best regards,
GerdW


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

Thanks again for your comments and your time :).

 

I have attached the .vi file and a screen-shot of the expected result (cohere2.png).

 

Cheers

Axel

Download All
0 Kudos
Message 5 of 7
(2,363 Views)

Can you also attach a typical data file?

0 Kudos
Message 6 of 7
(2,353 Views)

Yes. Please find attached a tdms file. The file contains 4 channels.

 

Cheers

Axel

0 Kudos
Message 7 of 7
(2,345 Views)