【卡尔曼滤波器-Python】The g-h filter white white noise(白噪声)

来源:互联网 发布:大量淘宝账号 编辑:程序博客网 时间:2024/06/05 06:12

用G-H滤波器减少白噪声

  • 用G-H滤波器减少白噪声
    • 白噪声的模拟
    • 不同初值对滤波结果影响

白噪声的模拟

这里采用numpy.random.randn()函数随机生成期望为0的有限变量,生成的过程即在原始数据上加上随机生成的噪声,定义如下的函数

from numpy.random import randndef gen_data(x0,dx,count,noise_factor):    return [x0+dx*i+randn()*noise_factor for i in range(count)]mensurements=gen_data(5,2,100,10)

这里写图片描述

不同初值对滤波结果影响

采用上一篇博文中的G-H filter1进行滤波处理,并设定不同的初值得到的滤波效果

data=g_h_filter(data=mensurements, x0=5., dx=2., dt=1., g=0.2, h=0.01);

这里写图片描述

data=g_h_filter(data=mensurements, x0=100, dx=2., dt=1., g=0.2, h=0.01);

这里写图片描述



  1. http://blog.csdn.net/lpcarl/article/details/50608281 ↩
0 0
原创粉丝点击