数字信号去噪基于matlab粒子滤波器与FBSMAP平滑方法数字信号去噪含Matlab源码 2179期

Posted 海神之光

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了数字信号去噪基于matlab粒子滤波器与FBSMAP平滑方法数字信号去噪含Matlab源码 2179期相关的知识,希望对你有一定的参考价值。

一、平滑分解简介

根据奈奎斯特定理,采样频率必须大于等于有用信号最高频率的2倍。假设对心电信号的采样满足奈奎斯特采样定理,则实测信号采样频率的1/2为有用心电信号的最高频率。通过三点平滑滤波,可以将频率大于1/2采样频率的信号滤除,将滤除的信号定义为第1阶平滑分解分量(sdc1)。而剩余信号中的最高频率则为前一阶提取频率的下限。继续按剩余信号最高频率的1/2进行新的平滑滤波提取,平滑滤波点数为前一级平滑滤波点数的2倍减1。直到平滑点数大于1/2数据长度且小于数据长度时分解结束。平滑分解方法描述如下。

设实际检测到的心电信号为s(n),n=1,2,…,N为样本序号,N为信号长度。记第k阶平滑分解分量为sdck(n),剩余信号记为rk(n),k=1,2,…,M。M=int(lb2(N-1))为最大分解阶数。

1)当k=1时

2)当k≥2时

在以上各式中,当i<1或i>N时,s(i)和rk-1(i)取相应的数据端点值。

  1. 信号重构

二、部分源代码

close all
T=100; %Number of Time Steps
n=10; %Number of Particles
m=1; %Number of iterations

for iter=1:m
%Mean and standard deviation of state equation
a=.6; b=.2;
%Mean and standard deviation of state equation
c=2; d=.2;

%Simulate the dynamical system x and y, initializing x(1)=x0
x0=rand;
[x,y]=simulate(a,b,c,d,x0,T);

%Particle Filter, particles initialized at xf(:,1)=X0
X0=random(‘uniform’,0,1,n,1);
tic
[xf,wftilda]=pfilter(a,b,c,d,X0,y);
toc

%Particle Smoothing (FBS)
tic
[wstilda wstilda2,wstilda3]=fbssmoother(a,b,xf,wftilda);
toc

%Particle Smoother (Maximum A-posterior) initialized at xf(:,1)=X20
%Initialization
X20=zeros(n,1);
tic
[psi,delta,meanm,wstilda4,wstilda5]=mapsmoother(a,b,c,d,X20,xf,wftilda,y);
toc

%Estimation of filter and fbs smoother posterior means at time t
for t=2:T
meanf(t)=xf(:,t)‘*wftilda(:,t);
means(t)=xf(:,t)’*wstilda(:,t);
meansf(t)=xf(:,t)'*wstilda(:,t);
end

%Computes the MSE of filter, fbs, and map
FilterMSE(iter)=norm(x(2:end)-meanf(2:end),‘fro’)/norm(x(2:end),‘fro’)
FBSsmootherMSE(iter)=norm(x(2:end)-means(2:end),‘fro’)/norm(x(2:end),‘fro’)
MAPsmootherMSE(iter)=norm(x(2:end)-meanm(2:end),‘fro’)/norm(x(2:end),‘fro’)
%Computes the Likelihood of filter, fbs, and map
LL(iter)=likelihood(y,x,a,b,c,d)
FilterLL(iter)=likelihood(y,meanf,a,b,c,d)
FBSsmootherLL(iter)=likelihood(y,means,a,b,c,d)
MAPsmootherLL(iter)=likelihood(y,meanm,a,b,c,d)
end

if m==1
%Plots of simulated x vs the estimated xhat of filter, fbs, and map
hold on
plot(x(2:end),‘k’,‘linewidth’,2)
plot(meanf(2:end),‘:r*’,‘linewidth’,2)
plot(means(2:end),‘:go’,‘linewidth’,2)
plot(meanm(2:end),‘:bd’,‘linewidth’,2)
xlabel(‘time’)
ylabel(‘state’)
h = legend(‘True State’,‘Filter’,‘FBS-Smoother’,‘MAP-Smoother’);
else
fmean=mean(FilterMSE)
smean=mean(FBSsmootherMSE)
mmean=mean(MAPsmootherMSE)
fll=mean(FilterLL)
sll=mean(FBSsmootherLL)
mll=mean(MAPsmootherLL)
end

三、运行结果

四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1]张淼,魏国.心电信号平滑分解阈值去噪方法[J].哈尔滨工程大学学报. 2020,41(09)

3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除

以上是关于数字信号去噪基于matlab粒子滤波器与FBSMAP平滑方法数字信号去噪含Matlab源码 2179期的主要内容,如果未能解决你的问题,请参考以下文章

基于MATLAB的IIR滤波器的设计及应用(信号去噪)怎么设计啊

数字信号去噪基于matlab小波软阈值+硬阈值+改进阈值数字信号去噪含Matlab源码 1025期

图像去噪基于matlab高通+低通+带通+方向滤波器图像滤波含Matlab源码 1209期

图像去噪基于matlab高斯+均值+中值+双边滤波图像去噪含Matlab源码 1872期

图像去噪基于matlab GUI加权+绝对差分中值滤波图像去噪含Matlab源码 1880期

数字信号去噪基于matlab小波阙值数字信号去噪和求信噪比含Matlab源码 2191期