Size: 6207
Comment:
|
Size: 7483
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 16: | Line 16: |
* Right-click the "Link to raw file" in the folder "S01_AEF_20131218_01_600Hz_notch" * Select Import to database. In this tutorial, we will use the data from 60-120 s.<<BR>> If you haven't already, now is a good time to remove DC offset. This will not affect our analyses, but it makes it easier to visualize the time-series. * Click on [Import] to import the dataset into the database. |
* Right-click "Link to raw file" in the folder "S01_AEF_20131218_01_600Hz_notch" * Select Import to database. In this tutorial, we will use the data from 60-120 s.<<BR>> If you haven't already, now is a good time to remove DC offset. This will not affect our analyses, but it makes it easier to visualize the time-series. * Click on [Import] to import the dataset into the database. The imported data will be placed in a new folder at the bottom of the list. |
Line 21: | Line 20: |
== Preparing the data for SPRiNT == | == Initializing and running SPRiNT == * Clear the list of files in the Process1 tab. * Select "Raw (60.00s,120.00s)" from the newly created folder and add it to Process1. * Click on [Run] to open the pipeline editor window. * Select the process "'''Frequency > SPRiNT: Spectral Parameterization Resolved iN Time'''". Select the following input options: * '''Sensor types or names (empty=all)''': MLO11, MLO12, MRO11, MRO12 <<BR>>This option allows you to choose which sensors you would like to run the process on. These four sensors were chosen for demonstration purposes, but any sensor will suffice. * '''Time window''': 60.00-120.00s <<BR>>This option allows you to choose the time region you would like to run the process on. |
Line 24: | Line 33: |
* '''FOOOF version''': Matlab <<BR>>This option allows you to choose which version of FOOOF you would like to run; either the MATLAB standalone version, or the original Python version. Results and computation times may vary slightly between versions but are roughly the same. * '''Frequency range for analysis''': 1.0 - 40.0 Hz [default: 1.0 - 40.0 Hz]. <<BR>>FOOOF is best performed on a subset of the frequencies from the original PSD. In this range, it is important to avoid frequencies which have previously been filtered, as their adjusted powers can alter model results adversely. |
* '''Window length''': 1.0 s. <<BR>> This option changes the length of each window used in the short-time Fourier transform. Longer windows yield higher frequency resolutions (Frequency resolution = 1/window length). * '''Window overlap ratio''': 50% [default = 50%] <<BR>> This option changes the degree to which each window used in the short-time Fourier transform overlaps. * '''Averaged FFTs per time point''': 5 [default = 5] <<BR>> This option determines the number of short-time Fourier transform windows averaged locally at each time point. More windows tend to produce smoother spectra at the cost of temporal specificity. We recommend using odd numbers of windows, as this ensures the middle window in the center of the time point it represents. * '''Frequency range for analysis''': 1.0 - 40.0 Hz [default: 1.0 - 40.0 Hz]. <<BR>> specparam is best performed on a subset of the frequencies from the original PSD. In this range, it is important to avoid frequencies which have previously been filtered, as their adjusted powers can alter model results adversely. |
Spectral Parameterization Resolved iN Time (SPRiNT)
Author: Luc Wilson
This tutorial introduces the features developed in Brainstorm to compute and view SPRiNT models, or time-resolved parameterized spectra.
Introduction
The Spectral Parameterization Resolved iN Time (SPRiNT) algorithm is designed to identify and model spectral features of the neural activity across time. Beginning with the time-series, it performs a short-time Fourier transform (STFT) and averages windows locally in time to generate local-mean power spectra, before decomposing these spectra into aperiodic and periodic components using specparam. The present tutorial will demonstrate the algorithm’s functionality within the Brainstorm interface.
This demonstration uses sample data from the introduction dataset, and can be followed by completing all steps of the Brainstorm tutorial up to and including tutorial 10.
Preparing the data for SPRiNT
SPRiNT is performed on time-series, so we will first prepare some data from our notch-filtered dataset.
- Right-click "Link to raw file" in the folder "S01_AEF_20131218_01_600Hz_notch"
Select Import to database. In this tutorial, we will use the data from 60-120 s.
If you haven't already, now is a good time to remove DC offset. This will not affect our analyses, but it makes it easier to visualize the time-series.- Click on [Import] to import the dataset into the database. The imported data will be placed in a new folder at the bottom of the list.
Initializing and running SPRiNT
- Clear the list of files in the Process1 tab.
- Select "Raw (60.00s,120.00s)" from the newly created folder and add it to Process1.
- Click on [Run] to open the pipeline editor window.
Select the process "Frequency > SPRiNT: Spectral Parameterization Resolved iN Time".
Select the following input options:
Sensor types or names (empty=all): MLO11, MLO12, MRO11, MRO12
This option allows you to choose which sensors you would like to run the process on. These four sensors were chosen for demonstration purposes, but any sensor will suffice.Time window: 60.00-120.00s
This option allows you to choose the time region you would like to run the process on.
Select the following process options:
Window length: 1.0 s.
This option changes the length of each window used in the short-time Fourier transform. Longer windows yield higher frequency resolutions (Frequency resolution = 1/window length).Window overlap ratio: 50% [default = 50%]
This option changes the degree to which each window used in the short-time Fourier transform overlaps.Averaged FFTs per time point: 5 [default = 5]
This option determines the number of short-time Fourier transform windows averaged locally at each time point. More windows tend to produce smoother spectra at the cost of temporal specificity. We recommend using odd numbers of windows, as this ensures the middle window in the center of the time point it represents.Frequency range for analysis: 1.0 - 40.0 Hz [default: 1.0 - 40.0 Hz].
specparam is best performed on a subset of the frequencies from the original PSD. In this range, it is important to avoid frequencies which have previously been filtered, as their adjusted powers can alter model results adversely.Ignore power line frequencies: None [default: 60 Hz].
Depending on whether a notch filter was previously used for one's regional power line frequency (and harmonics), FOOOF may either be attempting to fit increases in power attributable to power lines as peaks, or the aperiodic fit may be disrupted by 'negative peaks' of power. To avoid both of these pitfalls, users can choose to ignore frequencies whose power measures have been disrupted by power lines or their filtering (for instance, 60±2Hz, 120±2Hz, 180±2Hz) in the modelling process. This option becomes important when fitting a broader range of frequencies (>40Hz) and should be set in accordance with one's region.Peak model: Gaussian [default: Gaussian].
The original FOOOF algorithm fits spectral peaks using a gaussian distribution; the MATLAB version also allows the algorithm to fit peaks using a Cauchy distribution instead. The final option ("Best of Both") allows for individual channels to be fit using the distribution which minimizes model mean squared error (MSE).Peak width limits: 1.5 - 12.0 Hz [default: 0.5 - 12.0 Hz].
The bounds for a putative peak to be included in the final FOOOF model. Putative peaks outside these bounds are discarded.Maximum number of peaks: 3 [default: 3].
The maximum number of attempts the model will make to identify peaks; it is best to allow for at least the number of observable peaks in the PSD plus one, in the event that the model does not remove a larger peak entirely in the peak-identification process.Minimum peak height : 3.0 dB [default: 3 dB].
The minimum peak height (in log[Power]) necessary for a putative peak to be included in the final FOOOF model. Putative peaks smaller than this threshold will be discarded.Proximity threshold: 2 standard deviations of the (comparatively) largest peak [default: 2].
Occasionally, the algorithm can mistake components of a single peak as two smaller peaks. This option forces the smaller of two peaks which are too close to one-another (i.e. If the center frequency of the smaller peak is within this value of standard deviations of the larger peak’s center frequency), the smaller of the two peaks is discarded. This option also removes peaks within this value of their standard deviation from the edge of the frequency window.Aperiodic mode: Fixed [default: Fixed].
The aperiodic component of the neural power spectrum occasionally presents with a knee, as seen below in log-log space. When selecting this option, you should first consult your data to determine whether it has a knee or not (Note: a knee component is present when the aperiodic features of the spectrum plotted in log-log space are not linear).
Guess weight: Weak [default: None].
By design, peak parameter estimates are close to the actual fit. However, fitting a distribution that does not match the spectrum precisely (i.e. fitting a gaussian distribution to an imperfect gaussian-shaped peak) can occasionally lead to semantically worse-fit models; square error is reduced, but the model does not look as much like the data. Selecting this option allows for additional model error to be placed on parameter values which lie further from initial estimates. “Weak” represents a small penalty, while “Strong” represents a larger penalty (essentially keeping the pre-optimization estimates). When this option is set to “None”, the algorithm reduces square error most similarly to the Python version.Note: Guess weight selections are ignored when Brainstorm detects that the user has the optimization toolbox, as it will use constrained optimization to best-match the Python version. It is recommended that users have the optimization toolbox.