Documentation

PLL

A PLL is a control system that locks onto the phase of an input signal and continuously tracks it, ensuring a stable and synchronized reference for timing or control purposes.

Down Sample

Performs signal downsampling by updating the output only once every N input samples. Between updates, the last output value is held constant.

Key features:

  • Reduces the update rate of a high‑frequency signal to match slower processing loops.
  • Outputs the input value once every N samples; otherwise holds the previous value.
  • Typical usage: rate matching between fast acquisition loops and slow control or estimation loops.

Track Peak ABC

Tracks the maximum value of three input signals (A, B, C) over a defined window of N samples.

Key features:

  • Monitors the peak value of each signal within the current sample window.
  • Updates the three peak outputs only after N samples have elapsed.
  • Automatically resets for the next measurement interval.
  • Suitable for periodic peak detection in grid‑synchronized voltage or current measurements.

Theta Shift

Applies a fixed phase shift to a positive input angle and wraps the result within the interval [0, 2π).

Key features:

  • Computes:
    θ_out = θ_in + θ_shift, with automatic wrap‑around.
  • Accepts only positive input angles in radians.
  • Ensures the resulting angle stays within the valid circular domain.

PLL Kalman

A phase‑locked loop based on a Kalman filter.
It estimates the system phase by detecting the peak of phase A and generating a synchronized triangular reference aligned to that peak.

Key features:

  • Implements the core functionality of a classical PLL using Kalman‑based estimation.
  • Tracks the fundamental phase with improved noise rejection and stability.
  • Generates a triangular or equivalent reference signal synchronized to the detected phase.
  • Useful for precise angle estimation in noisy environments or grid‑tied applications.