Perievent Spectrograms

This analysis captures the frequency content of continuous variables or neuronal rate histograms in the time windows around reference events.

The idea of perievent spectrogram analysis is that you may have stimuli applied to your neural network and the neurons or LFPs exhibit slight variations of their spectral properties in some periods right after the stimuli. You may not see the variation when analyzing the response to the single stimulus, but when you average the spectrograms over all the stimuli, you may get a clear picture.

Parameters

Parameter

Description

Reference

Reference event.

Skip ref. events with missing cont. data

An option to skip reference events when calculating PeriEvent Spectrograms for continuous variables. Use this option when continuous variables have gaps (time periods without data points). See Algorithm below for details.

Max. Freq.

Maximum frequency for the spectrograms. If at least one continuous variable is selected, the value of the Maximum Frequency parameter is set as 0.5*Digitizing frequency of the first selected continuous variable. All continuous variables selected for this analysis should have the same digitizing rate.

Number of Fr. Values

Number of frequency values.

Normalization

Spectrum units (see Normalization in Spectrogram Analysis).

Start

Start of the first window (relative to the reference event).

Shift Type

Option to specify shift in seconds or as a percent of the sliding window width.

Shift (sec)

If Shift Type is Absolute, specifies how much sliding window is shifted each time (in seconds).

Shift (window %)

If Shift Type is Window Percent, specifies how much sliding window is shifted each time as a percent of the overall sliding window width.

Number of Shifts

total number of sliding windows.

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.

X Axis

Allows to specify what values are shown in the sliding window X axis. There are two options: Start of Window and Center of Window. Suppose your data has the strongest spectral value at 5 seconds. This means that the window that has 5 seconds as its center will show the highest spectrum values. If the window width is 2 seconds, it will be the window [4,6]. If you are using ‘Start of window’ option, you will see the peak at 4 instead of 5 seconds. However, with ‘Center of window’ option, the peak will be at 5 seconds.

Log Vertical Frequency Scale

Option to draw logarithmic vertical frequency scale.

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 .

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.

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.

Color Scale Min

Color scale minimum.

Color Scale Max

Color scale maximum.

Max Frequency Used

Maximum frequency of the FFTs used.

Rate Histogram Bin

Rate histogram bin size in seconds (if used).

Number of Ref. Events

Number of reference events.

Window width

FFT window width (seconds).

Actual shift

Actual window shift used in analysis.

Number of Bins In Shift

Number of rate histogram bins in shift (if rate histograms were used)

Algorithm

Perievent spectrogram is an average of multiple regular spectrograms. For each timestamp of the reference event, a regular spectrogram is calculated, then these spectrograms are averaged over all the selected reference timestamps.

  • For a continuous variable, for each timestamp of the reference event, the following parameters are used:

    Window_Start = Reference_Timestamp + Start + Shift * (Window_Number - 1)

    N values of the continuous variable (starting with the value at Window_Start) are copied to Signal array where N = 2*Number_of_Frequency_Values.

  • Signal values are pre-processed according to the specified Window Preprocessing.

  • Signal values are multiplied by the coefficients of the specified Windowing Function.

  • Discrete FFT of the result is calculated.

  • Power spectrum is calculated from FFT using the formulas defined in (Press et al., Numerical Recipes in C., Cambridge University Press, 1992)

If Skip ref. events with missing cont. data option is selected, and there is no continuous data for any part of time interval [RefTimestamp+StartTime, RefTimestamp+StartTime+Shift*NumberOfShifts], the spectrogram for RefTimestamp is not calculated.