马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
load noisbloc
s=noisbloc(1:1024);
ls=length(s);
[cA1,cD1]=dwt(s,'db4');
A1=upcoef('a',cA1,'db4',1,ls);
D1=upcoef('d',cD1,'db4',1,ls);
subplot(2,1,1);plot(A1);title('低频A1')
subplot(2,1,2);plot(D1);title('高频D1')
A0=idwt(cA1,cD1,'db4',ls);
figure(2)
subplot(2,1,1);plot(s);title('原始信号')
subplot(2,1,2);plot(A0);title('重构信号')
[C,L]=wavedec(s,5,'db4');
cA5=appcoef(C,L,'db4',5);
A5=wrcoef('a',C,L,'db4',3);
D1=wrcoef('d',C,L,'db4',1);
D2=wrcoef('d',C,L,'db4',2);
D3=wrcoef('d',C,L,'db4',3);
D4=wrcoef('d',C,L,'db4',4);
D5=wrcoef('d',C,L,'db4',5);
subplot(3,2,1);plot(A5);title('低频A5')
subplot(3,2,2);plot(D1);title('高频D1')
subplot(3,2,3);plot(D2);title('高频D2')
subplot(3,2,4);plot(D3);title('高频D3')
subplot(3,2,5);plot(D3);title('高频D4')
subplot(3,2,6);plot(D3);title('高频D5')
figure(3)
A0=waverec(C,L,'db4');
subplot(3,1,1);plot(s);title('原始信号')
subplot(3,1,2);plot(A0);title('重构信号')
subplot(3,1,3);plot(s-A0);title('误差信号')
err = max(abs(s-A0))
错误:???Attmpt to execute SCRIPT dwt as a function
Error in ==>bo1 at 4
[cA1,cD1]=dwt(s,'db4');
谢谢诸位!
|