Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::GraphicEqT< SampleType, MaxBands > Class Template Reference

A bounded cascade of configurable peaking bands for one audio channel. More...

#include <graphic_eq.hpp>

Public Types

using Band = GraphicEqBandT<SampleType>
using Coefficients = BiquadCoefficientsT<SampleType>

Public Member Functions

GraphicEqPrepareStatus prepare (SampleType sample_rate, std::size_t band_capacity=MaxBands) noexcept
GraphicEqConfigureStatus configure (std::span< const Band > bands, std::size_t transition_samples=0) noexcept
SampleType process (SampleType input) noexcept
bool process_block (SampleType *samples, std::size_t frames) noexcept
 Process caller-owned storage in place.
void reset () noexcept
 Clear recursive history and, if a transition is active, select its requested endpoint.
bool prepared () const noexcept
bool transitioning () const noexcept
bool healthy () const noexcept
std::size_t fault_count () const noexcept
std::size_t capacity () const noexcept
std::size_t band_count () const noexcept
SampleType sample_rate () const noexcept
SampleType supported_frequency_ceiling_hz () const noexcept
Band band (std::size_t index) const noexcept
Coefficients coefficients (std::size_t index) const noexcept
int tail_samples () const noexcept
double magnitude (double frequency_hz) const noexcept
 Stationary response of the requested endpoint.
double magnitude_db (double frequency_hz) const noexcept

Static Public Member Functions

static constexpr int latency_samples () noexcept
 The cascade is causal IIR and adds no bulk delay.
static constexpr std::size_t storage_capacity () noexcept

Static Public Attributes

static constexpr SampleType minimum_sample_rate_hz = SampleType{8000}
static constexpr SampleType maximum_sample_rate_hz = SampleType{384000}
static constexpr SampleType minimum_frequency_hz = SampleType{20}
static constexpr SampleType maximum_frequency_hz = SampleType{20000}
static constexpr SampleType minimum_gain_db = SampleType{-24}
static constexpr SampleType maximum_gain_db = SampleType{24}
static constexpr SampleType minimum_q = SampleType{0.1}
static constexpr SampleType maximum_q = SampleType{12}

Detailed Description

template<typename SampleType = float, std::size_t MaxBands = 31>
class pulp::signal::GraphicEqT< SampleType, MaxBands >

A bounded cascade of configurable peaking bands for one audio channel.

This is the reusable variable-band container. SixBandEqT remains the fixed-role low-shelf/four-peak/high-shelf compatibility surface, and this type deliberately does not perform constant-Q analysis or choose band frequencies. Callers provide a strictly increasing band layout.

configure() validates and designs the complete candidate before changing live state. An invalid request leaves coefficients, recursive history, and transition progress unchanged. A non-zero transition crossfades two stable cascades; recursive coefficients are never interpolated. A second request during that bounded transition is rejected so the audible endpoint is deterministic.

RT contract: all storage is fixed. prepare(), configure(), process(), process_block(), response inspection, and reset() allocate no memory. Design and response inspection use transcendental functions, so callers should keep those operations off the audio callback even though they are allocation-free. The object is not a concurrent publication primitive: call configure() while stopped or from the processing thread at a block boundary. Instantiate one object per independently processed channel.

Member Typedef Documentation

◆ Band

template<typename SampleType = float, std::size_t MaxBands = 31>
using pulp::signal::GraphicEqT< SampleType, MaxBands >::Band = GraphicEqBandT<SampleType>

◆ Coefficients

template<typename SampleType = float, std::size_t MaxBands = 31>
using pulp::signal::GraphicEqT< SampleType, MaxBands >::Coefficients = BiquadCoefficientsT<SampleType>

Member Function Documentation

◆ band()

template<typename SampleType = float, std::size_t MaxBands = 31>
Band pulp::signal::GraphicEqT< SampleType, MaxBands >::band ( std::size_t index) const
inlinenoexcept

◆ band_count()

template<typename SampleType = float, std::size_t MaxBands = 31>
std::size_t pulp::signal::GraphicEqT< SampleType, MaxBands >::band_count ( ) const
inlinenoexcept

◆ capacity()

template<typename SampleType = float, std::size_t MaxBands = 31>
std::size_t pulp::signal::GraphicEqT< SampleType, MaxBands >::capacity ( ) const
inlinenoexcept

◆ coefficients()

template<typename SampleType = float, std::size_t MaxBands = 31>
Coefficients pulp::signal::GraphicEqT< SampleType, MaxBands >::coefficients ( std::size_t index) const
inlinenoexcept

◆ configure()

template<typename SampleType = float, std::size_t MaxBands = 31>
GraphicEqConfigureStatus pulp::signal::GraphicEqT< SampleType, MaxBands >::configure ( std::span< const Band > bands,
std::size_t transition_samples = 0 )
inlinenoexcept

◆ fault_count()

template<typename SampleType = float, std::size_t MaxBands = 31>
std::size_t pulp::signal::GraphicEqT< SampleType, MaxBands >::fault_count ( ) const
inlinenoexcept

◆ healthy()

template<typename SampleType = float, std::size_t MaxBands = 31>
bool pulp::signal::GraphicEqT< SampleType, MaxBands >::healthy ( ) const
inlinenoexcept

◆ latency_samples()

template<typename SampleType = float, std::size_t MaxBands = 31>
constexpr int pulp::signal::GraphicEqT< SampleType, MaxBands >::latency_samples ( )
inlinestaticconstexprnoexcept

The cascade is causal IIR and adds no bulk delay.

Any active non-neutral peaking band has an asymptotic recursive tail, reported with Pulp's -1 infinite-tail sentinel. A bypass/all-zero-gain layout has no tail.

◆ magnitude()

template<typename SampleType = float, std::size_t MaxBands = 31>
double pulp::signal::GraphicEqT< SampleType, MaxBands >::magnitude ( double frequency_hz) const
inlinenoexcept

Stationary response of the requested endpoint.

During a transition this describes the destination, not the instantaneous linear crossfade.

◆ magnitude_db()

template<typename SampleType = float, std::size_t MaxBands = 31>
double pulp::signal::GraphicEqT< SampleType, MaxBands >::magnitude_db ( double frequency_hz) const
inlinenoexcept

◆ prepare()

template<typename SampleType = float, std::size_t MaxBands = 31>
GraphicEqPrepareStatus pulp::signal::GraphicEqT< SampleType, MaxBands >::prepare ( SampleType sample_rate,
std::size_t band_capacity = MaxBands )
inlinenoexcept

◆ prepared()

template<typename SampleType = float, std::size_t MaxBands = 31>
bool pulp::signal::GraphicEqT< SampleType, MaxBands >::prepared ( ) const
inlinenoexcept

◆ process()

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::process ( SampleType input)
inlinenoexcept

◆ process_block()

template<typename SampleType = float, std::size_t MaxBands = 31>
bool pulp::signal::GraphicEqT< SampleType, MaxBands >::process_block ( SampleType * samples,
std::size_t frames )
inlinenoexcept

Process caller-owned storage in place.

A null pointer is valid only for an empty block and otherwise fails without advancing any DSP state.

A pending crossfade runs sample by sample. Otherwise the block goes through the active cascade's block path in kSnapChunkSamples chunks, which matches the sample path to the Biquad block path's accuracy contract (see BiquadT::process_chain()). Faults keep the sample path's timing: a non-finite input is handed to process() at its own sample, and at the first non-finite output the cascade is recovered exactly as process() would and the rest of the chunk is rerun from its saved input on the recovered (reset) cascade. No cascade state needs saving, because recovery resets it.

◆ reset()

template<typename SampleType = float, std::size_t MaxBands = 31>
void pulp::signal::GraphicEqT< SampleType, MaxBands >::reset ( )
inlinenoexcept

Clear recursive history and, if a transition is active, select its requested endpoint.

Configuration and fault telemetry are preserved.

◆ sample_rate()

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::sample_rate ( ) const
inlinenoexcept

◆ storage_capacity()

template<typename SampleType = float, std::size_t MaxBands = 31>
constexpr std::size_t pulp::signal::GraphicEqT< SampleType, MaxBands >::storage_capacity ( )
inlinestaticconstexprnoexcept

◆ supported_frequency_ceiling_hz()

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::supported_frequency_ceiling_hz ( ) const
inlinenoexcept

◆ tail_samples()

template<typename SampleType = float, std::size_t MaxBands = 31>
int pulp::signal::GraphicEqT< SampleType, MaxBands >::tail_samples ( ) const
inlinenoexcept

◆ transitioning()

template<typename SampleType = float, std::size_t MaxBands = 31>
bool pulp::signal::GraphicEqT< SampleType, MaxBands >::transitioning ( ) const
inlinenoexcept

Member Data Documentation

◆ maximum_frequency_hz

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::maximum_frequency_hz = SampleType{20000}
staticconstexpr

◆ maximum_gain_db

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::maximum_gain_db = SampleType{24}
staticconstexpr

◆ maximum_q

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::maximum_q = SampleType{12}
staticconstexpr

◆ maximum_sample_rate_hz

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::maximum_sample_rate_hz = SampleType{384000}
staticconstexpr

◆ minimum_frequency_hz

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::minimum_frequency_hz = SampleType{20}
staticconstexpr

◆ minimum_gain_db

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::minimum_gain_db = SampleType{-24}
staticconstexpr

◆ minimum_q

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::minimum_q = SampleType{0.1}
staticconstexpr

◆ minimum_sample_rate_hz

template<typename SampleType = float, std::size_t MaxBands = 31>
SampleType pulp::signal::GraphicEqT< SampleType, MaxBands >::minimum_sample_rate_hz = SampleType{8000}
staticconstexpr

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/graphic_eq.hpp