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

2 ビュー (過去 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
  2 件のコメント
Mathieu NOE
Mathieu NOE 2021 年 10 月 12 日
Hi
problem solved ?
Mathieu NOE
Mathieu NOE 2021 年 10 月 25 日
hello again
problem solved ?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by