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

Options for estimate_pitch. More...

#include <pitch_track.hpp>

Public Attributes

int fft_length = 16384
 FFT length for the coarse peak (power of two).
double min_hz = 20.0
 Search band.
double max_hz = 0.0
Window window = Window::blackman
 Window for the coarse peak.
double kaiser_beta = kDefaultKaiserBeta
double min_confidence = 0.5
 Voicing gate: confidence below this refuses the estimate.
int harmonic_count = 0
 Harmonics (including the fundamental) summed for the confidence measure.
double silence_rms = 1.0e-4
 RMS below this (linear, ~−80 dBFS) is treated as silence and refused before any spectral work — a dead processor must not measure a pitch.
int channel = 0
 Channel analyzed, and an offset/length window into it.
int analysis_offset = 0
int analysis_length = 0

Detailed Description

Options for estimate_pitch.

Member Data Documentation

◆ analysis_length

int pulp::test::audio::PitchOptions::analysis_length = 0

◆ analysis_offset

int pulp::test::audio::PitchOptions::analysis_offset = 0

◆ channel

int pulp::test::audio::PitchOptions::channel = 0

Channel analyzed, and an offset/length window into it.

analysis_length = 0 means "from `analysis_offset` to the end of the buffer".

◆ fft_length

int pulp::test::audio::PitchOptions::fft_length = 16384

FFT length for the coarse peak (power of two).

Automatically reduced to the largest power of two that fits the analysis segment when the segment is shorter — a short per-frame window does not need a huge transform, and the projection refinement (not the FFT) sets the final accuracy.

◆ harmonic_count

int pulp::test::audio::PitchOptions::harmonic_count = 0

Harmonics (including the fundamental) summed for the confidence measure.

0 (the default) means "every harmonic below Nyquist" — required so a bright comb (BLIT/buzz, narrow pulse) whose energy is spread across hundreds of partials is not wrongly refused. A positive value caps the sum (and its cost) for a signal known to be spectrally compact.

◆ kaiser_beta

double pulp::test::audio::PitchOptions::kaiser_beta = kDefaultKaiserBeta

◆ max_hz

double pulp::test::audio::PitchOptions::max_hz = 0.0

◆ min_confidence

double pulp::test::audio::PitchOptions::min_confidence = 0.5

Voicing gate: confidence below this refuses the estimate.

0.5 accepts tones and saws (harmonic ratio ~1) while rejecting noise.

◆ min_hz

double pulp::test::audio::PitchOptions::min_hz = 20.0

Search band.

max_hz = 0 means 0.45 · sample_rate (safely below Nyquist, where fit_tone degenerates). The coarse peak is taken only from bins inside [min_hz, max_hz].

◆ silence_rms

double pulp::test::audio::PitchOptions::silence_rms = 1.0e-4

RMS below this (linear, ~−80 dBFS) is treated as silence and refused before any spectral work — a dead processor must not measure a pitch.

◆ window

Window pulp::test::audio::PitchOptions::window = Window::blackman

Window for the coarse peak.

Blackman by default: its −57 dB side lobes keep a strong harmonic from masking the fundamental peak on a dense signal, while its wide main lobe is irrelevant here because sub-bin accuracy comes from the projection stage, not the FFT.


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