下载此文档

小波去噪软阈值和硬阈值的matlab仿真程序.doc


文档分类:IT计算机 | 页数:约28页 举报非法文档有奖
1/28
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/28 下载此文档
文档列表 文档介绍
小波去噪软阈值和硬阈值的matlab仿真程序
%设置信噪比和随机种子值
snr=4;
init=2055615866;
%产生原始信号sref和高斯白噪声污染的信号s
[sref,s]=wnoise(1,11,snr,init);
%用db1小波对原始信号进行3层分解并提取系数
[c,l]=wavedec(s,3,'db1');
a3=appcoef(c,l,'db1',3);
d3=detcoef(c,l,3);
d2=detcoef(c,l,2);
d1=detcoef(c,l,1);
thr=1;
%进行硬阈值处理
ythard1=wthresh(d1,'h',thr);
ythard2=wthresh(d2,'h',thr);
ythard3=wthresh(d3,'h',thr);
c2=[a3 ythard3 ythard2 ythard1];
s3=waverec(c2,l,'db1');
%进行软阈值处理
ytsoftd1=wthresh(d1,'s',thr);
ytsoftd2=wthresh(d2,'s',thr);
ytsoftd3=wthresh(d3,'s',thr);
c3=[a3 ytsoftd3 ytsoftd2 ytsoftd1];
s4=waverec(c3,l,'db1');
%对上述信号进行图示
subplot(5,1,1);plot(sref);title('参考信号');
subplot(5,1,2);plot(s);title('染噪信号');
subplot(5,1,3);plot(s3);title('硬阈值处理');
subplot(5,1,4);plot(s4);title('软阈值处理');
%设置信噪比和随机种子值
snr=4;
init=2055615866;
%产生原始信号sref和高斯白噪声污染的信号s
[sref,s]=wnoise(1,11,snr,init);
%用db1小波对原始信号进行3层分解并提取系数
[c,l]=wavedec(s,3,'db1');
a3=appcoef(c,l,'db1',3);
d3=detcoef(c,l,3);
d2=detcoef(c,l,2);
d1=detcoef(c,l,1);
thr=1;
%进行硬阈值处理
ythard1=wthresh(d1,'h',thr);
ythard2=wthresh(d2,'h',thr);
ythard3=wthresh(d3,'h',thr);
c2=[a3 ythard3 ythard2 ythard1];
s3=waverec(c2,l,'db1');
%进行软阈值处理
ytsoftd1=wthresh(d1,'s',thr);
ytsoftd2=wthresh(d2,'s',thr);
ytsoftd3=wthresh(d3,'s',thr);
c3=[a3 ytsoftd3 ytsoftd2 ytsoftd1];
s4=waverec(c3,l,'db1');
%对上述信号进行图示
subplot(5,1,1);plot(sref);title('参考信号');
subplot(5,1,2);plot(s);title('染噪信号');
subplot(5,1,3);plot(s3);title('硬阈值处理');
subplot(5,1,4);plot(s4);title('软阈值处理');
Matlab小波消噪程序(原创)
[Yo,FS,NBITS,OPTS]=wavread('');
fs=FS
Y=Yo;
dt=1/FS;
YY=Yo(1800:9500)';
N=length(YY);
Y=YY+*randn(1,N);
time=(0:N-1)*dt;
(N-1)*dt
fY=fs*(1:N/2)/N;
yYY=abs(fft(YY));
yY=abs(fft(Y));
[c,l]=wavedec(Y,4,'coif4');
a4=appcoef(c,l,'coif4',4);
a3=appcoef(c,l,'coif4',3);
a2=appcoef(c,l,'coif4',2);
a1=appcoef(c,l,'coif4',1);
d4=detcoef(c,l,4);
d3=detcoef(c,l,3);
d2=detcoef(c,l,2);
d1=detcoef(c,l,1);
figure(1)
subplot(511);plot(a4);title('a

小波去噪软阈值和硬阈值的matlab仿真程序 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数28
  • 收藏数0 收藏
  • 顶次数0
  • 上传人phl805
  • 文件大小74 KB
  • 时间2017-09-08