From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW FFT on Accelerometer (ADXL 345) with Arduino and Linx Sub VIs

Hi Folks, 

 

I am a beginner to LabVIEW.

 

I am trying to complete a FFT on ADXL 345 sensor's accelerometer data. I am only interested in doing a FFT in the Z-axis as that is the vibration profile I am trying to map. The accelerometer rests on a vibrating plate held up with springs and vibrating with eccentric rotating mass motors. The plate only vibrates for only 3-5 seconds at around 50 Hz. I have been able to plot the accelerometer's x,y,z profile though I am not sure if the FFT I am doing is correct for the Z accelerometer profile. 

KG117_0-1688011519282.png

I have attached my VI as well. I am not sure what the sampling frequency of the FFT is. When I change the FFT size, the value changes on the frequency bins axis. I have scaled the amplitude Y axis by 5. 

 

KG117_1-1688011672102.png

This is what I am getting when I just shake the vibration plate with my hand. 

 

The question I have is how do I know that my frequency bin is corresponds to the right frequency. When I change the FFT size to 1024 with the same applied vibration to the plate the frequency dominance is at a different bin, as seen below:

KG117_2-1688011905126.png

Is there a way to coordinate the frequency bin to the correct frequency output? how do I get the sampling frequency(rate) for the FFT?

 

I was thinking if I knew the sampling frequency of the FFT then I would be able to find delta_f which is equal to sample rate / FFT size (correct?). I have also seen it being related to (FFT size)/2. 

 

I would think that the sampling frequency (rate) is related to the loop frequency (rate). Is that fair to say? 

 

Which direction should I be going in to ensure that that the amplitude corresponds to the right frequency in Hz (seen on the frequency bin X axis) ?

 

Thank you in advance, 

 

KG117

 

 

 

 

 

 

0 Kudos
Message 1 of 2
(627 Views)

You should learn the basics of Fourier transformation and than of discrete Fourier transformation DFT.

FFT means Fast Fourier transformation and is a DFT with certains constrains to make the calculations fast, but this fact is usually ignored and all DFTs are generally called FFTs ..

 

Is there a way to coordinate the frequency bin to the correct frequency output? how do I get the sampling frequency(rate) for the FFT?

yes, the number of samples and the SR determine the center frequencies of the bins.

Which direction should I be going in to ensure that that the amplitude corresponds to the right frequency in Hz (seen on the frequency bin X axis) ?

will always be a more or less accurate guess if you don't look at the surrounding bins , search for FFT leakage ..

 

If you have a equidistant sampled dataset (not always true for digital MEMS using an internal RC oscillator) and a constant (sine) exitation over the window (time) you look at, I suggest to use the extract tone(s) vis found in signal processing/ wfrm measurements

You need to know your samplerate ! 

One method: Apply a clean sine at known frequency , make a guess of the SR (samples/time), use extract tone.vi , use the frequency output to correct your SR. 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 2
(597 Views)