Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

voice recognition using MFCC(feature extraction)

Status
Not open for further replies.

shumaila.iqbal

Newbie level 2
Joined
Mar 28, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,295
i have don with initial code of voice print. which can read voice and display its graph.now i want to impliment mfcc on this voice sample but hav problem in doing so..my codes are............
for voice print.......
Code:
function x;
%function FMatrix=mfccf(num,s,Fs)
Fs = 10000;   % Sampling Frequency (Hz)

Nseconds = 5; % Length of speech signal

fprintf('say a word immediately after hitting enter: ');

input('');

x  = wavrecord(Nseconds*Fs, Fs, 'int16'); % Recording the sound
 
wavplay(x,Fs);                             % Playing the recorded sound

ms20=Fs/50;                 % minimum speech Fx at 50Hz
ms1=Fs/1000;                 % maximum speech Fx at 1000Hz
t=(0:length(x)-1)/Fs;        % times of sampling instants
subplot(2,1,1);
plot(t,x);
legend('Waveform');
xlabel('Time (s)');
ylabel('Amplitude');
------------------------------------------------------ and for mfcc
function FMatrix=mfccf(num,x,Fs)
%Fs=1000;
n=512;              %Number of FFT points
Tf=0.025;           %Frame duration in seconds
N=Fs*Tf;            %Number of samples per frame
fn=24;              %Number of mel filters
l=length(x);        %total number of samples in speech
Ts=0.01;            %Frame step in seconds
FrameStep=Fs*Ts;    %Frame step in samples
a=1;
b=[1, -0.97];       %a and b are high pass filter coefficients

noFrames=floor(l/FrameStep);    %Maximum no of frames in speech sample
FMatrix=zeros(noFrames-2, num); %Matrix to hold cepstral coefficients
lifter=1:num;                   %Lifter vector index
lifter=1+floor((num)/2)*(sin(lifter*pi/num));%raised sine lifter version

if mean(abs(s)) > 0.01
    s=s/max(s);                     %Normalises to compensate for mic vol differences
end

%Segment the signal into overlapping frames and compute MFCC coefficients
for i=1:noFrames-2
    frame=x((i-1)*FrameStep+1:(i-1)*FrameStep+N);  %Holds individual frames
    Ce1=sum(frame.^2);          %Frame energy
    Ce2=max(Ce1,2e-22);         %floors to 2 X 10 raised to power -22
    Ce=log(Ce2);
    framef=filter(b,a,frame);   %High pass pre-emphasis filter
    F=framef.*hamming(N);       %multiplies each frame with hamming window
    FFTo=fft(F,N);              %computes the fft
    melf=melbankm(fn,n,Fs);     %creates 24 filter, mel filter bank
    halfn=1+floor(n/2);    
    spectr1=log10(melf*abs(FFTo(1:halfn)).^2);%result is mel-scale filtered
    spectr=max(spectr1(:),1e-22);
    c=dct(spectr);              %obtains DCT, changes to cepstral domain
    c(1)=Ce;                    %replaces first coefficient
    coeffs=c(1:num);            %retains first num coefficients
    ncoeffs=coeffs.*lifter';    %Multiplies coefficients by lifter value
    FMatrix(i, :)=ncoeffs';     %assigns mfcc coeffs to succesive rows i
end

%Call the deltacoeff function to compute derivatives of MFCC
%coefficients; add all together to yield a matrix with 3*num columns 
d=(deltacoeff(FMatrix)).*0.6;   %Computes delta-mfcc
d1=(deltacoeff(d)).*0.4;        %as above for delta-delta-mfcc
FMatrix=[FMatrix,d,d1];         %concatenates all together
-------------------------------------------------------
plzzzz help me how i can interrelate both of above codes
 
Last edited by a moderator:

Hi you can use jaudio for extracting MFCC feature..


But I also have another problem

I want make combination of extracted feature I am new in DSP

I want my feature should be

MFCC + derivative of MFCC + First Format Frequency + Fundamental Freuency.

I am done with the calculation of fundamental frequency but dont know how to proceed further :sad:

Kindly help me to proceed..
 
Last edited by a moderator:

can anyone help me on how to extract speech features using mfcc???
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top