LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency from Accelerometer

Hello, 

 

I am getting successfully data from an accelerometer and I then I want to calculate the frequency of a vibrating object where the accelerometer is placed at. As you can observe in the attached VI after I obtain the accelerometer measurements I use data queue function in order to collect a certain amount of data(200), in order to have enough samples for my FFT. Then I use build waveform function and at the end filter and spectral measurements vi. But unfortunately I do not thing that I get the frequency I want.And that means not only that the x axis in waveform graph is not correct but in general when I vibrate the object in certain frequencies the spectrum does not show something close to them.

Can anyone help me?

Thank you

0 Kudos
Message 1 of 2
(2,577 Views)

You are, unfortunately, using the Obscuring, Overly-Simplifying Express VIs which obscure (and, unfortunately, usually do not simplify) the problem you are trying to solve.

 

Something that can be quite illuminating is to zero in on the Main Task and make sure that you understand what is going on.  You have a Signal (of rather a few points, only 200!) and you want to know what frequencies are present in it.  You are concerned because when you do Who Knows What with the Express VIs, you don't get values that make sense.

 

So "play scientist" -- do an experiment.  Generate known data, and do a simple analysis.

 

The Signal Processing Palette has functions for generating Waveforms and doing Spectral Analysis.  The example below uses a mixture of 4 sinusoids (whose properties we know, because we set them) + some RMS noise (you always have noise when recording signals), then passing it through a simple Power Spectrum routine to get (are you ready?) the Power Spectrum.  Very simple, and it works.  Once you know "how to" do this, you can incorporpate routines like this in your own code.  You can also play with the number of samples and the sampling rate to see how this affects your data.

Simulated Signal Analysis.png

 

Bob Schor

Message 2 of 2
(2,539 Views)