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.

How to apply the MFCC into neural network using matlab?

Status
Not open for further replies.

fikrul

Junior Member level 3
Joined
Jan 16, 2010
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,459
MFCC

Hello guys,

How to apply the MFCC(mel-frequency cepstral coefficient) coefficient into neural network using matlab?
Please help me on this matter...
 

hello bassa,

i've wrote the code to produced 13th coefficient of mel-frequency data, but im not really know how to use it in neural network? This my code that i just wrote:

load fik_1; %getting the data from directory
fs = 11025; %frequency sampling

precoeff = -0.9; %Pre-Emphasis the data signal
x = [fik_1(1)*(1+precoeff);fik_1(2:end)+precoeff*fik_1(1:end-1)];
wavplay(x,fs);

w = 'm'; %Window type's :hamming
nc = 13; % No. of coefficient 13th
p = floor(3*log(fs)); %No. of filters in filterbank
n = pow2(floor(log2(0.03*fs))) %Lenght of frame in samples = 256
inc = n/2; %frame increment (default n/2)
fl = 0; %low end of the lowest filter as a fraction of fs (default = 0)
fh = 0.5; %high end of highest filter as a fraction of fs (default = 0.5)

c=melcepst(x,fs,w,nc); %apply MFCC function to get 13th coefficient
[r,p] = corrcoef(c)
 

you may refer the method explained in the page 8 of the article

Code:
net=newff(minmax( X (n) MFCC ),[13 4],{'tansig''tansig'},'trainlm');
 

How about the target? What it should be?

if my P the input which are my 13coefficient, what is going to be for my T(target)..??
 

fikrul said:
How about the target? What it should be?
Target would be the data set which is actual, desired, taken from the system for particular known signal and input P is arbitrary input data set which is taken at run time (current signal)

fikrul said:
if my P the input which are my 13coefficient, what is going to be for my T(target)..??
You need to take same set of 13 coefficient for the signal which is need to be identified (actual signal)

Let say, your target is to identify signal \[s1\] then you need to obtain data set for \[s1\] assume your T is [0 1 2 3 4 3 2 1 2 3 4]; and need to store in memory (something called dictionary)

Now input another arbitrary signal, let say [tex:d102efd4b3]s2[/tex:d102efd4b3] to the system and obtain P = [0 1 2 3 4 5 6 7 8 9 10]; (called current print)

So for a network is created with one hidden layer of five neurons.
Code:
net = newff(P,T,5);
The network is simulated and its output plotted against the targets.

Code:
       Y = sim(net,P);
      plot(P,T,P,Y,'o')
The network is trained for 50 epochs. Again the network's output is plotted.

Code:
      net.trainParam.epochs = 50;
      net = train(net,P,T);
      Y = sim(net,P);
      plot(P,T,P,Y,'o')
**broken link removed**


In the article it is described as below

Code:
net=newff(minmax( X (n) MFCC ),[13 4],{'tansig''tansig'},'trainlm');
[net,tr]= train( X (n) MFCC ,T);

hope this help

regards
bassa
 
Helo bassa,

Why after i compile the code followed from the article, there were a lot of error?
 

It may be due to compiler version. you can find the correct format of the command using help so then update your program

Ex:in the matlab command prompt type "help newff" then it will show the correct format

If you can post your code then others can check it for you
 

this is my code:


fs = 11025; %frequency sampling
s = wavrecord(2*fs,fs);

precoeff = -0.9; %Pre-Emphasis the data signal
x = [s(1)*(1+precoeff);s(2:end)+precoeff*s(1:end-1)];
wavplay(x,fs);

w = 'm'; %Window type's :hamming
nc = 13; % No. of coefficient 13th
p = floor(3*log(fs)); %No. of filters in filterbank
n = pow2(floor(log2(0.03*fs))) %Lenght of frame in samples = 256
inc = n/2; %frame increment (default n/2)
fl = 0; %low end of the lowest filter as a fraction of fs (default = 0)
fh = 0.5; %high end of highest filter as a fraction of fs (default = 0.5)

c=melcepst(x,fs,w,nc,inc); %apply MFCC function to get 13th coefficient
c=cov(c);
%save c;


load c3;
P = c;
T = c3;

net=newff( P,T,[],{'tansig''tansig'},'trainlm');
net= train(net, P ,T);
 

Change the following two lines

Code:
%net=newff( P,T,[],{'tansig''tansig'},'trainlm');
%net= train(net, P ,T);

net = newff(P,T,5); %Here a network is created with one hidden layer of five neurons.
net.trainParam.epochs = 50;
net = train(net,P,T);
 

hello bassa,

May i know, what the value of my target should i use?
 

In a similar program of mine matrices w1,w2,w3 contains the MFCC for 3 speakers which are of dimension (100x10) where 100 represents the number of frames and 10 is the number of MFCC coefficients. Now how am i going to define the neural network and train it with all the three MFCC matrix? Please help me..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top