i m writing a code on MFCC voice feature extraction..i am stuck at a command, i am writng a code over here till that i hv done nd not facing any problem

2 views (last 30 days)
>> %%Define variables Tw=25;%analysis frame duration (ms) Ts=10;%analysis frame shift (ms) alpha=0.97;%preemphasis coefficent M=20;%number of filterbank channels C=12;%number of cepstral coefficients L=22;%cepstral sine lifter parameter LF=100;%low frequency limit (Hz) HF=4000;%upper frequency limit (Hz) >> wav_file1= 'rizwan.wav';% input audio filename. words are"1000 2000 3000 4000" >> R=[LF HF];%frequency range (Hz) for filterbank analysis N=C+1;%number of cepstral coefficents window = @hamming;%WINDOW is a analysis window function handle >> %sampling rate for 5 to 10 seconds and read speech samples, sampling rate and precision from file >> [ speech1, fs, nbits ] = wavread( 'rizwan.wav' ); >> %%PRELIMINARIES %Explode samples to the range of 16 bit shorts if( max(abs(speech1))<=1 ), speech1=speech1 * 2^15; end; >> Nw=round( 1E-3*Tw*fs );%frame duration (samples) Ns=round( 1E-3*Ts*fs );%frame shift (samples) nfft= 2^nextpow2( Nw );%length of fft analysis K=nfft/2+1;%length of the unique part of the fft %%HANDY INLINE FUNTION HANDLERS %forward and backward mel frequency wraping hz2mel = @(hz )(1127*log(1+hz/700) );%hertz to mel wraping function mel2hz = @(mel )(700*exp(mel/1127)-700 );%mel to hertz wraping function >> %type III DCT matrix routine >> dctm=@(N,M)(sqrt(2.0/M)*cos(repmat([0:N-1]/1,M)*(repmat(pi*([1:M]-0.5)/M,N,1)))); >> %Cepstral lifter routine >> ceplifter=@(N,L)(1+0.5*L*sin(pi*[0:N-1]/L)); >> %%FEATURE EXTRACTION(feature vectors as columns) >> %Preemphasis filtering >> speech1=filter([1-alpha],1,speech1);% fvtool([1-alpha],1); >> %Framing and windowing(frames as columns)
following is the command mon which i m stuck and its not working furthur frames=vec2frames(speech,Ns,Nw,'cols',window,false);

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!