function [hatA hatAs]=A_welasso_6pen(RT60,Aind,X,Sinf,pena) %performs several FISTA algorithms to solve constrained problem (3) % \min_\A p(\A) % s.t \|\X-\A\star \s\|_2 = 0 % % %Input % X M*T+K-1 Observations matrix % Sinf N*T Sources matrix % Aind M*N*K The original filter, only used for the peak value \tD of the expected time enveloppe \rho % RT60 Reverberation time (ms) of the filter % pena integer between 1 and 6 for the choice of the penalisation % %Output % hatA M*N*K the estimation of the filter % hatAs M*N*K*14 estimated filters after each of the 14 iterations of FISTA options.maxit = 1000; [M,useless]=size(X); [M,N,K]=size(Aind); options.Aorig=Aind; % choix de la liste de lambda lambda_vect = [1e-14 1e-13 1e-12,1e-11,1e-10,1e-9,1e-8,1e-7,1e-6,1e-5,1e-4,1e-3,1e-2,1e-1,1]; nbxp = numel(lambda_vect); lambda_vect=lambda_vect(end:-1:1); % diverses initialisations hatAs=zeros(M,N,K,nbxp); %tD est l'abscisse du plus grand pic de A pour initialiser l'enveloppe temporel \rho (initialisation oracle ici) [val,tD]=max(Aind,[],3); tD=floor(mean(tD(:))); fs= 11025 ; % sampling frequency namp=-(0:K-tD-1)/fs*1000/RT60*60; % amplitude in dB namp=10.^(namp/20); % amplitude in linear scale noscale=ones(M,N,K); scaleamp=ones(M,N,K); options.itplot=[]; for n=1:N for m=1:M scaleamp(m,n,tD+1:K)=namp; end end switch pena case 1 options.tR=K-1;%L1 options.rescale=scaleamp;%rescale on case 2 options.tR=1;%L2 options.rescale=scaleamp;%rescale on case 3 options.tR=K-1;%L1 options.rescale=noscale;%rescale off case 4 options.tR=1;%L2 options.rescale=noscale;%rescale off case 5 options.tR=floor(K/3); %60ms after the peak tD options.rescale=scaleamp;%rescale on case 6 options.rescale=noscale;%rescale off, won't be used lambda_vect=0*lambda_vect; end k=0; for ll = lambda_vect k=k+1; options.lambda=ll; [hatA]=inverse_A_time(X,Sinf,options); options.init=hatA; end end % Written by Matthieu Kowalski, 2010 % Updated by Alexis Benichoux, 2011