nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
pitch_harmonics.hpp File Reference

Fundamental-frequency estimation and harmonic-content metrics. More...

#include <memory_resource>
#include <nk/value/value.hpp>

Go to the source code of this file.

Functions

Value nk::audio::pitch (const Value &x, double fs, double minF=50.0, double maxF=400.0, std::pmr::memory_resource *mr=nullptr)
 Pitch via the Normalised Cross-correlation Function (the default estimator).
Value nk::audio::pitchCEP (const Value &x, double fs, double minF=50.0, double maxF=400.0, std::pmr::memory_resource *mr=nullptr)
 Pitch via the cepstrum method (Noll 1967).
Value nk::audio::pitchPEF (const Value &x, double fs, double minF=50.0, double maxF=400.0, std::pmr::memory_resource *mr=nullptr)
 Pitch Estimation Filter (Gonzalez & Brookes 2011).
Value nk::audio::pitchLHS (const Value &x, double fs, double minF=50.0, double maxF=400.0, std::pmr::memory_resource *mr=nullptr)
 Log Harmonic Sum / Subharmonic Summation (Hermes 1988).
Value nk::audio::pitchSRH (const Value &x, double fs, double minF=50.0, double maxF=400.0, std::pmr::memory_resource *mr=nullptr)
 Summation of Residual Harmonics (Drugman & Alwan 2011).
Value nk::audio::harmonicRatio (const Value &x, double fs, std::pmr::memory_resource *mr=nullptr)
 Harmonic ratio — strength of harmonic content per frame.

Detailed Description

Fundamental-frequency estimation and harmonic-content metrics.

Five fundamental-frequency estimators, one dedicated entry point per algorithm — pitch (normalised cross-correlation, the default), pitchCEP, pitchPEF, pitchLHS, pitchSRH.

Shared semantics across the five estimators:

  • x is a real 1-D audio signal, fs the sample rate in Hz.
  • minF / maxF bound the pitch search range (defaults 50 / 400 Hz).
  • Output is a column vector of per-frame f0 values in Hz.
  • MedianFilterLength / WindowLength / OverlapLength NV-pair args are deferred. pitchnn (DNN-based) deferred.

Definition in file pitch_harmonics.hpp.