Jump to content

Contributions:PAC

From BCI2000 Wiki
A demo of the Phase-Amplitude Coupling visualization

Synopsis

PAC, or phase-amplitude coupling, shows the entrainment of a certain frequency band to the power of another frequency band. In other words, the phase of one type of neural activity correlates with the amplitude of another. The dominant phase and the location of this entrainment can change for varying tasks. With this implementation, you can view the entrainment happening as the task is being completed, which can help you focus on the responsive electrodes for a certain task.

The inspiration for this visualization comes from Dr. Kai Miller's Human motor cortical activity is selectively phase-entrained on underlying rhythms paper. Specifically, Figure 5, shown below.

See the official figure caption here

One can see that Section C and D are reproduced with the Phase-Amplitude Coupling (PAC) module in real-time.

Versioning

Authors

Will Engelhardt (engelhardt@neurotechcenter.org)

Installation

See the Installation section on the Python Visualization page to see how to install the necessary packages and how to run demo files! Once that is all set up, you can return to this page to understand the specific parameters for the phase-amplitude coupling.


Signal Processing Pipeline

To allow for maximal flexibility, the pipeline is set up to compute Spectral Estimation in parallel with the phase-amplitude coupling computation. The pipeline for the Spectral Estimation is already described here.

Below is the diagram describing the pipeline for phase-amplitude coupling.

BCI2000 Signal Processing Pipeline

Within the BCI2000 architecture, the figure depicts the Signal Processing pipeline with the PAC Filter.

  1. Decimation filter: Used to reduce the number of samples from the source module. This should be used if the sampling rate is too high to process a sample block size within the necessary time.
  2. Spatial filter: Common Average Reference the data to isolate unique neural activity.
  3. IIR Bandpass: Bandpass the desired frequency range for your phase or amplitude signal
  4. Hilbert filter: Compute the Hilbert filter on the bandpassed data.
  5. PAC filter: Combines the data from the amplitude and phase and groups the output data by phase bins.
    • Output: Z-score of amplitude for each phase, with the range [-π, π).
  6. SignalSharingDemo: Enables an outside connection to the BCI2000 data by using shared memory. This is how we can see the data in Python.

Parameters

The PAC Module contains many parameters from the various filters in the Signal Processing Pipeline. Refer to those pages' documentation for specific on the individual parameters. There are additionally a couple of parameters specific to the PAC filter itself.

AngleDecimation Number of degrees of resolution. This inversely specifies the number of bins that the phases are grouped into. Must be a denominator of 360 degrees, otherwise it will be rounded to one. For example, a value of 10 will create 36 bins.
SlidingWindow Amount of time to hold past data for. Set to 0 to hold for the whole run. Regardless of this parameter, when a New Trial occurs the data resets.
IncludeDeviation Enable to double the size of the output and include the standard deviation of the average amplitude for each phase bin. This will be the 2nd half of the output. If this is enabled, currently the Python script will have to be changed.

Since we have a parallel filter chain with equivalent subchains, we will have two subchains with the same parameter names. These will be included under the tabs Filtering: Amplitude and Filtering: Phase. In these two subchains, a few requirements must be met.

  • Delay must be the same
  • Filtering: Amplitude must have the Hilbert OutputSignal of Hilbert envelope.
  • Filtering: Phase must have the OutputSignal of Hilbert phase.
  • Downsample must be disabled (since the two subchains will likely have varying frequencies, downsampling will mismatch the number of samples)

States

PAC_TrialNumber Number that increments every time button New Trial is pressed. Changing this state resets all data.
PAC_TrialType Keeps track of the trial type.

Offline Use

To run the Phase-Amplitude Coupling pipeline on data that has already been acquired, use the FilePlayback module. This plays back the BCI2000 data file as if the data is currently being recorded. You can completely replicate the results of the visualization.


See also

SignalProcessing | FilePlayback | SignalSharing Python Demo