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 |
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.
| double pulp::test::audio::InharmonicityResult::b_coefficient = 0.0 |
Stiff-string B (least squares).
| double pulp::test::audio::InharmonicityResult::f0_hz = 0.0 |
Refined fundamental.
| int pulp::test::audio::InharmonicityResult::found_partials = 0 |
| std::string pulp::test::audio::InharmonicityResult::message |
| bool pulp::test::audio::InharmonicityResult::ok = false |
| std::vector<MeasuredPartial> pulp::test::audio::InharmonicityResult::partials |
| double pulp::test::audio::InharmonicityResult::rms_deviation_cents = 0.0 |
Residual of the stiff-string fit.
| 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.