[C,L]=wavedec(x,3,'db4');
[thr,sorh,keepapp]=ddencmp('den','wv',x);
de_noise=wdencmp('gbl',C,L,'db4',3,thr,sorh,keepapp);
xx=de_noise;
x1=filter([1 -0.9375],1,xx);
x=x1/max(abs(x1));
y=enframe(x,256,80);
amp=sum(y.*y,2);
temp1=enframe(x(1:length(x)-1),256,80);
temp2=enframe(x(2:length(x)),256,80);
signs=(temp1.*temp2)<0;
diffs=abs(temp1-temp2)>0.02;
zcr=sum(signs.*diffs,2);
ef=amp.*zcr;
amp=amp';
ef=ef';
zcr=zcr';
s1=qishiduandian(ef);
s2=jieshuduandian(ef);
x2=x((s1-1)*80+1:(s2-1)*80+256);
- 1
- 2
- 3
前往页