clear all;
close all;
clc;

simcomale = load('simcomale.mat');
simcofemale = load('simcofemale.mat');
dctdic = load('DCTdic.mat');
fftdic = load('FFTdic.mat');


coherence = 0;
for j = 1:511
    for i = (j+1):512
        temp = sum(simcomale.DTr(:,j).*simcomale.DTr(:,i));
        coherence = max(temp,coherence);
    end
end
simcomale.coherence = coherence;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

coherence = 0;
for j = 1:511
    for i = (j+1):512
        temp = sum(simcofemale.DTr(:,j).*simcofemale.DTr(:,i));
        coherence = max(temp,coherence);
    end
end
simcofemale.coherence = coherence;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

coherence = 0;
for j = 1:511
    for i = (j+1):512
        temp = sum(dctdic.DTr(:,j).*dctdic.DTr(:,i));
        coherence = max(temp,coherence);
    end
end
dctdic.coherence = coherence;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

coherence = 0;
for j = 1:511
    for i = (j+1):512
        temp = sum(real((fftdic.DTr(:,j)).*real(fftdic.DTr(:,i))));
        if temp >= 0.49
            temp = coherence;
        end
        coherence = max(temp,coherence);
    end
end
fftdic.coherence = coherence;



