how to train a 3D input matrix using back propagation neural network?

Hi, Iam working on speech restoration, I used MFCC to extract the features for original and distorted sound.I wont to train a neural network to restore the speech. I have 51 audio clip, so the output I get from MFCC is a 12*34*51 matrix for original sound (12 is the number of MFCC coefficients for each frame, 34 is the number of frames for each audio clip, and 51 is the number of audio clip). and I get a 12*15*51 matrix for distorted sound (the number of frames is differ from the number of frames in original sound because I used a time shrinking method for distort the audio speech). so i have a 12*15*51 as an input matrix for neural network,and a 12*34*51 as an output or target matrix. can you help me to write a back propagation neural network code to train my data? please I am vary need to help. my code for getting the MFCC coefficients is:
% Clean-up MATLAB's environment
close all;clear all;clc
% Define variables
fs=8000;
Tw = 0.032; % analysis frame duration in seconds
Ts = 0.01; % analysis frame shift in seconds
n = Tw*fs; % length of frame in samples
inc= Ts*fs; % frame increment in samples
w ='M'; % Hamming window in time domain
nc =12; % number of cepstral coefficients excluding 0'th coefficient
p = 70; % number of filters in filterbank
fl =0; % low end of the lowest filter as a fraction of fs
fh = 0.5; % high end of highest filter as a fraction of fs
mfcc =[];
d_mfcc=[];
%loud the audio files
[files path]=uigetfile('.wav','Please select files','multiselect','on');
for i=1:size(files,2)
[s,fs] = audioread([path files{i}]); % Read speech samples, sampling rate and precision from file
s=s(1:2900); %use the same no. of samples for all files
[c_origin,tc_origin]=melcepst(s,fs,w,nc,p,n,inc,fl,fh); %find the MFCC coefficients
mfcc_origin = c_origin'; %find the inverse of MFCC coefficients
mfcc(:,:,i)= mfcc_origin %this is a 12*34*51 target matrix
s_distorted= ifft(fft(s),length(s)/2); %distort the audio signal using time shrinking
[c_distorted,tc_distorted]=melcepst(s_distorted,fs,w,nc,p,n,inc,fl,fh);
mfcc_distorted = c_distorted';
d_mfcc(:,:,i)=mfcc_distorted %this is a 12*15*51 input matrix
end
%so how to train this data using a back propagation neural network?

1 comentario

hi nada ; i work in the same field ; can you contact with me on my email

Iniciar sesión para comentar.

 Respuesta aceptada

1. Of course there is a problem.
EACH of the N I-dimensional input vectors creates ONE O-dimensional output vector.
So, think about what the target of each input column should be.
2. NEWFF is an obsolete function but is still available. However, well before it became obsolete, the syntax was changed.
3. Therefore use the HELP and DOC commands to find the syntax to use with your MATLAB version:
help newff
doc newff
Hope this helps.
Thank you for formally accepting my answer
Greg

5 comentarios

nada fady
nada fady el 3 de Jun. de 2016
Editada: nada fady el 3 de Jun. de 2016
please I need your help, I dont no even how to write my question to be obvious for you, but i will try to explain my question in details. I have 51 audio clip, and my input matrix is a 2D of size 12*15, and my target matrix is also a 2D matrix of size 12*34 . and I use the same instruction you suggest in your first replaying, that mean
input = [d_mfcc];
target = [mfcc];
[ I N ] = size(input)
[O N ] = size(target)
note: d_mfcc is 12*15*51 matrix, and mfcc is a 12*34*51 matrix.
so what is the wrong? and how can fixed it?
can I inverse the mfcc and d_mfcc to fixed this problem? so, I get: I =15, N=612, and O = 34, N = 612
Collapse the 3-D [12, 15, 51 ] matrix into a 2-D matrix of size [ 12*15, 51] , Similarly [ 12, 34, 51 ] ==> [ 12*34, 51 ]
Practice on
A = rand(4,3,2) % No semicolon to view
Hope this helps.
Greg
I =15, N=612, and O = 34, N = 612
should not throw an error.
The question is: if you think in terms of vectors does I = 15 --> O = 34 make any kind of sense to you?
Greg
nada fady
nada fady el 4 de Jun. de 2016
Editada: nada fady el 4 de Jun. de 2016
can I use reshape instruction?
input =reshape(input ,[],51)
target =reshape(dtarget,[],51)
[I N ] = size(input) %=[180 51]
[O N ] = size(target) %=[408 51]
is that right?
than kyou very much for replay

Iniciar sesión para comentar.

Más respuestas (1)

[ I N ] = size(input) % [180, 51]
[ O N ] = size(target) % [408, 51]
Hope this helps.
Greg

2 comentarios

Than you for replaying, I used the two commends and I get I=12, N=765, O=12, and N = 1734 is there any problem in this results?
I write this code:
input = [d_mfcc];
target = [mfcc];
[ I N ] = size(input)
[O N ] = size(target)
net= newff(minmax(I), [10, 12], {'tansig', 'purelin'}, 'traingdm');
net= init(net)
[net tr]=train(net,input,target);
but I get this Warning:
Warning: NEWFF used in an obsolete way.
and this error:
Error using nntraining.setupPsetupPerWorker (line 61)
Inputs X is not two-dimensional.
how can I fixed this error?
I am confused w.r.t. all of the posts in this thread:
Bottom line:
The 2nd dimension of the input and target matrices must be the same.
Greg

Iniciar sesión para comentar.

Categorías

Más información sobre Simulation, Tuning, and Visualization en Centro de ayuda y File Exchange.

Preguntada:

el 2 de Jun. de 2016

Comentada:

el 29 de Sept. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by