Options for measure_aliasing. More...
#include <audio_spectrum.hpp>
Public Attributes | |
| double | max_alias_frequency_hz = 20000.0 |
| ── THE MOST IMPORTANT FIELD IN THIS HEADER. | |
| int | num_harmonics = 64 |
| Harmonics of the ideal series to account for, from the fundamental up. | |
| int | analysis_offset = 0 |
| Samples skipped (settling / plugin latency). | |
| int | analysis_length = 0 |
| Samples analyzed; 0 means "to the end of the buffer". | |
| int | channel = 0 |
| double | min_separation_bins = 2.0 |
| Minimum separation between two fitted landing sites, in units of 1 / analysis-duration (the natural resolution of a fit this long). | |
Options for measure_aliasing.
| int pulp::test::audio::AliasOptions::analysis_length = 0 |
Samples analyzed; 0 means "to the end of the buffer".
Longer is strictly better here — the detection floor improves as 1/√length, and closely-spaced components separate as 1/length.
| int pulp::test::audio::AliasOptions::analysis_offset = 0 |
Samples skipped (settling / plugin latency).
| int pulp::test::audio::AliasOptions::channel = 0 |
| double pulp::test::audio::AliasOptions::max_alias_frequency_hz = 20000.0 |
── THE MOST IMPORTANT FIELD IN THIS HEADER.
READ THIS BEFORE GATING. ──
Aliases landing ABOVE this frequency are measured and reported, but are excluded from worst_alias_db / worst_alias_hz.
A full-band "no alias above −100 dB" gate is physically impossible for any finite method, and a caller who removes this qualifier has written a gate that no correct implementation can pass. Two independent reasons:
The physics is not a defect, it is why the default is 20 kHz: an alias that lands at 23.4 kHz is above hearing and unavoidable; one that lands at 7 kHz is audible and is the bug. Band-qualifying is what makes the gate measure the oscillator instead of the sample rate.
Raise it only to characterize (full_band_worst_alias_db already reports the unqualified number for exactly that). Lower it for a content-specific audibility argument. Setting it at or above Nyquist makes the qualifier a no-op and is the misuse described above.
| double pulp::test::audio::AliasOptions::min_separation_bins = 2.0 |
Minimum separation between two fitted landing sites, in units of 1 / analysis-duration (the natural resolution of a fit this long).
Sites closer than this — to each other, to DC, or to Nyquist — are not linearly independent over the segment, so they are marked resolved = false rather than fitted to an ill-conditioned answer.
| int pulp::test::audio::AliasOptions::num_harmonics = 64 |
Harmonics of the ideal series to account for, from the fundamental up.
Every one above Nyquist contributes a fold site. Too few and real aliases are missed (they fall through to noise_db); too many and the fit spends conditioning on sites with nothing at them. For a saw or pulse, go high enough that num_harmonics · f0 is several times the sample rate.
A series with NO harmonic at or above Nyquist is rejected outright (measure_aliasing throws): it models no fold site, so its report would read as clean on ANY signal, however aliased. Note the default hits that wall for a low fundamental — 64 harmonics of anything below 375 Hz at 48 kHz never reach Nyquist — so size this from the sample rate, not from habit.