Power Spectral Densities
This analysis captures the frequency content neuronal rate histograms.
Parameters
Parameter |
Description |
---|---|
Max Frequency |
Maximum frequency of the spectrum in Hz |
Number of values |
Number of values in the spectrum. |
Window Overlap (%) |
Window overlap in percent (from 0 to 90). |
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 NumberOfFrValues*2 points). |
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 Frequency From |
Minimum frequency to be shown in the spectrum graph. |
Show Frequency To |
Maximum frequency to be shown in the spectrum graph. |
Normalization |
Spectrum normalization. See Algorithm below. |
Log Frequency Scale |
An option show Log10 frequency scale. |
Smooth |
Option to smooth the spectrum after the calculation. See Post-Processing Options for details. |
Smooth Filter Width |
The width of the smooth filter. See Post-Processing Options for details. |
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. |
Int. filter type |
Specifies if the analysis will use a single or multiple interval filters. |
Interval filter |
Specifies the interval filter(s) that will be used to preselect data before analysis. See also Data Selection Options. |
Create filter on-the-fly |
Specifies if a temporary interval filter needs to be created (and used to preselect data). |
Create filter around |
Specifies an event that will be used to create a temporary filter. |
Start offset |
Offset (in seconds, relative to the event specified in Create filter around parameter) for the start of interval for the temporary filter. |
End offset |
Offset (in seconds, relative to the event specified in Create filter around parameter) for the end of interval for the temporary filter. |
Fix overlaps |
An option to automatically merge the overlapping intervals in the temporary filter. |
Overlay Graphs |
An option to draw several histograms in each graph. This option requires that Int. filter type specifies that multiple interval filters will be used (either Table (row) or Table (col)). |
Overlay Options |
Specifies line colors and line styles for overlaid graphs. |
Add to Results / Bin left |
An option to add an additional vector (containing a left edge of each bin) to the matrix of numerical results. |
Add to Results / Bin middle |
An option to add an additional vector (containing a middle point of each 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 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. |
YMin |
Spectrum minimum. |
YMax |
Spectrum maximum. |
Spikes |
The number of spikes used in spectrum calculation. |
Filter Length |
The length of all the intervals of the interval filter (if a filter was used) or the length or the recording session (in seconds). |
Mean Freq. |
Mean firing rate (Spikes/Filter_Length). |
Frequency of Minimum |
The position of the minimum of the displayed spectrum (in Hz). If there are multiple bins in the spectrum where the spectrum value is equal to the spectrum minimum, this value represents the frequency of the first such bin. |
Frequency of Maximum |
The position of the maximum of the displayed spectrum (in Hz). If there are multiple bins in the spectrum where the spectrum value is equal to the spectrum maximum, this value represents the frequency of the first such bin. |
Algorithm
Spectral Densities for Spike Trains and Events
Spectral Densities are defined only for continuously recorded signals, so series of timestamps (neurons and events) need to be converted to continuously recorded signals to calculate the spectra.
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.
For example, 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).
After doing the above, the periodogram is calculated by computing the discrete Fourier transform, and then computing the squared magnitude of the result. The individual periodograms are then time-averaged, which reduces the variance of the individual power measurements. The end result is an array of power measurements vs. frequency “bin”.
For multi-taper spectral estimate, several periodograms (tapers) are calculated for each segment. Each taper is calculated by applying a specially designed windowing function (Slepian function, see https://en.wikipedia.org/wiki/Multitaper). All the tapers for a given segment are then averaged to form the periodogram of the segment. The individual segment periodograms are then time-averaged.
See http://www.spectraworks.com/Help/mtmtheory.html for a discussion on selecting Multi-Taper parameters.
Normalization
If Normalization is Raw PSD (Numerical Recipes), the power spectrum is normalized
so that the sum of all the spectrum values is equal to the mean squared value of the rate histogram.
The formulas (13.4.10) of Numerical Recipes in C are used
(squared fft values are divided by Nb^2
where Nb
is the number of values in data window, NumberofBins
above).
(Numerical Recipes in C, Press, Flannery, et al. (Cambridge University Press, 1992))
If Normalization is % of Total PSD (Numerical Recipes), the power spectrum is normalized so that the sum of all the spectrum values equals 100.
If Normalization is Log of PSD (Numerical Recipes), the power spectrum is calculated using the formula:
power_spectrum[i] = 10.*log10(raw_spectrum[i])
where raw_spectrum is calculated as described above in Raw PSD (Numerical Recipes).
If Normalization is Raw PSD (Matlab), the power spectrum is normalized as described in https://www.mathworks.com/help/signal/ug/power-spectral-density-estimates-using-fft.html (squared fft values are divided by Fs*Nb, where Fs is sampling rate, Nb is the number of values in window, NumberOfBins defined above).
If Normalization is Log of PSD (Matlab), the power spectrum is calculated using the formula:
power_spectrum[i] = 10.*log10(raw_spectrum_matlab[i])
where raw_spectrum_matlab is calculated as described above in Raw PSD (Matlab).