【数字信号去噪】粒子滤波器与FBS、MAP平滑方法数字信号去噪【含Matlab源码 2179期】
创始人
2024-02-19 13:54:21
0

⛄一、平滑分解简介

根据奈奎斯特定理,采样频率必须大于等于有用信号最高频率的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 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除

相关内容

热门资讯

监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...
MFC文件操作  MFC提供了一个文件操作的基类CFile,这个类提供了一个没有缓存的二进制格式的磁盘...
有效的括号 一、题目 给定一个只包括 '(',')','{','}'...
【Ctfer训练计划】——(三... 作者名:Demo不是emo  主页面链接:主页传送门 创作初心ÿ...