Skip to content

Releases: tne-lab/phase-calculator

Phase calculator with fixed visualization and structs for channel info

08 Apr 20:48
Compare
Choose a tag to compare

DOI

This release mainly updates the internals of the main PhaseCalculator class (which has been renamed to PhaseCalculator::Node to make the state of channels easier to manage. Instead of having many arrays of various objects, with one entry either for each input or each active input depending on the purpose, there is just one array of ChannelInfo structs. Each "active" (i.e, selected in the Params tab) channel also has an ActiveChannelInfo struct owned by its ChannelInfo, which stores information pertaining to an ongoing acquisition/processing session.

This release also changes the way the length of the Hilbert transform for visualizing phases is calculated. Firstly, it halves the length at 30 kHz, since the previous length was overkill, and secondly, the length in samples is now proportional to sample rate (i.e. the length in time is constant).

Phase calculator using Hilbert transformer filters

24 Jan 16:32
Compare
Choose a tag to compare

DOI

This is the first official "release" of the hilbert-transformer version of the Phase Calculator. It uses one of several pre-designed FIR Hilbert transformer filters (chosen based on the frequency range of interest), instead of doing an FFT and Hilbert transform to get the phase as in version 1. Downsampling to 500 Hz after the bandpass filter is required to use transformers with acceptable magnitude responses. We then compensate for the transformer's group delay by predicting a number of samples equal to the delay using an autoregressive model, as in version 1. Overall, this version tends to be more efficient, both because the FFT step is avoided and because much fewer samples need to be predicted using the AR model.

  • Note: all channels are disabled by default - you must enable the ones you want to process by selecting them in the "param" section of the channel drawer.

Features:

  • If doing closed-loop stimulation, inputting a TTL event at stimulation times lets you monitor the precise phases of stimulation with a ~1s delay (open the visualizer in a tab or separate window to get started). (This feature still uses a long FFT/Hilbert transform, to maximize the accuracy.)
  • Can output the estimated magnitude or quadrature of the signal within the specified frequency range.

FFT-based phase calculator (first release)

24 Jan 15:48
Compare
Choose a tag to compare

DOI

This is the first official "release" of the phase estimation plugin described here, which involves bandpass filtering the raw LFP, predicting some amount of future signal using an autoregressive model, and extracting the phase using the Hilbert transform.

  • Note: all channels are disabled by default - you must enable the ones you want to process by selecting them in the "param" section of the channel drawer.

Features:

  • If doing closed-loop stimulation, inputting a TTL event at stimulation times lets you monitor the precise phases of stimulation with a ~1s delay (open the visualizer in a tab or separate window to get started).
  • Can output the estimated magnitude or quadrature of the signal within the specified frequency range.
  • Length of Hilbert transform and of AR model prediction are fully customizable.