|
楼主 |
发表于 2006-12-28 21:23
|
显示全部楼层
那请问如果也想把短时能量和过零率的横坐标也该为用时间显示
也问应该如何修改
[x,fs,bits] = wavread('F:\code\music\5.wav');
win=fs*20/1000;%
inc=win*0.5; %
%计算短时能量
subplot(len,1,2);
amp = sum(abs(enframe(filter([1 -0.9375], 1, x), win, inc)), 2);
t=(0:length(amp)-1)/fs;我这样写显示的小数
plot(t,amp);
%计算过零率
subplot(len,1,3);
tmp1 = enframe(x(1:end-1), win, inc);
tmp2 = enframe(x(2:end) , win, inc);
signs = (tmp1.*tmp2)<0;
diffs = (tmp1 -tmp2)>0.02;
zcr = sum(signs.*diffs, 2);
t=(0:length(zcr)-1)/fs;我这样写显示的小数
plot(t,zcr); |
|