Data Lab node

Phase

The analytic signal of every channel (Hilbert transform by FFT): instantaneous Amplitude in the input’s unit, Phase in degrees (−180…180), Frequency in Hz from the phase’s rate of change (smoothed by Smooth Taps); the Latest values are read 5 % (at most 50 ms) inside the window, where the transform is clean. PLV is the phase-locking value between channels A and B over the window (1 = locked), Phase Difference their mean phase gap in degrees. Band-pass first for a meaningful phase.

Inputs

PortTypeDefault
SignalThe Data Lab signal to analyse — a Signal node's output, a Window, or any float array with its sample rate. Multi-channel signals are handled per channel.structure—
Channel AFirst channel of the PLV pair.int0
Channel BSecond channel of the PLV pair.int1
Smooth TapsMoving average on the instantaneous frequency (it is a derivative, so it is noisy). 1 = none.int5
Update RateHow many times per second the analysis is recomputed (default 20); 0 = every frame. Lower rates save CPU on long windows — a moved parameter always recomputes at once.float20

Outputs

PortType
Amplitudestructure
Phasestructure
Frequencystructure
Latest Amplitudefloat
Latest Phasefloat
Latest Frequencyfloat
PLVfloat
Phase Differencefloat

How It Works

Phase computes the analytic signal of every channel by Hilbert transform (via FFT) and reads three things off it: instantaneous Amplitude in the input's unit, Phase in degrees (−180…180), and Frequency in Hz from the phase's rate of change, smoothed by Smooth Taps.

The Latest values are deliberately read 5 % (at most 50 ms) inside the window, where the transform is clean — the very edge of a Hilbert transform is unreliable, and reporting it would be dishonest.

Between two channels it also gives PLV, the phase-locking value over the window (1 = perfectly locked), and Phase Difference, their mean phase gap in degrees.

Band-pass the signal first. Instantaneous phase only means something for a reasonably narrow-band signal — that is a property of the mathematics, not of this implementation.

Use Cases

  • Phase coupling — PLV between two EEG channels in the alpha band, the standard connectivity measure.
  • Instantaneous frequency — How fast an oscillation is actually running, moment to moment.
  • Amplitude envelope — The Hilbert amplitude is a cleaner envelope than a peak follower for a narrow-band signal.
  • Sync a visual to a rhythm — Drive a rotation or a cycle directly from the measured phase.
  • Detect a phase reset — A jump in phase where there should be continuity.

Tips

  • Band-pass first. Always. A broadband signal has no single meaningful phase.
  • Frequency is a derivative of phase, so it is noisy — raise Smooth Taps until it reads as a frequency.
  • PLV needs enough cycles in the window to mean anything; a window shorter than a few periods will report noise as coupling.
  • Phase Difference near 0 or ±180 with a high PLV is the interesting case — in phase or anti-phase.
  • Plot phase as a Line and you will see the sawtooth; that is correct, not a wrap bug.

Open Phase in the interactive catalog →

Phase is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Data Lab nodes