Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::test::audio::PhasePoint Struct Reference

One point on a phase/group-delay curve. More...

#include <audio_spectrum.hpp>

Public Attributes

double hz = 0.0
double magnitude_db_rel_peak = 0.0
 Transfer magnitude in dB relative to the curve's own peak transfer magnitude (peak bin = 0 dB, everything else negative) — the gate input.
double phase_rad = 0.0
 Unwrapped transfer phase; NaN unless phase_defined.
double group_delay_samples = 0.0
 -dφ/dω in samples; NaN unless defined.
bool defined = false
 Gates group_delay_samples.
bool phase_defined = false
 Gates phase_rad.

Detailed Description

One point on a phase/group-delay curve.

Two gates, because the two measurements have different preconditions. Both are honesty gates: neither field may carry a number the analyzer did not measure, and each is NaN rather than a plausible value when its gate is false.

  • defined gates group_delay_samples. Group delay is estimated per bin from that bin's own energy and never consults a neighbor, so this bin having signal — in the reference, in the output, and in the transfer ratio relative to the curve's peak — is the whole precondition.
  • phase_defined gates phase_rad, and is STRICTER. Unwrapped phase is not a per-bin quantity: it is accumulated by walking every bin from DC upward, so it is trustworthy only when that entire walk crossed real data. defined cannot express that, and a bin can legitimately be defined while its phase_rad sits on the wrong 2π branch because the walk below it passed through bins that had none.

hz and magnitude_db_rel_peak are always readable — the magnitude IS the gate input, i.e. the evidence for the verdict. Check the matching gate before reading either measurement.

magnitude_db_rel_peak is NOT the same quantity as ResponsePoint::magnitude_db, despite both curves coming from the same Doctor run over the same stimulus. ResponsePoint::magnitude_db from response_relative_to_input is the ABSOLUTE transfer ratio (20*log10(|out|/|in|)), so a processor with 12 dB of passband gain reports +12 there. This field is normalized to the phase curve's OWN peak transfer magnitude (20*log10(|H|/peak|H|)), so that same processor reports 0 here — it is the input to the relative half of the defined gate, and reads 0 dB at the loudest bin whatever the overall gain is. The name carries the distinction because the two are written to sibling artifacts.

Member Data Documentation

◆ defined

bool pulp::test::audio::PhasePoint::defined = false

Gates group_delay_samples.

False where the reference bin, the output bin, or the transfer ratio carries too little energy to differentiate — three gates, not one; see measure_group_delay.

◆ group_delay_samples

double pulp::test::audio::PhasePoint::group_delay_samples = 0.0

-dφ/dω in samples; NaN unless defined.

◆ hz

double pulp::test::audio::PhasePoint::hz = 0.0

◆ magnitude_db_rel_peak

double pulp::test::audio::PhasePoint::magnitude_db_rel_peak = 0.0

Transfer magnitude in dB relative to the curve's own peak transfer magnitude (peak bin = 0 dB, everything else negative) — the gate input.

◆ phase_defined

bool pulp::test::audio::PhasePoint::phase_defined = false

Gates phase_rad.

True only when this bin is defined AND every bin from DC up to it is too, so the unwrap reached here without crossing a bin that had no phase to read. Implies defined; never the converse.

◆ phase_rad

double pulp::test::audio::PhasePoint::phase_rad = 0.0

Unwrapped transfer phase; NaN unless phase_defined.


The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/tools/audio/analysis/include/pulp/audio/analysis/audio_spectrum.hpp