www.pudn.com > energysum.rar > energysum.m


function energysum() 
wavesource=wavread('D:\mymusic\22.wav');%读取语音信号 
wl=length(wavesource); 
ml=5000;    %设定截取语音信号的长度 
waves=wavesource(fix(wl/2)-ml/2+1:fix(wl/2)+ml/2,2);%截取语音信号 
l=200; 
e=zeros(ml,1); 
for n=l:ml 
    [e(n)]=energysuming(waves,n,l);%调用计算短时能量的函数 
end  
subplot(2,1,1); 
plot(waves);%画出原语音信号的波形 
title('画出原语音信号的波形'); 
subplot(2,1,2); 
n=1:1:ml; 
plot(n,e(n));%画出短时能量的波形 
title('画出短时能量的波形');