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

Inharmonicity of a (quasi-)harmonic tone. More...

#include <modal_extraction.hpp>

Public Attributes

double f0_hz = 0.0
 Refined fundamental.
double b_coefficient = 0.0
 Stiff-string B (least squares).
double rms_deviation_cents = 0.0
 Residual of the stiff-string fit.
double rms_harmonic_deviation_cents = 0.0
 RMS deviation from the pure harmonic series (B = 0).
std::vector< MeasuredPartial > partials
int found_partials = 0
bool ok = false
std::string message

Detailed Description

Inharmonicity of a (quasi-)harmonic tone.

The model is the stiff string: f_n = n * f0 * sqrt(1 + B * n^2), with B the inharmonicity coefficient (dimensionless, ~1e-4 for a piano bass string, ~0 for an ideal string). B is fit by least squares over the found partials; rms_deviation_cents is the fit residual and is the honest answer for anything the stiff-string model does not describe (a drum, a bar, a bell), where B is meaningless and the per-partial deviations are the actual result.

Member Data Documentation

◆ b_coefficient

double pulp::test::audio::InharmonicityResult::b_coefficient = 0.0

Stiff-string B (least squares).

◆ f0_hz

double pulp::test::audio::InharmonicityResult::f0_hz = 0.0

Refined fundamental.

◆ found_partials

int pulp::test::audio::InharmonicityResult::found_partials = 0

◆ message

std::string pulp::test::audio::InharmonicityResult::message

◆ ok

bool pulp::test::audio::InharmonicityResult::ok = false

◆ partials

std::vector<MeasuredPartial> pulp::test::audio::InharmonicityResult::partials

◆ rms_deviation_cents

double pulp::test::audio::InharmonicityResult::rms_deviation_cents = 0.0

Residual of the stiff-string fit.

◆ rms_harmonic_deviation_cents

double pulp::test::audio::InharmonicityResult::rms_harmonic_deviation_cents = 0.0

RMS deviation from the pure harmonic series (B = 0).

Compare against rms_deviation_cents to see whether the stiff-string model bought anything at all.


The documentation for this struct was generated from the following file: