Signal Processing For Integration

10 views (last 30 days)
Hello, i'm doing an experimental Program. I read some data from an IMU sensor, precisely i read accelerometer data along 3 axis (x, y, z), every 0,04s.
Now i want to pass from vertical acceleration data (in my case the vertical acceleration is on the y-axis), to vertical displacement data. I know the noisy of signal, i read lot about different double integration technique. I tried Euler Method, but the drift is very high (and I know that this is a consequence of using this method).
I read instead of the Kalman filter, or by using Fourier offer approximations more real.
I want to focus particularly on Fourier, are not a numerical analysis expert, i wanted to ask if someone can give me some advice on how to set it up, and then switch between the time domain to a frequency domain, and then do the double integration to obtain displacement and return in the time domain.
Can someone help me?

Accepted Answer

Star Strider
Star Strider on 8 Jan 2017
The documentation for the fast Fourier transform is here: fft (link). Particularly note the code between the first (top) two plot figures. Use the Fourier transform to determine what part of the spectrum are your signals, and what part are noise.
First, I would use a bandpass filter to eliminate the constant (d-c) offset at the low end and the noise at the high end. In my opinion, FIR filters are best for this. The easiest way to design your filter is to use the designfilt function.
Always check the performance of your filter with the freqz function to be certain it is doing what you want it to do.
Use the filtfilt function to do the actual filtering. It has a maximally-flat phase characteristic, so no phase distortion will appear in your filter regardless of the filter design you use. (You do not have to use a Bessel filter for this.)
Second, after you have filtered your signals, integrate them with the cumtrapz (or trapz) function. The reason to do the filtering first is to remove the constant offset of low-frequency baseline variation, because if you do not, these will integrate with your signal, producing meaningless results for your displacement data.
  10 Comments
sbareben
sbareben on 27 Apr 2017
Edited: sbareben on 27 Apr 2017
Sorry again, but in previous sample code of Cheby filter that you post, how did you find or set the stopband and passband ripple? Are calculated in function of Passband and stopband frequencies? And how do you determine the Passband and Stopband frequencies?
Star Strider
Star Strider on 27 Apr 2017
The passband and stopband ripple amplitudes are essentially just ‘what works’. In a Chebyshev Type II filter, the passband ripple is essentially irrelevant, because it has a flat passband. A large value usually results in a stable, short filter. The stopband ripple is the attenuation in the stopband, so a good choice is 50 dB, with a stopband amplitude of 1E-5.
Filter design is a compromise between the performance the filter designer wants, and the practical considerations in the filter implementation. This applies to both continuous and discrete filters. In continuous filters, the problem is hardware complexity, in discrete filters, the problem is filter length.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!