资源简介

基于matlab利用小波变换去除脉搏波基线漂移算法代码

资源截图

代码片段和文件信息

data=textread(‘F:\adc.txt‘‘%n‘‘delimiter‘‘‘)
[mn]=size(data);
t=0:0.01:1.99;
xn=200*sin(2*pi*t);
data1=data‘+xn;
h=plot(data1);
xlabel(‘time‘);
ylabel(‘magtitude‘);
title(‘(b)加基线漂移的脉搏波信号‘);
set(h‘Color‘‘b‘‘Linestyle‘‘-‘‘LineWidth‘1.7);
x=data1;
[cl]=wavedec(x5‘db5‘);
a5 = wrcoef(‘a‘cl‘db5‘5);
a4 = wrcoef(‘a‘cl‘db5‘4);
a3 = wrcoef(‘a‘cl‘db5‘3);
a2 = wrcoef(‘a‘cl‘db5‘2);
a1 = wrcoef(‘a‘cl‘db5‘1);
figure(2);
subplot(511);plot(a5‘LineWidth‘2);ylabel(‘a5‘);title(‘重构得到的逼近信号‘);
subplot(512);plot(a4‘LineWidth‘2);ylabel(‘a4‘);
subplot(513);plot(a3‘LineWidth‘2);ylabel(‘a3‘);
subplot(514);plot(a2‘LineWidth‘2);ylabel(‘a2‘);
subplot(515);plot(a1‘LineWidth‘2);ylabel(‘a1‘);
xlabel(‘时间 t/s‘);
[cl]=wavedec(x5‘db5‘);
d5 = wrco

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1440  2020-07-27 11:52  xiaobo.m

评论

共有 条评论