Phase / group-delay curve of a transfer function. More...
#include <audio_spectrum.hpp>
Public Member Functions | |
| bool | defined_at (double hz) const |
| True when the bin nearest hz carries enough energy for its group delay to be a measurement. | |
| bool | phase_defined_at (double hz) const |
| True when the bin nearest hz is defined_at AND the unwrap reached it over an unbroken run of defined bins from DC, so its phase sits on the right 2π branch. | |
| double | group_delay_samples_at (double hz) const |
| Group delay in samples at the bin nearest hz. | |
| double | group_delay_seconds_at (double hz) const |
| Group delay in seconds at hz (samples / sample_rate). NaN when undefined. | |
| double | phase_radians_at (double hz) const |
| Unwrapped transfer phase in radians at hz. | |
| double | magnitude_db_rel_peak_at (double hz) const |
| Transfer magnitude at hz in dB relative to this curve's own peak transfer magnitude — always defined (it IS the gate input). | |
Public Attributes | |
| std::string | analyzer = "group_delay" |
| std::string | stimulus |
| Window | window = Window::rectangular |
| int | fft_length = 0 |
| int | analysis_offset = 0 |
| double | sample_rate = 0.0 |
| double | bin_hz = 0.0 |
| double | magnitude_floor_db = 0.0 |
| Magnitude gate, in dB relative to the curve's peak transfer magnitude. | |
| std::vector< PhasePoint > | full |
| Bin 0..N/2, monotonic in hz. | |
| std::vector< PhasePoint > | checkpoints |
| Requested frequencies only. | |
Phase / group-delay curve of a transfer function.
Determinism contract (echoed into the artifact):
Sign convention: group delay is positive for a causal delay — a filter that delays by k samples reports +k, matching -dφ/dω.
| bool pulp::test::audio::PhaseCurve::defined_at | ( | double | hz | ) | const |
True when the bin nearest hz carries enough energy for its group delay to be a measurement.
False for an empty curve. This does NOT qualify phase_radians_at — see phase_defined_at.
| double pulp::test::audio::PhaseCurve::group_delay_samples_at | ( | double | hz | ) | const |
Group delay in samples at the bin nearest hz.
NaN when defined_at(hz) is false — the caller must not treat a stopband as a measurement. NaN propagates loudly through arithmetic and fails any comparison, which is the intended failure mode.
| double pulp::test::audio::PhaseCurve::group_delay_seconds_at | ( | double | hz | ) | const |
Group delay in seconds at hz (samples / sample_rate). NaN when undefined.
| double pulp::test::audio::PhaseCurve::magnitude_db_rel_peak_at | ( | double | hz | ) | const |
Transfer magnitude at hz in dB relative to this curve's own peak transfer magnitude — always defined (it IS the gate input).
NOT the absolute out/in ratio that ResponseCurve::magnitude_db_at returns; see PhasePoint::magnitude_db_rel_peak. Returns kSilenceFloorDb for an empty curve.
| bool pulp::test::audio::PhaseCurve::phase_defined_at | ( | double | hz | ) | const |
True when the bin nearest hz is defined_at AND the unwrap reached it over an unbroken run of defined bins from DC, so its phase sits on the right 2π branch.
False for an empty curve.
| double pulp::test::audio::PhaseCurve::phase_radians_at | ( | double | hz | ) | const |
Unwrapped transfer phase in radians at hz.
NaN when phase_defined_at(hz) is false — which includes bins that are defined_at but sit above a gap the unwrap could not carry a branch across. See measure_group_delay.
| int pulp::test::audio::PhaseCurve::analysis_offset = 0 |
| std::string pulp::test::audio::PhaseCurve::analyzer = "group_delay" |
| double pulp::test::audio::PhaseCurve::bin_hz = 0.0 |
| std::vector<PhasePoint> pulp::test::audio::PhaseCurve::checkpoints |
Requested frequencies only.
| int pulp::test::audio::PhaseCurve::fft_length = 0 |
| std::vector<PhasePoint> pulp::test::audio::PhaseCurve::full |
Bin 0..N/2, monotonic in hz.
| double pulp::test::audio::PhaseCurve::magnitude_floor_db = 0.0 |
Magnitude gate, in dB relative to the curve's peak transfer magnitude.
Bins below it are reported defined = false. Necessary, not sufficient: clearing it does not by itself make a bin defined — the reference- and output-energy gates apply too (see measure_group_delay).
| double pulp::test::audio::PhaseCurve::sample_rate = 0.0 |
| std::string pulp::test::audio::PhaseCurve::stimulus |
| Window pulp::test::audio::PhaseCurve::window = Window::rectangular |