Savitzky-Golay 滤波与Kalman滤波对比

admin2024-04-03  0

分别使用SG滤波和Kalman滤波对比了平滑RTK解算的1s基线变化高斯坐标系XYH如下图:

从红框可以看出,SG滤波一定程度反应了波动情况,kalman滤波没有反映出来(PS:当然也可能和我设置参数有关,大家可以尝试)

Savitzky-Golay 滤波与Kalman滤波对比,第1张

matlab代码如下:

clear
clc
% close all
load RTK.mat

%% 滤波算法
Q=0.005; R=100;
[Xfilter1, Pfilter1] = kalmanFor1D( diffpos(:,1),Q, R);% kalman滤波,内部噪声参数已经调好
[smoothZTD1] = smooth( diffpos(:,1),100 , 'sgolay',6);% SG滤波100个点作为弧段用6阶多项式拟合

[Xfilter2, Pfilter2] = kalmanFor1D( diffpos(:,2),Q, R);% kalman滤波,内部噪声参数已经调好
[smoothZTD2] = smooth( diffpos(:,2),100 , 'sgolay',6);% SG滤波100个点作为弧段用6阶多项式拟合

[Xfilter3, Pfilter3] = kalmanFor1D( diffpos(:,3),Q, R);% kalman滤波,内部噪声参数已经调好
[smoothZTD3] = smooth( diffpos(:,3),100 , 'sgolay',6);% SG滤波100个点作为弧段用6阶多项式拟合

%% 滤波曲线
h_fig = figure('name', 'plot','unit','centimeters', 'position',[1 1 12.9 10]);
subplot(3,1,1)
hold on
plot(diffpos(:,1), 'b-.','LineWidth',1)
plot(smoothZTD1, 'g','LineWidth',1)
plot(Xfilter1, 'r','LineWidth',1)
ylabel('GaussX (m)')
set(gca,'fontsize',10, 'fontname', 'Arial')
legend('Orginal-XYH', 'Savitzky-Golay', 'Kalman','Orientation','horizontal')
legend('boxoff')
set(gca,'fontsize',10, 'fontname', 'Arial')

subplot(3,1,2)
hold on
plot(diffpos(:,2), 'b-.','LineWidth',1)
plot(smoothZTD2, 'g','LineWidth',1)
plot(Xfilter2, 'r','LineWidth',1)
ylabel('GaussY (m)')
set(gca,'fontsize',10, 'fontname', 'Arial')

subplot(3,1,3)
hold on
plot(diffpos(:,3), 'b-.','LineWidth',1)
plot(smoothZTD3, 'g','LineWidth',1)
plot(Xfilter3, 'r','LineWidth',1)
ylabel('GaussH (m)')
set(gca,'fontsize',10, 'fontname', 'Arial')
set(gca,'fontsize',10, 'fontname', 'Arial')
xlabel('Epoch (1 s)')


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明原文出处。如若内容造成侵权/违法违规/事实不符,请联系SD编程学习网:675289112@qq.com进行投诉反馈,一经查实,立即删除!