赞
踩
s=importdata('C:\Users\Administrator\Desktop\steady.txt');
figure(1)
plot(s);
title('原始信号');
%%%一层小波分解
lengthS=length(s);
[cA1,cD1]=dwt(s,'db1');
%%%系数中构建
A1=idwt(cA1,[],'db1',lengthS);
D1=idwt([],cD1,'db1',lengthS);
%%%显示近似于细节
figure(2);
title('近似系数与细节系数');
subplot(1,2,1);plot(A1);title('近似电流信号');
subplot(1,2,2);plot(D1);title('细节系数');
%%%恢复原始信号
A0=idwt(cA1,cD1,'db1',lengthS);
figure(3);
plot(A0);
title('恢复信号');
err = max(abs(s-A0));
[thr,sorh] = ddencmp('den','wv',s);
dswd = wthresh(swd,sorh,thr);
clean = iswt(swa,dswd,'db1');
%%%显示原始信号和除噪信号如下
figure(5);
subplot(2,1,1), plot(s);
title('Original signal')
subplot(2,1,2), plot(clean);
title('denoised signal')
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。