LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Questions regading FFT

Hi, I've trying to measure displacement from a data set of accel, but I'm not sure if I'm going about correctly. First I subtract the mean and transform the units from g to milimeters. Right now I'm only working on the y axis, and so I enter the data in the FFT.vi. In my mind, if I divide this output  by fs squared (where fs = 1/dt) then take the inverse FFT I should be getting displacement, but the result I get doesn't make sense to me. Am I missing any steps , e.g. data I'm supposed to scale? 

 

Attached is a capture of the FFT part of my vi. You'll notice I wired the fourier boxes in a variety of ways, hoping to understand hoy they worked. Thanks  a lot!

0 Kudos
Message 1 of 6
(2,747 Views)

Attach your VI and some real data. That picture is useless to troubleshoot.

 

What is the raw data?

What is "accel"?

What is the theory you are using? Do you have a link? (this?)

How do you transform units (g to mm), they seem incompatible.

0 Kudos
Message 2 of 6
(2,738 Views)

If you have acceleration data you need to integrate twice to get displacement.

If you want to do that in the frequency domain, you have to divide the bins by w²

FFT basics are found in the help and for example at wikipedia.

If you have an arbitary number of samples you might do a DFT 😉

 

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 3 of 6
(2,723 Views)

@altenbach

 

The raw data is acceleration in g, as measured by an imu around its three axes. The reason I only attached that screenshot was I figured it would be hard for you to reproduce the process (unless you have an imu of your own). So far as I can tell, there are no bugs in acquiring the data since I've used the same code for a multitude of other projects and they all worked fine.

The theory comes from my own (very,very limited) understanding of signal processing. The fourier transform of the integral of x(t) is simply X(f)/fs. But thanks for the link, I'll check it out. As for the units, 1 g = 9,8... m/s2 therefore multiplying any data that comes in units of g by 9,8 E3 will give the value in mm. 

 

@Henrik Volkers 

The user selects a number of samples, say 3000, and also the dt (1 ms, 8 ms, etc.). Every dt, the vi gets a new value from the imu and stores it in an array. After all the samples have been acquired it shoots the array through the fft.vi  .  Although I think I understand enough about Fourier to get displacement form acceleration in the frecuency domain, my main question was regarding LabView's approach to it.  Is my wiring correct? Also, if I sum all the values obtained from the InverseFFT.vi , I should obtain net displacement, is that correct?  

 

 

Tomorrow I'll post the data coming in and out, which is what I probably should have done in the first place. Thanks a lot.

 

 

0 Kudos
Message 4 of 6
(2,715 Views)

displacement s

velocity v is d/dt s

acceleration a is d/dt v is d/dt² s

 

so the summ of all points of a is a (integral of a) velocity

the sum of all inverseDFT( DFT(a(t)) / f ) should end up in a displacement (first integral in the freq-domain, second integral in the dicrete time-domain)

 

how the fourier transform vi output the data can be found in the help

time domain: n samples with dt , total time n*dt

freq domain: n bins with df=1/(n*dt) (or n/2 in complex)

both representations are equal in the means of included information

 

 

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 5 of 6
(2,692 Views)

Attached is my vi, and also a spreadsheet of the outputs. Fs = 100 Hz.Left column is accel in milimeters/s2, right is displacement in mm.

 

 

Download All
0 Kudos
Message 6 of 6
(2,683 Views)