|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Host-only measurement. More...
Host-only measurement.
Classes | |
| struct | Decay |
| struct | Measure |
| struct | Period |
| struct | Profile |
| struct | Reflectance |
Enumerations | |
| enum class | Window { Rectangular , Hann } |
Functions | |
| template<typename T > | |
| double | projection_power (const T *x, int n, double hz, double fs, Window window) |
| template<typename T > | |
| double | bin_energy (const T *x, int n, double hz, double fs) |
| template<typename T > | |
| double | bin_power (const T *x, int n, double hz, double fs) |
| template<typename T > | |
| double | mean_power (const T *x, int n) |
| template<typename T > | |
| Period | autocorr_period (const T *x, int n, double expected, double tolerance) |
| template<typename T > | |
| Profile | harmonic_profile (const T *x, int n, double f0, double fs, int harmonics) |
| template<typename T > | |
| Measure | measure_window (T *x, int n, double nominal_period, double fs, int stick, int slips, int harmonics) |
| bool | helmholtz (const Measure &m, double min_slips=0.9, double max_slips=1.1) |
| One release per period, give or take a window edge. | |
| template<typename F > | |
| double | magnitude_at (double hz, double fs, F &&process, int settle=4000, int n=20000) |
| template<typename F > | |
| Reflectance | reflectance (double hz, double fs, F &&reflect, int settle=-1, int n=-1) |
| A termination's reflection for a unit sine arriving at hz. | |
| template<typename T > | |
| Decay | decay_fit (const T *x, int n, double hz, int window, double fs, double floor=1e-12) |
Variables | |
| constexpr double | PI = 3.14159265358979323846 |
| constexpr int | MAX_HARMONICS = 16 |
|
strong |
| Enumerator | |
|---|---|
| Rectangular | |
| Hann | |
Definition at line 33 of file measure.hpp.
|
inline |
|Σ w[i] x[i] e^(−jωi)|² by Goertzel's recursion, w the window. The one projection both energy measures are built on.
Definition at line 38 of file measure.hpp.
Referenced by bin_energy(), and bin_power().
|
inline |
Hann-weighted energy at hz, normalised by n². The window keeps harmonics apart when bins sit on a measured, not nominal, pitch.
Definition at line 54 of file measure.hpp.
References Hann, and projection_power().
Referenced by decay_fit(), harmonic_profile(), and measure_window().
|
inline |
Rectangular power at hz as mean power: a unit-amplitude sine at hz reads 0.5, and the bins of a spectrum sum to mean_power(). The DSP suite's measure.
Definition at line 61 of file measure.hpp.
References projection_power(), and Rectangular.
|
inline |
Definition at line 66 of file measure.hpp.
Referenced by harmonic_profile(), and measure_window().
|
inline |
Autocorrelation near an expected lag: the best integer lag within ±tolerance of it, refined by a parabola through its neighbours. The mean is removed on a copy; every lag is summed over the same span so the peak is not biased toward short lags.
Definition at line 85 of file measure.hpp.
Referenced by measure_window().
|
inline |
Level, spectral centroid over the harmonics, and each harmonic's level relative to the strongest, on bins at multiples of f0 (Hann-weighted).
Definition at line 130 of file measure.hpp.
References bin_energy(), sbl::dsp::analysis::Profile::harmonics, MAX_HARMONICS, and mean_power().
|
inline |
Judge a window of a bowed model's output. The mean is removed from x in place, so a profile taken afterwards sees the same signal. Stick and slip counts come from the caller, who watched the exciter while it played.
Definition at line 169 of file measure.hpp.
References autocorr_period(), bin_energy(), mean_power(), sbl::dsp::analysis::Period::periodicity, and sbl::dsp::analysis::Period::samples.
|
inline |
One release per period, give or take a window edge.
Definition at line 208 of file measure.hpp.
References sbl::dsp::analysis::Measure::slips_per_period.
|
inline |
A processor's magnitude at hz: drive it with a unit sine for settle samples, then project its output on the drive over n.
Definition at line 217 of file measure.hpp.
References PI.
|
inline |
A termination's reflection for a unit sine arriving at hz.
Definition at line 236 of file measure.hpp.
References sbl::dsp::analysis::Reflectance::phase_delay_samples, and PI.
|
inline |
One partial's decay: energy at hz in consecutive windows, a straight line through dB against time until 60 dB down or the floor.
Definition at line 264 of file measure.hpp.
References bin_energy().
|
inlineconstexpr |
Definition at line 28 of file measure.hpp.
Referenced by magnitude_at(), projection_power(), and reflectance().
|
inlineconstexpr |
Definition at line 29 of file measure.hpp.
Referenced by harmonic_profile().