![](https://csdnimg.cn/release/download_crawler_static/86032796/bg1.jpg)
N=1000;
t=1:1000;
f=sin(0.03*t);
load noissin ;
e1=noissin;
init=2055615866;
randn( 'seed' ,init);
e = e1 + 0.5*randn(size(e1));
subplot(2,2,1);
plot(t,f); xlabel( '1 样本序列 ' ); ylabel( ' 原始信号幅值 ' );
grid ;
subplot(2,2,2);
plot(e) ; xlabel( '2 测试样本序列 ' ) ; ylabel( ' 含有已加噪声的信号幅值 ' ) ;
grid ;
s1=wden(e, 'minimaxi' , 's' , 'one' ,5, 'db12' );
subplot(2,2,3);
plot(s1);
xlabel( '3 db10 降噪后信号 ' ) ; ylabel ( 'db10 小波降噪后的信号幅值 ' );
grid;
s2=wden(e, 'heursure' , 's' , 'one' ,5, 'sym8' );
subplot(2,2,4);
plot(s2); xlabel( '4 sym 降噪后信号 ' ); ylabel( 'sym8 小波降噪后的信号幅值 ' ); grid;
figure;
subplot(6,1,1);plot(e);
ylabel( 'e' );
[C,L]=wavedec(e,5, 'db10' );
for i=1:5
a=wrcoef( 'a' ,C,L, 'db10' ,6-i);
subplot(6,1,i+1); plot(a);
ylabel([ 'a' ,num2str(6-i)]);
end
figure;
subplot(6,1,1);plot(e);
ylabel( 'e' );
for i=1:5
d=wrcoef( 'd' ,C,L, 'db10' ,6-i);
subplot(6,1,i+1);plot(d);
ylabel([ 'd' ,num2str(6-i)]);
end
评论0