|
短时能量和过零率
[x1]=wavread('one.wav');
x1=double(x1);
x=x1/max(abs(x1));
figure;
subplot(4,1,1);
plot(x);
axis([1 length(x) -1 1]);
ylabel('Speech');
enhance=filter([1 -0.9375],1,x);
FrameLen=440;
FrameInc=220;
yframe=enframe(enhance,FrameLen,FrameInc);
amp1=sum(abs(yframe),2);
subplot(4,1,2);
plot(amp1);
axis([1 length(amp1) 0 max(amp1)]);
ylabel('Energy');
legend('amp1=∑│x│');
amp2=sum(abs(yframe.*yframe),2);
subplot(4,1,3);
plot(amp2);
axis([1 length(amp2) 0 max(amp2)]);
ylabel('Energy');
legend('amp1=∑│x*x│');
tmp1=enframe(x(1:end-1),FrameLen,FrameInc);
tmp2=enframe(x(2:end),FrameLen,FrameInc);
signs=(tmp1.*tmp2)<0;
diffs=abs(tmp1-tmp2)>0.02;
zcr=sum(signs.*diffs,2);
subplot(4,1,4);
plot(zcr);
axis([1 length(zcr) 0 max(zcr)]);
ylabel('ZCR');
legend('zcr'); |
|