Coherence Analysis
Coherence is a measure of the degree of relationship, as a function of frequency, between two time series.
Parameters
Parameter |
Description |
---|---|
Reference |
Specifies a reference variable. |
Max. Freq. |
Frequency maximum (Hz). |
Number of Fr. Values |
Number of frequency values. |
Window Overlap |
Percent of window overlaps when calculating FFTs. |
Window Preprocessing |
Preprocessing to be done for each window before calculating the spectrum of the window. |
Windowing Function |
Windowing Function to be applied to each window before calculating the spectrum of the window. |
Discard Incomplete Windows |
Option to discard the last window if it contains less than the expected number of data points
(less than |
Use Multitaper Algorithm |
Option to use multi-taper algorithm. |
Time-Bandwidth Product |
Time-Bandwidth Product when using multi-taper algorithm. |
Number of Tapers |
Number of Tapers when using multi-taper algorithm. |
Show Freq. From |
An option to show a subset of frequencies. Specifies minimum frequency to be displayed. |
Show Freq. To |
An option to show a subset of frequencies. Specifies maximum frequency to be displayed. |
Calculate |
Specifies whether coherence values or coherence phases are calculated. |
Confidence Level (%) |
Confidence level (percent) for the coherence values. Can only be calculated if a single-taper algorithm is used. See Confidence Level Calculation below for details. |
Draw confidence level |
An option to draw the confidence level. Confidence level is not drawn if coherence phases are specified in Calculate parameter or if a multi-taper algorithm is used. |
Conf. line style |
Line style for drawing confidence level. |
Select Data |
If Select Data is From Time Range, only the data from the specified (by Select Data From and Select Data To parameters) time range will be used in analysis. See also Data Selection Options. |
Select Data From |
Start of the time range in seconds. |
Select Data To |
End of the time range in seconds. |
Interval filter |
Specifies the interval filter that will be used to preselect data before analysis. See also Data Selection Options. |
Add to Results / Bin left |
An option to add an additional vector (containing a left edge of each frequency bin) to the matrix of numerical results. |
Add to Results / Bin middle |
An option to add an additional vector (containing a center of each frequency bin) to the matrix of numerical results. |
Add to Results / Bin right |
An option to add an additional vector (containing a right edge of each frequency bin) to the matrix of numerical results. |
Send to Matlab |
An option to send the matrix of numerical results to Matlab. See also Matlab Options. |
Matrix Name |
Specifies the name of the results matrix in Matlab workspace. |
Matlab command |
Specifies a Matlab command that is executed after the numerical results are sent to Matlab. |
Send to Excel |
An option to send numerical results or summary of numerical results to Excel. See also Excel Options. |
Sheet Name |
The name of the worksheet in Excel where to copy the numerical results. |
TopLeft |
Specifies the Excel cell where the results are copied. Should be in the form CR where C is Excel column name, R is the row number. For example, A1 is the top-left cell in the worksheet. |
Summary of Numerical Results
The following information is available in the Summary of Numerical Results
Column |
Description |
---|---|
Variable |
Variable name. |
Y Min |
Y axis minimum. |
Y Max |
Y axis maximum. |
Spikes |
The number of spikes used (for neurons or events). |
Rate Hist Bin |
Bin size of the rate histograms used for the calculations (for neurons or events) |
Filter Length |
The length of the interval filter. |
Mean Freq. |
Mean firing rate (for neurons or events). |
Confidence Level |
Confidence level for the coherence values. |
Algorithm
Neurons and Events
Coherence is defined only for continuously recorded signals, so series of timestamps (neurons and events) need to be converted to continuously recorded signals to calculate coherence.
NeuroExplorer uses rate histograms to represent spike trains as continuous signals. Rate histogram parameters are calculated using the following formulas:
Bin = 1./(2.*Maximum_Frequency)
NumberOfBins = 2\*Number_of_Frequency_Values
The rate histogram over the whole analysis time period is split up into data segments (or windows)
of length N
(where N
is NumberOfBins), overlapping by D
points. If overlap is 50%, then D
is N/2
.
For each segment, the signal is preprocessed according to Window Preprocessing parameter.
For example, if Subtract Mean is selected, ProcessedSignal[i] = Signal[i] - meanOfSignalInSegment
.
The overlapping segments are then windowed: after the data is split up into overlapping segments,
the individual data segments have a window applied to them (that is, ProcessedWindowedSignal[i] = ProcessedSignal[i]*WindowValue[i]
;
the window is specified by the Windowing Function).
Most window functions afford more influence to the data at the center of the segment than to data at the edges, which represents a loss of information. To mitigate that loss, the individual data segments are commonly overlapped in time (as in the above step).
For two variables X
(reference) and Y
(target) the following entities are calculated. FFTs of the data segments
(after preprocessing) are calculated. Then, individual and cross-densities are calculated:
Pxx = FFT(X)*Conj(FFT(X)),
Pyy = FFT(Y)*Conj(FFT(Y))
Pxy = FFT(X)*Conj(FFT(Y)).
Here Conj(z)
is a complex conjugate of z
. Pxx
, Pyy
and Pxy
values are averaged across all intervals
and coherence values are calculated as
Mean(Pxy)*Mean(Pxy) / (Mean(Pxx)*Mean(Pyy)).
Coherence phase values are calculated as phase of Mean(Pxy)
.
Continuous Variables
For continuous variables, if both the reference and the target variables have the same digitizing frequency, the FFTs of variable values (after applying preprocessing and tapering window) are calculated and then resampled to the specified frequency steps. If the reference is a timestamped variable or two continuous variables have different digitizing rates, the values of continuous variables are averaged within the specified bins and then FFTs of these averages are calculated.
Calculation of the Confidence Level
Confidence levels can only be calculated if a single-taper algorithm is used.
Confidence levels are calculated as described in Kattla and Lowery (2010) (see Reference blow).
The confidence level Z
is calculated as
Z = 1 - pow(alpha, 1/(w*L - 1))
where
pow(x,y)
returns x
to the power of y
,
alpha = 1 - Confidence_Level*0.01,
L
is the number of overlapped windows
w
is the correction due to the Hanning window tapering (see eq. (5) and (6) in Kattla and Lowery (2010)).
Reference
Kattla S, Lowery MM. Fatigue related changes in electromyographic coherence between synergistic hand muscles. Exp Brain Res. 2010 Apr; 202(1):89-99. Epub 2009 Dec 12.