# HG changeset patch # User Daniele Barchiesi # Date 1327670111 0 # Node ID 0d7a81655ef2fcab26b2a24a83e010c549251784 # Parent f8bc99a5470c3b555aeebc51086f641611017bc7 removed cumulative coherence calculation diff -r f8bc99a5470c -r 0d7a81655ef2 examples/SMALL_test_coherence2.m --- a/examples/SMALL_test_coherence2.m Mon Jan 09 12:58:00 2012 +0000 +++ b/examples/SMALL_test_coherence2.m Fri Jan 27 13:15:11 2012 +0000 @@ -1,3 +1,7 @@ +% +% +% + clc, clear, close all %% Parameteres @@ -71,7 +75,8 @@ %% Evaluate coherence and snr of representation for the various methods sr = zeros(size(SMALL.DL)); %signal to noise ratio -mu = zeros(nTrials,nInitDicts,nCorrLevels,nDecorrAlgs,blockSize); %cumulative coherence +mu1 = zeros(nTrials,nInitDicts,nCorrLevels,nDecorrAlgs,blockSize); %cumulative coherence +mu2 = zeros(nTrials,nInitDicts,nCorrLevels,nDecorrAlgs,blockSize); %cumulative coherence dic(size(SMALL.DL)) = dictionary; %initialise dictionary objects for iTrial=1:nTrials for iInitDicts=1:nInitDicts @@ -86,8 +91,10 @@ %calculate mu dic(iTrial,iInitDicts,iCorrLevels,iDecorrAlgs) = ... dictionary(SMALL.DL(iTrial,iInitDicts,iCorrLevels,iDecorrAlgs).D); - mu(iTrial,iInitDicts,iCorrLevels,iDecorrAlgs,:) = ... + mu1(iTrial,iInitDicts,iCorrLevels,iDecorrAlgs,:) = ... dic(iTrial,iInitDicts,iCorrLevels,iDecorrAlgs).cumcoherence; + mu2(iTrial,iInitDicts,iCorrLevels,iDecorrAlgs,:) = ... + dic(iTrial,iInitDicts,iCorrLevels,iDecorrAlgs).cumcoherence(2); end end end @@ -96,13 +103,13 @@ %% Plot results minMu = sqrt((dictSize-blockSize)/(blockSize*(dictSize-1))); %lowe bound on coherence initDictsNames = {'Data','Gabor'}; -dicDecorrNames = {'IPR','INK-SVD','IP'}; +dicDecorrNames = {'IPR','INK-SVD'}; lineStyles = {'k.-','r*-','b+-'}; for iInitDict=1:nInitDicts figure, hold on, grid on title([initDictsNames{iInitDict} ' Initialisation']); plot([1 1],[0 25],'k-'); - for iDecorrAlgs=1:nDecorrAlgs + for iDecorrAlgs=1:nDecorrAlgs-1 coherenceLevels = squeeze(mean(mu(:,iInitDict,:,iDecorrAlgs,1),1)); meanSNRs = squeeze(mean(sr(:,iInitDict,:,iDecorrAlgs),1)); stdSNRs = squeeze(std(sr(:,iInitDict,:,iDecorrAlgs),0,1)); @@ -115,3 +122,7 @@ xlabel('\mu'); ylabel('SNR (dB)'); end + +%% +mu2 = squeeze(mean(mu2,1)); +mu = squeeze(mean(mu,1));