J=9;
snr=4;
[sref,ns]=wavread(filename);
ns=ns(1:2048);
sref=sref(1:2048);
N=length(ns),
subplot(4,1,1);
plot(sref);
%ax15([01000]);
t1tle('');
%ns=noissin;
Subplot(4,l,2);
plot(ns);
%axis([0 1000,1.5 1.5])��
title('');
mm=1;
[c,1]=wavedec(ns,J��'sym8');
%alo=appcoef(c,1,'sym8',J);
dl=detcoef(c,1,1);
dn=zeros(l,N-length(appcoef(c,1,'Sym8',J)));
for i=J:-1:l
dd=detcoef(c,1,i);
for kk=1:length(dd)
dn(mm)=dd(kk);
mm=mm+1;
end;
end;
%dn=detcoef(c,1,[1:9]);
%d2=detcoef(c,1,2);
%d1=detcoef(c,1,1);
%subplot(5,1,3);
%plot(d3);
%subplot(5,1,4);
%plot(d2);
%subplot(5,1,5);
%plot(dl);
sigma=std(abs(dl),1);
thr=(2*log2(N))^0.5*sigma;
%thr=4.8;
softdn=wthresh(dn,'s',thr);
cl=[appcoef(c,1,'syms',J),softdn];
s1=waverec(cl,1,'Sym8');
subplot(4,1,3);
plot(s1);
%axis([0 1000 -1.5 1.5]);
title('');
%Garrot
garrotdn=garrot(dn,thr);
c3=[appcoef(c,1,'sym8',J),garrotdn];
s3=waverec(c3,1,'sym8');
subplot(4,1,4);
Plot(s3);
%axis([0 1000 -1.5 1.5]);
title('');