Hi
I have a question about the amplitude envelope correlation (AEC).
Is Pearson coefficient used for AEC?
Thanks
AEC is computed in bst_connectivity.m:
if (nTime ~= size(sInputB.Data,2))
bst_report('Error', OPTIONS.ProcessName, {FilesA{iFile}, FilesB{iFile}}, 'Files A and B must have the same number of time samples.');
CleanExit; return;
end
% Remove average
if ~isempty(sAverageB)
sInputB.Data = sInputB.Data - sAverageB.Data;
end
% Else: Use the same info as FileA
else
sInputB = sInputA;
end
end
% Get the sampling frequency
sfreq = 1 ./ (sInputA.Time(2) - sInputA.Time(1));
% Round the sampling frequency at 1e6
sfreq = round(sfreq * 1e6) * 1e-6;
nA = size(sInputA.Data,1);
nB = size(sInputB.Data,1);
% Number of sources if B is kernel-based
if ~isempty(sInputB.ImagingKernel) && ismember(OPTIONS.Method, methodsKernelBased)
error('Unknown connectivity method.');
end
nWin = 0;
% Add the number of averaged samples & files to the report (only once per output file)
Message = sprintf('Estimating across %d time samples', nWinLenSamples); % samples are not independent due to bandpass filter
if ~strcmpi(OPTIONS.OutputMode, 'input') && nFiles > 1
Message = [Message sprintf(' per file, across %d files', nFiles)];
end
if ~isempty(Time)
Message = [Message ', for each output time point'];
end
bst_report('Info', OPTIONS.ProcessName, unique({FilesA{iFile}, FilesB{iFile}}), Message);
end
% Process one band at a time to minimize memory requirements.
for iBand = 1:nFreqBands
switch OPTIONS.tfMeasure
case 'hilbert'
% Band-pass filter in one frequency band
DataBand = process_bandpass('Compute', sInputA.Data, sfreq, BandBounds(iBand,1), BandBounds(iBand,2), 'bst-hfilter-2019', OPTIONS.isMirror);
% Analytic signals (original + i * Hilbert transform)
In a simplified way, the measure used for the correlation is something like:
sum((A - mean(A))/sqrt(sum(A - mean(A))^2) * (B - mean(B))/sqrt(sum(B - mean(B))^2))
Which is (I think) a Pearson's correlation coefficient: