- https://www.mathworks.com/matlabcentral/answers/183658-how-to-correct-for-a-drifting-baseline
- https://www.mathworks.com/matlabcentral/answers/400944-how-to-correct-the-baseline-shift-of-the-signal
Using matlab to remove drift from integrated accelerometer data
69 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I am using the sensors within my phone to generate a CSV file of accelerations in 3-axis (x,y,z). I have now imported the data to matlab using the CSVread funtion and have began processing the data.
I have applied a filter to reduce some of the noise from the signal however upon integration the signal still drifts. The code I am using is shown below, for simplicitys sake I am only showing data from one axis. Any help is appreciated
clear; close; clc;
D=csvread('test20m3.csv');
t=D(:,1); %Define time
XAccRaw=D(:,5); %Define X acceleration
XAcc=XAccRaw*9.81; %Convert to m/s^2
d=designfilt('lowpassfir','filterorder',10,'CutOffFrequency',10,'SampleRate',100); %Lowpass FIR filter
AX=filtfilt(d,XAcc); %Apply filter to data
VX=cumtrapz(t,AX); %Integrate acceleration to get velocity
SX=cumtrapz(t,VX); %Integrate velocity to get displacement
figure(1);
plot(t,SX);
xlabel(Time (s));
ylabel(Displacement (m))
0 件のコメント
回答 (1 件)
Rajani Mishra
2020 年 4 月 16 日
To resuce signal drift you can try detrending your signal for that you can use "detrend" function. Also, refer to below given MATLAB answers questions for other ways to reduce the signal drift:
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Signal Generation and Preprocessing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!