小波系数

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

m=load('C:\Users\asus\Desktop\毕业设计\毕设论文\肌电数据\1-26实验数据\肌电信号\leixingzou2\EMG01-1_Normalized.txt');
N=length(m);
for i=1:N-1 ;
q(i,1)=m(i,2);
end;
d=q';
s1=d;
change=300;
[c,l] = wavedec(d,3,'db4');

%提取小波分解后的低频系数
ca3=appcoef(c,l,'db4',3);

%提取各层小波分解后的高频系数
cd3=detcoef(c,l,3);
cd2=detcoef(c,l,2);
cd1=detcoef(c,l,1);
figure(1);title('小波分解系数');
subplot(411);plot(ca3);ylabel('Ca3');
%title('低频系数');
subplot(412);plot(cd1);ylabel('Cd1');
%title('高频系数');
subplot(413);plot(cd2);ylabel('Cd2');
%title('高频系数');
subplot(414);plot(cd3);ylabel('Cd3');
%title('高频系数');

%对信号强制消噪
%cdd3=zeros(1,length(cd3));%第三层高频系数cd3全置0
%cdd2=zeros(1,length(cd2));%第二层高频系数cd2全置0
%cdd1=zeros(1,length(cd1));%第一层高频系数cd1全置0

%c1=[ca3,cdd3,cdd2,cdd1];%构建新的系数矩阵
%s2=waverec(c1,l,'db4')%分解新的结构

[thr,sorh,keepapp]=ddencmp('den','wv',d);
s2=wdencmp('gbl',c,l,'db4',4,thr,sorh,keepapp);

figure(2);
subplot(211);
plot(1:change,s1(1:change));
title('原始信号');
ylabel('S1');

subplot(212);
plot(1:change,s2(1:change));
title('软阀值消噪后信号');
ylabel('S2');

wpt=wpdec(s1,3,'db1','shannon');

%plot(wpt);

%重构第三层8个节点小波系数
s130=wprcoef(wpt,[3,0]);
s131=wprcoef(wpt,[3,1]);
s132=wprcoef(wpt,[3,2]);
s133=wprcoef(wpt,[3,3]);
s134=wprcoef(wpt,[3,4]);
s135=wprcoef(wpt,[3,5]);
s136=wprcoef(wpt,[3,6]);
s137=wprcoef(wpt,[3,7]);

%计算第三层8个节点小波能量
s10=norm(s130);
s11=norm(s131);
s12=norm(s132);
s13=norm(s133);
s14=norm(s134);
s15=norm(s135);
s16=norm(s136);
s17=norm(s137);

%计算方差
st10=max(s130);
st11=max(s131);
st12=max(s132);
st13=max(s133);
st14=max(s134);
st15=max(s135);
st16=max(s136);
st17=max(s137);

disp('正常信号的特征向量');
snorm1=[s10,s11,s12,s13,s14,s15,s16,s17];
std1=[st10,st11,st12,st13,st14,st15,st16,st17];

%显示三层个节点小波系数
figure(3);
subplot(421);plot(1:change,s130(1:change));ylabel('S30');
subplot(422);plot(1:change,s131(1:change));ylabel('S31');
subplot(423);plot(1:change,s132(1:change));ylabel('S32');
subplot(424);plot(1:change,s133(1:change));ylabel('S33');
subplot(425);plot(1:change,s134(1:change));ylabel('S34');
subplot(426);plot(1:change,s135(1:change));ylabel('S35');
subplot(427);plot(1:change,s136(1:change));ylabel('S36');
subplot(428);plot(1:change,s137(1:change));ylabel('S37');


相关文档
最新文档