基于MATLAB的语音端点检测

时间:2022-11-21 01:59:20 作者:壹号 字数:1048字

基于MATLAB的语音端点检测

短时能量matlab实现:

[x]=wavread('song1.wav');

x=x/max(abs(x));

figure;

subplot(3,1,1);

plot(x); axis([1 length(x) -1 1]); ylabel('Speech'); FrameLen=240; FrameInc=80;

yframe=enframe(x,FrameLen,FrameInc);

amp1=sum(abs(yframe),2);

subplot(3,1,2); plot(amp1); axis([1 length(amp1) 0 max(amp1)]); ylabel('Amplitude'); legend('amp1=∑│x│');

amp2=sum(abs(yframe.*yframe),2);

subplot(3,1,3);

plot(amp2); axis([1 length(amp2) 0 max(amp2)]);

ylabel('Energy');

legend('amp1=∑│x*x│');

短时过零率matlab实现:

[x]=wavread('song1.wav'); figure; subplot(3,1,1); plot(x); axis([1 length(x) -1 1]); ylabel('Speech');

FrameLen = 240;

FrameInc = 80;

amp = sum(abs(enframe(filter([1 -0.9375], 1, x), FrameLen, FrameInc)), 2); subplot(312)

plot(amp);

axis([1 length(amp) 0 max(amp)])

…… 此处隐藏0字 ……

ylabel('Energy');

tmp1 = enframe(x(1:end-1), FrameLen, FrameInc);

tmp2 = enframe(x(2:end) , FrameLen, FrameInc);

signs = (tmp1.*tmp2)<0;

diffs = (tmp1 -tmp2)>0.02;

zcr = sum(signs.*diffs, 2);

subplot(3,1,3);

plot(zcr);