Remove gravity factor from accelerometer
4 views (last 30 days)
Show older comments
Vasileios Skaramagkas
on 23 Jun 2019
Answered: Sulaymon Eshkabilov
on 23 Jun 2019
Hello,
I am using a 3axis acceleromter ADXL345 and I want to frequencies between 0.5-25 Hz. I want to do some filtering first in order to get rid of the gravity factor and the dv offset as well as some noise. I have read multiple articles on the internet but none seems to be very clear. Can someone give me some quick tips to guide me with my task?
Thank you in advance
2 Comments
Jim Riggs
on 23 Jun 2019
This question is quite fuzzy for the following reasons:
Accelerometers do not measure gravity - they measure specific force which is the applied force (without the effects of gravity). Most people who use accelerometers that want to know the acceleration of the body being measured have to ADD the effect of gravity to get the true acceleration.
If you want to know how to select a filter for noise rejection, we need to know a bit more about the application.
If you want to estimate sensor bias, that is a different problem.
You need to restate your question and provide more information.
Accepted Answer
Sulaymon Eshkabilov
on 23 Jun 2019
Hi,
In your case, to reduce noise influence from your acceleration measurements with accelerometers you would need to employ band-pass filter (e.g. Butterworth) within [0.5, 30] Hz. E.g.:
SN = ... % Measured signal
% Band pass frequency range is between 0.5 and 30 Hz.
f1 = 0.5; f2=30;
% Normalized pass frequency ranges (Wn1, Wn2):
Wn1=f1/(0.5*fs);
Wn2=f2/(0.5*fs);
% Second order (N=2) filter passes all signal components within
% a frequency range of: [Wn1 Wn2]
N=2;
% Compute second order filter coefficients:
[b, a] = butter(N, [Wn1, Wn2], 'bandpass');
filter_F = filter(b, a, SN);
% Take FFT... of the filtered signal: filter_F
0 Comments
More Answers (0)
See Also
Categories
Find more on Signal Generation and Preprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!