Skip to content

Commit

Permalink
Fixed bst_cohn.m comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ftadel committed Oct 23, 2018
1 parent 447077d commit c66a17f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
Expand Up @@ -3,7 +3,7 @@

</head>
<body alink="#fff000" link="#fff000" vlink="#fff000">
<!-- LICENCE_START -->Version: 3.4 (17-Oct-2018)<br>
<!-- LICENCE_START -->Version: 3.4 (23-Oct-2018)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2018
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.4 181017 (17-Oct-2018)
% v. 3.4 181023 (23-Oct-2018)
12 changes: 6 additions & 6 deletions toolbox/connectivity/bst_cohn.m
Expand Up @@ -18,8 +18,8 @@
% Gxy: cross-spectral density between x and y
% Gxx: autospectral density of x
% Gyy: autospectral density of y
% Coherence function (C) : Gxy/sqrt(Gxx*Gxy)
% Magnitude-squared Coherence (MSC) : |C|^2 = |Gxy|^2/(Gxx*Gxy) = Gxy*conj(Gxy)/(Gxx*Gxy)
% Coherence function (C) : Gxy/sqrt(Gxx*Gyy)
% Magnitude-squared Coherence (MSC) : |C|^2 = |Gxy|^2/(Gxx*Gyy) = Gxy*conj(Gxy)/(Gxx*Gyy)
% Imaginary Coherence (IC) : imag(C)^2 / (1-real(C)^2)
%
% Parametric significance estimation:
Expand Down Expand Up @@ -219,7 +219,7 @@
% C = Gxy/sqrt(Gxx*Gxy)
switch (CohMeasure)
case 'mscohere'
% Coherence = |C|^2 = |Gxy|^2/(Gxx*Gxy) = Gxy*conj(Gxy)/(Gxx*Gxy)
% Coherence = |C|^2 = |Gxy|^2/(Gxx*Gyy) = Gxy*conj(Gxy)/(Gxx*Gyy)
% Gxy = Gxy .* conj(Gxy); % SLOWER
Gxy = abs(Gxy) .^ 2;
Gxy = bst_bsxfun(@rdivide, Gxy, Gxx);
Expand All @@ -231,7 +231,7 @@
pValues = max(0, 1 - Gxy) .^ floor(nSamples / nFFT); % Max makes sure numerical error is taken care of that may result in -e-15 errors
end
case 'icohere'
% Coherence function: C = Gxy/sqrt(Gxx*Gxy)
% Coherence function: C = Gxy/sqrt(Gxx*Gyy)
Gxy = bst_bsxfun(@rdivide, Gxy, sqrt(Gxx));
Gxy = bst_bsxfun(@rdivide, Gxy, sqrt(Gyy));
% Parametric estimation of the significance level
Expand Down Expand Up @@ -309,7 +309,7 @@
% Divide by the corresponding autospectra for each frequency
switch (CohMeasure)
case 'mscohere'
% Coherence = |C|^2 = |Gxy|^2/(Gxx*Gxy) = Gxy*conj(Gxy)/(Gxx*Gxy)
% Coherence = |C|^2 = |Gxy|^2/(Gxx*Gyy) = Gxy*conj(Gxy)/(Gxx*Gyy)
% Gxy = Gxy .* conj(Gxy); % SLOWER
Gxy = abs(Gxy) .^ 2;
Gxy = Gxy ./ (Gxx(iX(indSym),:) .* Gxx(iY(indSym),:));
Expand All @@ -320,7 +320,7 @@
pValues = max(0, 1 - Gxy) .^ floor(nSamples / nFFT); % Max makes sure numerical error is taken care of that may result in -e-15 errors
end
case 'icohere'
% Coherence function: C = Gxy/sqrt(Gxx*Gxy)
% Coherence function: C = Gxy/sqrt(Gxx*Gyy)
Gxy = Gxy ./ sqrt(Gxx(iX(indSym),:) .* Gxx(iY(indSym),:));
% Parametric estimation of the significance level
if (Overlap == 0.5)
Expand Down

0 comments on commit c66a17f

Please sign in to comment.