LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing Spectral measurement data

Solved!
Go to solution

Ive been stuck on this for days please help! I have generated a multitone and can see its output in the time domain and frequecy domain ( frequency domain using spectral measurements). What I want to do is store the gain in dB from the spectral measurements block into an array and then compare each dB value to corresponding dB values of a speaker which will also be in an array. I unbundled the cluster wire coming from the FFT output of the spectral measurement and it has an array for magnitude but its only 255 elements long and I have no idea how to correspond each frequency to its magnitude, and where are the other dB values, I say this because the wave form graph has a max limit of 20kHz?  

0 Kudos
Message 1 of 5
(3,583 Views)

Hi mikeg,

 

I unbundled the cluster wire coming from the FFT output of the spectral measurement and it has an array for magnitude but its only 255 elements long and I have no idea how to correspond each frequency to its magnitude, and where are the other dB values, I say this because the wave form graph has a max limit of 20kHz?

- There should be more in this cluster than just an array of amplitudes…

- Ever heard of "axis scaling"? Your 255 array elements might correspond to a X axis of 0-20kHz - because of those other cluster elements…

- Please read the LabVIEW help about the Waveform datatype (like this), it should explain the content of your cluster…

Best regards,
GerdW


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

Noted thanks! 

 

So how would you suggest finding the magnitude at say 500 hz using the cluster?? Is there a way to make it modular so you could find any magnitude at whatever frequency? 

0 Kudos
Message 3 of 5
(3,560 Views)
Solution
Accepted by topic author mikeg_93

Hi mikeg,

 

your cluster should contain elements like f0 and df. Using both you can calculate the corresponding frequency of each sample in your waveform: f:=f0 + df * index.

 

how would you suggest finding the magnitude at say 500 hz using the cluster?

So you can calculate an array of frequency values (with same length as your sample array). Now you can search for the frequency value next to your "500 Hz", get its index to get the corresponding value from your amplitude array. (You could even solve this frequency calculation by changing it to index := (f-f0)/df…)

It works the same with regular waveforms (those with t0 and dt values) - that's why I suggested to read the LabVIEW help on waveforms!

 

Is there a way to make it modular so you could find any magnitude at whatever frequency? 

I hope you got the algorithm by now! 😄

 

Best regards,
GerdW


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

Thank you! 

I got it, now 

0 Kudos
Message 5 of 5
(3,538 Views)