LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving calculated and real time FFT and PSD data from accelerometers at the same time - issues with frequency resolution

Hi there,

 

I have browsed around but was not able to find nor to figure out a solution. I am collecting real time data from four accelerometers on a vibration shaker (vibration controller is independent of the DAQ set-up  - X series USB 6363). The program saves the FFT and PSD from each accelerometer at predetermined time intervals and at frequencies determined by the sampling frequency and the number of samples (currently sampling at 10k with 2500 samples, which gives me frequencies 0, 4, 8, etc.) and the code works/worked fine. Apart from the accel signals, I would like to save the control signal that the vibration system uses to control the shaker (I cannot save it directly and that is why it needs to be calculated). The vibration controller software supposedly averages the selected signals and uses that to create the control signal. In LabVIEW,  what gave me correct PSD and RMS values for the control signal as compared to the vibration controller software was concatenating the required channels; however, now when I save it, the frequencies are no longer 0, 4, 8, etc., but are instead 0, 1.33, 2.66, etc., additionally, it is cutting the frequency range short. I assume it is because I am collecting 3 times (3 accel channles) more samples compared to the other channels. Can anyone think of any fast ways to be able to collect the data at frequencies that I specify and with the proper frequency range (in other words going back to 0, 4, 8 and up to 3 kHz? I am just really stuck with this one. The code is attached below.

 

Any help is greatly appreciated!!

 

Thank you!!

 

-Simon

 

 

 

 

0 Kudos
Message 1 of 4
(2,559 Views)

I'm not able to look at the code now to give detailed comments, but one very fundamental thing you'll need to understand is this:

 

Freq Resolution = 1 / T, where T is the total amount of time represented by the set of samples

 

The reason you were initially getting 4 Hz freq resolution is entirely because you were analyzing 1/4 second worth of samples at a time (2500 samples at 10 kHz).  The new 1.333 Hz resolution implies that you must now be analyzing 3/4 second worth of samples at a time.

 

In your description you used the term "concatenating".  Makes me wonder if you concatenated 3 distinct 1D arrays that each represented 1/4 second, resulting in a single 1D array representing 3/4 second?

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 2 of 4
(2,544 Views)

Hi,

 

Your code is not very readable. Please try to make it readabe by using sub vis and a architecture (state machine or PC with state machine for example).

You can also use tdms file to save all your datas in the same file.

 

 

 

Regards,

Fred.

 

Kudos are welcome!Smiley Wink

0 Kudos
Message 3 of 4
(2,540 Views)

Hi Kevin,

 

That is exactly what was happening. I ended up dealing with it in frequency domain and it seems to work now! 

 

Thank you!

 

-Simon

0 Kudos
Message 4 of 4
(2,515 Views)