Jump to content

Contributions:PAC

From BCI2000 Wiki
Revision as of 17:53, 14 March 2024 by Wengelhardt (talk | contribs)

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.

Versioning

Authors

Will Engelhardt (engelhardt@neurotechcenter.org)

Installation

  1. Python 3.7+ needs to be installed. [You can download the lastest version here].
  2. A couple additional packages are used in this visualization. Run the following segments using pip in the command line.
    • PyQtGraph 0.13.3+: pip install pyqtgraph
    • PyQt5: pip install PyQt5
    • Numpy: pip install numpy
    • SciPy: pip install scipy (only the stats package is required)

Signal Processing Pipeline

Below is the diagram showing how this is made possible.

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.
  6. SignalSharingDemo: Enables an outside connection to the BCI2000 data by using shared memory. This is how we can see the data in Python.

Python

3 threads are running within the Python scripts.

  1. Data acquisition: Connects to the shared memory address and continually updates the local data when there is new data to be acquired.
  2. BCI2000 Connection: Using BCI2000Remote, we have a two-way connection between Python and BCI2000. This is used for updating and acquiring states and parameters. This can also be used to start a BCI2000 instance, instead of the common practice of using a batch file.
  3. Visualization: The main thread of the Python script creates an interactive visualization with PyQtGraph. When the visualization is interacted with, BCI2000 states are updated accordingly.

Parameters

States

See also

Contributions:SignalProcessing