What is the best way to fixe number jumps in GPS/IMU Data Plot

조회 수: 4(최근 30일)
Antoine Dilly
Antoine Dilly 2021년 10월 5일
댓글: Mathieu NOE 2021년 10월 25일
Hey,
I hope someone has a tip on how to best correct jumps in position data from GPS/IMU. There is always a correction of the position when a new data set of the GPS receiver is available.
Which approach, function or method is best way to correct such data?
I am happy for any help :)

답변(1개)

Mathieu NOE
Mathieu NOE 2021년 10월 5일
hello
why not apply a smoothing filter - there are many options, maybe start with smoothdata
example code :
clc
close all
Fs = 1000;
samples = 1000;
dt = 1/Fs;
t = (0:samples-1)*dt;
y = square(2*pi*3*t) + 0.1*randn(size(t));
% %%%%%%%%%%%%%%%%
figure(1)
N = 25;
ys = smoothdata(y, 'gaussian' , N);
plot(t,y,t,ys);legend('Raw','Smoothed');
title(['Data samples at Fs = ' num2str(round(Fs)) ' Hz / Smoothed with smoothdata' ]);
% %%%%%%%%%%%%%%%%
figure(2)
N = 25;
ys = medfilt1(y, N,'truncate');
plot(t,y,t,ys);legend('Raw','Smoothed');
title(['Data samples at Fs = ' num2str(round(Fs)) ' Hz / Smoothed with medfilt1' ]);
grid on
%%%%%%%%%%%%%%%%
figure(3)
ys = sgolayfilt(y,1,21);
plot(t,y,t,ys);legend('Raw','Smoothed');
title(['Data samples at Fs = ' num2str(round(Fs)) ' Hz / Smoothed with sgolayfilt' ]);
grid on
%%%%%%%%%%%%%%%%
NN = 2;
Wn = 0.25;
[B,A] = butter(NN,Wn);
figure(4)
ys = filtfilt(B,A,y);
plot(t,y,t,ys);legend('Raw','Smoothed');
title(['Data samples at Fs = ' num2str(round(Fs)) ' Hz / Smoothed with butterworth LP' ]);
grid on

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by