function Out=creation_mel_conv(A,S) % Out=creation_mel_conv(A,S) % fonction permettant de creer un melange convolutif. % A - matrice M*N*0, ensemble des filtres s'appliquant aux % canaux % S - matrice N*T, matrice des sources % Out - matrice M*T+O-1 des melanges obtenus % % % Exemple % A='1m_filt.mat'; % load(A); % [S1,Fe]=wavread('female_src_1.wav'); % S2=wavread('female_src_2.wav'); % S3=wavread('female_src_3.wav'); % S4=wavread('female_src_4.wav'); % S=[S1';S2';S3';S4']; % Out=creation_mel_conv(A,S); [M N O] = size(A); T = max(size(S)); Out =zeros(M,T+O-1); %pour chaque source on calcule le filtre %for n=1:N % Hn = A(:,n,:); % Hn = permute(Hn,[1 3 2]); % Out = Out + conv2(Hn,S(n,:)); %end for m=1:M for n=1:N Hmn = A(m,n,:); Hmn = permute(Hmn,[3 2 1]);%reshape(Hm,1,[]) Out(m,:) = Out(m,:) + fftfilt(Hmn,[S(n,:) zeros(1,O-1)]); %Out(m,:) = Out(m,:) + conv(Hmn,S(n,:)); end end % Written by Matthieu Kowalski, 2010