A break-point spectral envelope: gain in dB as a function of frequency, interpolated linearly in the (log2 abscissa, dB) domain — the perceptually correct axes on both sides.
More...
#include <additive_spectral_envelope.hpp>
|
| void | clear () |
| | Removes every break-point.
|
| int | size () const |
| bool | add (double abscissa, double gain_db) |
| | Appends a break-point.
|
| double | gain_db_at (double abscissa) const |
| | Gain in dB at an abscissa.
|
|
| static SpectralEnvelope | tilt (double db_per_octave, double reference=1.0) |
| | Builds a constant-slope envelope — db_per_octave measured from reference — as two break-points spanning the audio band.
|
A break-point spectral envelope: gain in dB as a function of frequency, interpolated linearly in the (log2 abscissa, dB) domain — the perceptually correct axes on both sides.
Fixed capacity, so it is a POD-ish value type that never allocates and can be handed to a prepared bank from the audio thread.
◆ add()
| bool pulp::signal::SpectralEnvelope::add |
( |
double | abscissa, |
|
|
double | gain_db ) |
|
inline |
Appends a break-point.
Abscissae must be strictly ascending; a non-ascending or over-capacity point is rejected and reported, rather than silently corrupting the interpolation's monotonicity assumption.
◆ clear()
| void pulp::signal::SpectralEnvelope::clear |
( |
| ) |
|
|
inline |
Removes every break-point.
An empty envelope is a flat 0 dB — the identity, so a default-constructed envelope changes nothing.
◆ gain_db_at()
| double pulp::signal::SpectralEnvelope::gain_db_at |
( |
double | abscissa | ) |
const |
|
inline |
Gain in dB at an abscissa.
Outside the break-point span the endpoint value is held rather than extrapolated: extrapolating a slope past the last point is how an envelope quietly produces +40 dB at the top of the bank.
◆ size()
| int pulp::signal::SpectralEnvelope::size |
( |
| ) |
const |
|
inline |
◆ tilt()
| SpectralEnvelope pulp::signal::SpectralEnvelope::tilt |
( |
double | db_per_octave, |
|
|
double | reference = 1.0 ) |
|
inlinestatic |
Builds a constant-slope envelope — db_per_octave measured from reference — as two break-points spanning the audio band.
The one envelope shape whose RELATIVE spectrum is pitch-independent in either SpectralDomain, because it is affine in log2 frequency.
◆ kMaxBreakpoints
| int pulp::signal::SpectralEnvelope::kMaxBreakpoints = 64 |
|
staticconstexpr |
Break-point capacity.
[design parameter] default 64; 16 is the documented working size and 2 is the minimum that defines a slope.
The documentation for this class was generated from the following file: