comparison examples/SMALL_test_coherence.m @ 167:8324c7ea6602 danieleb

Added symmetric de-correlation function, modified target de-correlation in test function.
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Tue, 20 Sep 2011 14:27:14 +0100
parents a4d0977d4595
children 290cca7d3469
comparison
equal deleted inserted replaced
166:1495bdfa13e9 167:8324c7ea6602
16 percActiveAtoms = 5; %percentage of active atoms 16 percActiveAtoms = 5; %percentage of active atoms
17 17
18 % Dependent parameters 18 % Dependent parameters
19 nActiveAtoms = fix(blockSize/100*percActiveAtoms); %number of active atoms 19 nActiveAtoms = fix(blockSize/100*percActiveAtoms); %number of active atoms
20 epsilon = 1/sigma; %error constraint for sparse representation step (corresponds to noise applied to signals) 20 epsilon = 1/sigma; %error constraint for sparse representation step (corresponds to noise applied to signals)
21 minCoherence = sqrt((dictSize-blockSize)/(blockSize*(dictSize-1))); %target coherence (based on coherence lower bound) 21 %minCoherence = sqrt((dictSize-blockSize)/(blockSize*(dictSize-1))); %target coherence (based on coherence lower bound)
22 minCoherence = 0.4; %target coherence
22 23
23 % Initial dictionaries 24 % Initial dictionaries
24 dctDict = dictionary('dct',blockSize,dictSize); 25 dctDict = dictionary('dct',blockSize,dictSize);
25 dctDict = dctDict.phi; 26 dctDict = dctDict.phi;
26 gaborParam = struct('N',blockSize,'redundancyFactor',2,'wd',@rectwin); 27 gaborParam = struct('N',blockSize,'redundancyFactor',2,'wd',@rectwin);
165 166
166 %% Plot results 167 %% Plot results
167 minMu = sqrt((dictSize-blockSize)/(blockSize*(dictSize-1))); 168 minMu = sqrt((dictSize-blockSize)/(blockSize*(dictSize-1)));
168 maxSNR = max(sigNoiseRatio); 169 maxSNR = max(sigNoiseRatio);
169 170
170 figure, subplot(2,2,1) 171 figure, subplot(1,2,1)
171 snrMat = buffer(sigNoiseRatio(1:9),3); 172 snrMat = buffer(sigNoiseRatio(1:9),3);
172 bar(snrMat'); 173 bar(snrMat');
173 title('SNR - KSVD Update') 174 title('Signal to noise ratio')
174 xlabel('Initial dictionary') 175 xlabel('Initial dictionary')
175 ylabel('SNR (dB)') 176 ylabel('SNR (dB)')
176 set(gca,'XTickLabel',{'data','dct','gabor'},'YLim',[0 maxSNR+1]); 177 set(gca,'XTickLabel',{'data','dct','gabor'});
177 legend('none','Mailhe','Tropp') 178 legend('none','Mailhe','Tropp')
178 grid on 179 grid on
179 180
180 subplot(2,2,2), grid on 181 % subplot(2,2,2), grid on
181 snrMat = buffer(sigNoiseRatio(10:18),3); 182 % snrMat = buffer(sigNoiseRatio(10:18),3);
182 bar(snrMat'); 183 % bar(snrMat');
183 title('SNR - Mailhe Update') 184 % title('SNR - Mailhe Update')
184 xlabel('Initial dictionary') 185 % xlabel('Initial dictionary')
185 ylabel('SNR (dB)') 186 % ylabel('SNR (dB)')
186 set(gca,'XTickLabel',{'data','dct','gabor'},'YLim',[0 maxSNR+1]); 187 % set(gca,'XTickLabel',{'data','dct','gabor'},'YLim',[0 maxSNR+1]);
187 legend('none','Mailhe','Tropp') 188 % legend('none','Mailhe','Tropp')
188 grid on 189 % grid on
189 190
190 subplot(2,2,3), hold on, grid on 191 subplot(1,2,2), hold on, grid on
191 title('Coherence - KSVD Update') 192 title('Coherence')
192 muMat = buffer(mu(1:9),3); 193 muMat = buffer(mu(1:9),3);
193 line([0.5 3.5],[1 1],'Color','r'); 194 line([0.5 3.5],[1 1],'Color','r');
194 bar(muMat'); 195 bar(muMat');
195 line([0.5 3.5],[minMu minMu],'Color','k'); 196 line([0.5 3.5],[minMu minMu],'Color','k');
196 set(gca,'XTick',1:3,'XTickLabel',{'data','dct','gabor'},'YLim',[0 1.05]) 197 set(gca,'XTick',1:3,'XTickLabel',{'data','dct','gabor'},'YLim',[0 1.05])
197 legend('\mu_{max}','none','Mailhe','Tropp','\mu_{min}') 198 legend('\mu_{max}','none','Mailhe','Tropp','\mu_{min}')
198 ylabel('\mu') 199 ylabel('\mu')
199 xlabel('Initial dictionary') 200 xlabel('Initial dictionary')
200 201
201 subplot(2,2,4), hold on, grid on 202 % subplot(2,2,4), hold on, grid on
202 title('Coherence - Mailhe Update') 203 % title('Coherence - Mailhe Update')
203 muMat = buffer(mu(10:18),3); 204 % muMat = buffer(mu(10:18),3);
204 line([0.5 3.5],[1 1],'Color','r'); 205 % line([0.5 3.5],[1 1],'Color','r');
205 bar(muMat'); 206 % bar(muMat');
206 line([0.5 3.5],[minMu minMu],'Color','k'); 207 % line([0.5 3.5],[minMu minMu],'Color','k');
207 set(gca,'XTick',1:3,'XTickLabel',{'data','dct','gabor'},'YLim',[0 1.05]) 208 % set(gca,'XTick',1:3,'XTickLabel',{'data','dct','gabor'},'YLim',[0 1.05])
208 legend('\mu_{max}','none','Mailhe','Tropp','\mu_{min}') 209 % legend('\mu_{max}','none','Mailhe','Tropp','\mu_{min}')
209 ylabel('\mu') 210 % ylabel('\mu')
210 xlabel('Initial dictionary') 211 % xlabel('Initial dictionary')