【正文】
.%% Outputs: x a sparse matrix containing the filterbank amplitudes% If x is the only output argument then size(x)=[p,1+floor(n/2)]% otherwise size(x)=[p,mxmn+1]% mn the lowest fft bin with a nonzero coefficient% mx the highest fft bin with a nonzero coefficient%% Usage: f=fft(s)。 f=fft(s)。% x=melbankm(p,n,fs)。 [x,na,nb]=melbankm(p,n,fs)。% n2=1+floor(n/2)。 z=log(x*(f(na:nb)).*conj(f(na:nb)))。% z=log(x*abs(f(1:n2)).^2)。% c=dct(z)。 c(1)=[]。%% To plot filterbanks . plot(melbankm(20,256,8000)39。)%% Copyright (C) Mike Brookes 1997% Version: $Id: ,v 2005/02/21 15:22:13 dmb Exp $%% VOICEBOX is a MATLAB toolbox for speech processing.% Home page: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This program is free software。 you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation。 either version 2 of the License, or% (at your option) any later version.%% This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY。 without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.%% You can obtain a copy of the GNU General Public License from% ftp://% Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%if nargin 6 w=39。tz39。 if nargin 5 fh=。 if nargin 4 fl=0。 end endendf0=700/fs。fn2=floor(n/2)。lr=log((f0+fh)/(f0+fl))/(p+1)。% convert to fft bin numbers with 0 for DC termbl=n*((f0+fl)*exp([0 1 p p+1]*lr)f0)。b2=ceil(bl(2))。b3=floor(bl(3))。if any(w==39。y39。) pf=log((f0+(b2:b3)/n)/(f0+fl))/lr。 fp=floor(pf)。 r=[ones(1,b2) fp fp+1 p*ones(1,fn2b3)]。 c=[1:b3+1 b2+1:fn2+1]。 v=2*[ ones(1,b21) 1pf+fp pffp ones(1,fn2b31) ]。 mn=1。 mx=fn2+1。else b1=floor(bl(1))+1。 b4=min(fn2,ceil(bl(4)))1。 pf=log((f0+(b1:b4)/n)/(f0+fl))/lr。 fp=floor(pf)。 pm=pffp。 k2=b2b1+1。 k3=b3b1+1。 k4=b4b1+1。 r=[fp(k2:k4) 1+fp(1:k3)]。 c=[k2:k4 1:k3]。 v=2*[1pm(k2:k4) pm(1:k3)]。 mn=b1+1。 mx=b4+1。endif any(w==39。n39。) v=1cos(v*pi/2)。elseif any(w==39。m39。) v=*cos(v*pi/2)。endif nargout 1 x=sparse(r,c,v)。else x=sparse(r,c+mn1,v,p,1+fn2)。end2 提取基因和共振峰的程序%% dpclear all。clcclose all hiddenformat long waveFile=39。39。[speech, sf, nbits]=wavread(waveFile)。index1=4000。nfft=1000。index2=index1+nfft1。y=speech(index1:index2)。t=0:1/sf:(nfft1)/sf。nn=1:nfft/4。dt=1/sf。subplot(2,1,1)z=rceps(y)。 %MATLAB提供的倒頻譜函數(shù)plot(t(nn),abs(z(nn)))。title(39。z=rceps(y)39。)ylabel(39。Amplitude39。)。xlabel(39。Quefrency39。)Y=fft(y)。subplot(2,1,2)plot(log(abs(Y)))。 hold ontitle(39。Log Spectrum39。)。figure(2)mcep=40。%加窗subplot(2,1,1)nn=1:mcep。z1=z(nn)。plot(t(nn),abs(z1(nn)))。title(39。Envelope Information in Quefrency Space39。)z11=[z139。 zeros(1,10002*mcep) z1(mcep:1:2)39。]。%fft變換subplot(2,1,2)z2=fft(z11)。plot(real(z2))。title(39。Frame Speech Envelope39。)。figure(1)。subplot(2,1,2)。 plot(real(z2),39。r39。)。[Cmax Cloc]=max(abs(z(41:320)))。T0=(Cloc+40)*dt。F0=1/T0。fprintf(39。Fundamental Frequency F0= %\n39。,F0)。致謝: 本論文的指導(dǎo)老師是西南大學(xué)電子信息工程學(xué)院的李太華老師。從論文的選題到深入研究的過程中,李老師都給了我很多啟發(fā)性的指導(dǎo),讓我受益匪淺,得以順利完成畢業(yè)論文。這期間身邊的同學(xué)也幫我一起解決了很多相關(guān)知識和疑問。 在此,對李老師和幫助我的同學(xué)們致以誠摯的謝意!