Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Topic: MFCC problem
Replies: 3   Last Post: Mar 6, 2014 12:02 AM

 Messages: [ Previous | Next ]
 Garry Posts: 1 Registered: 12/21/13
MFCC problem
Posted: Dec 21, 2013 1:21 AM

I'm doing voice recognition using Mfcc.
I'm Stuck.
Could someone help me fix the bugs.
I will be grateful to whosoever helps me.
I've put my queries in comments in the code.

%original signal
subplot(4,4,1);
plot(s);
title('Original wave: s(n)');

%threshold
M = length(s);
t1= s(8000:M);
N = length(t1);
fs=8000;
frameduration = 0.5;
framelen = frameduration*fs;
numframes = floor(N/framelen);
newsig = zeros(N,1);
for k = 1:numframes frame = s( (k-1)*framelen + 1 : framelen*k ) ;
maxval = max(frame);
if(maxval > 0.08)
newsig = frame;
end
end

z = newsig(1:2048);
subplot(4,4,2);
plot(z);
xlabel('Sample Number');
ylabel('Amplitude');
legend('Original Signal to be Used For MFCC')
title('Signal obtained after Thresholding the sample wav file');
grid;
bigval=0;

for(i=1:2048)
if( abs(z(i))>=bigval )
bigval= abs(z(i));
end
end

z= z/bigval;
subplot(4,4,3);
plot(z);
xlabel('Sample Number');
ylabel('Amplitude');
title('Normalised signal For LPC')
grid;

%preemphasis
waveFile=('C:\Users\student\Desktop\PCMRECORDER\Zanshila1.wav')
a=0.95;
y2 = filter([1, -a], 1, z);
subplot(4,4,4);
t=1:length(z)
plot(t,y2);
title(sprintf('After pre-emphasis: z_2(n)=z(n)-a*z(n-1), a=%f', a));

%winDowing
strt=1
endd=1
% Is this for loop for overlapping the windows correct?
for strt=1:80:1920

for endd=strt+200:endd+80:2120

p=strt:endd;

%multiplying signal with hamming window
windowed=y2.*hamming(length(y2));
subplot(4,4,5)
stem (windowed)

%fft
z=fft(windowed, 512);
subplot(4,4,6);
stem(z); grid on;
title('fft(linear scale)');

%Mel filter bank
%can someone help us with code for mel filter bank?

end
end

Date Subject Author
12/21/13 Garry
2/24/14 pricky
2/24/14 Steven Lord
3/6/14 pricky