buptcxy 发表于 2009-5-4 16:41

求助语谱图峰值点提取

Winsiz = 256; Shift = 32; Base = 0; = wavread('E:\1.wav');
n = floor((length(Sg) - Winsiz)/Shift)+1;%总的帧数
A = zeros(Winsiz/2+1 , n);
for i = 1:n
    n1 = (i-1)*Shift + 1;%每帧的帧头
    n2 = n1 + Winsiz - 1;%每帧的帧尾
    s = Sg(n1:n2); s = s.*hanning(Winsiz);%加窗
    z = fft(s);%求fft
    z = z(1:(Winsiz/2)+1); z = z.*conj(z);%复数求共轭,并计算能量
    z = 10 * log10(z);%得到语谱图的db表示
    A(:,i) = z;
end
L0 = (A > Base); L1 = (A < Base);
B = A.*L0 + Base*L1;%滤除db小于0的点
L = (B-Base)./(max(max(B))-Base);%归一化
y = *Fs/Winsiz; x = *Shift/1000;

figure(1); mesh(x,y,A); xlabel('时间(s)'); ylabel('频率(Hz)'); zlabel('分贝(db)'); title('mesh plot');
以上是画谱图的程序,从网上找的~接下来老师让我做的是要每0.1秒提取一个峰值点(0.1s内的极值),还要记录下相应的横纵坐标(也就是时间和频率) 有没大牛肯帮帮我啊 :'(

[ 本帖最后由 ChaChing 于 2009-5-4 21:12 编辑 ]

ChaChing 发表于 2009-5-4 21:13

help max
页: [1]
查看完整版本: 求助语谱图峰值点提取