DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::Equalizer< T, MaxBands > Class Template Reference

Parametric multi-band EQ using cascaded biquads or FFT overlap-save convolution. More...

#include <Equalizer.h>

Collaboration diagram for dspark::Equalizer< T, MaxBands >:

Classes

struct  AnalogBand
 One band of the analog response. More...
 
struct  BandConfig
 Full configuration for a single EQ band. More...
 
struct  PrototypeEngine
 The state of the prototype-phase mode, allocated in prepare(). More...
 
struct  PrototypeSeen
 What the correction of one band was designed from. More...
 
struct  StagedBand
 One band's published configuration: a seqlock over atomic words. More...
 

Public Types

enum class  FilterMode { MinimumPhase , LinearPhase , PrototypePhase }
 Filter processing mode. More...
 
enum class  BandType {
  Peak , LowShelf , HighShelf , LowPass ,
  HighPass , Notch , BandPass , Tilt ,
  AllPass , ConstantTilt , LowPassWall , HighPassWall
}
 Filter type for each EQ band. More...
 
enum class  Scope {
  Stereo , Left , Right , Mid ,
  Side
}
 Where in a stereo pair a band acts. More...
 
using Structure = typename FilterEngine< T >::Structure
 How the sections of the bands are realised (FilterEngine::Structure).
 

Public Member Functions

 ~Equalizer ()=default
 Non-virtual destructor to prevent vtable instantiation (zero virtual dispatch).
 
void prepare (const AudioSpec &spec)
 Prepares all bands and allocates necessary resources for processing.
 
void processBlock (AudioBufferView< T > buffer) noexcept
 Processes an audio buffer in-place.
 
T processSample (T input, int channel) noexcept
 Processes a single sample through all enabled bands (IIR mode only).
 
void reset () noexcept
 Resets all filter states to zero to prevent ringing on playback start.
 
void setBand (int index, T frequency, T gainDb)
 Configures a band with frequency and gain (Peak filter).
 
void setBand (int index, T frequency, T gainDb, T q)
 Configures a band with frequency, gain, and Q.
 
void setBand (int index, const BandConfig &config)
 Configures a band with full control over all parameters. Thread-safe.
 
void setNumBands (int count)
 Sets the number of active bands with auto-logarithmic spacing.
 
int getNumBands () const noexcept
 Returns the number of active bands.
 
void setLoudnessCompensation (bool on) noexcept
 Keeps the loudness (off by default): the bands' change of the K-weighted level of pink noise (as BS.1770 hears it) is taken back by a gain, which moves in 50 ms when the bands change. With bands on the middle, the sides or one channel it reads every band together. processSample() applies it at once.
 
bool getLoudnessCompensation () const noexcept
 
T getCompensationDb () const noexcept
 
void setMatchedBells (bool enabled) noexcept
 Switches Peak bands to the analog-matched (de-cramped) design.
 
bool isMatchedBells () const noexcept
 Returns whether Peak bands use the matched design (setMatchedBells()).
 
void setStructure (Structure structure) noexcept
 Chooses how the bands' sections are realised in minimum phase.
 
Structure getStructure () const noexcept
 
void setMatchedFilters (bool enabled) noexcept
 Switches LowPass/HighPass, BandPass and slope-1 shelf bands to the analog-matched designs.
 
bool isMatchedFilters () const noexcept
 Returns whether non-bell bands use the matched designs (setMatchedFilters()).
 
void setAnalogResponse (bool enabled) noexcept
 Designs every band from its analog prototype (see the file notes).
 
void setResonantShelves (bool enabled) noexcept
 Lets the Q of a shelf go above 0.7071 (off by default, where a Q above it is read as 0.7071).
 
bool isResonantShelves () const noexcept
 Returns whether the Q of a shelf can go above 0.7071 (setResonantShelves()).
 
bool isAnalogResponse () const noexcept
 Returns whether bands are designed from their analog prototypes (setAnalogResponse()).
 
BandConfig getBandConfig (int index) const noexcept
 Returns the current configuration of a band.
 
void setBandEnabled (int index, bool enabled) noexcept
 Enables or disables a band without changing its parameters.
 
void setFilterMode (FilterMode mode) noexcept
 Sets the filter processing mode (minimum, linear or prototype phase).
 
FilterMode getFilterMode () const noexcept
 Returns the current filter mode.
 
int getLatency () const noexcept
 Returns the latency in samples.
 
T getAnalogBandResponse (int index, T hz) const noexcept
 The response of a band of the analog response as its sections are at this moment, a glide in flight included, in decibels (0 for a band that rests, is off, or that the other engine runs).
 
void setLinearPhaseKernelLength (int taps) noexcept
 Requests the linear-phase kernel length in taps.
 
int getLinearPhaseKernelLength () const noexcept
 The prepared linear-phase kernel length in taps (0 before prepare()). Read it from the setup thread or once prepared.
 
void setSoftMode (bool enabled) noexcept
 Enables soft mode (anti-ringing Q reduction dynamically based on gain).
 
bool getSoftMode () const noexcept
 Returns whether soft mode is enabled.
 
void getMagnitudeForFrequencyArray (const T *frequencies, T *magnitudes, int numPoints) const noexcept
 Computes the combined magnitude response of all enabled bands.
 
void getMagnitudeForFrequencyArray (const T *frequencies, T *magnitudes, int numPoints, Scope where) const noexcept
 The magnitude response at one place of the stereo pair: the stereo bands and the bands placed there.
 
FilterEngine< T > & getBandFilter (int index) noexcept
 Direct access to a band's underlying FilterEngine.
 
const FilterEngine< T > & getBandFilter (int index) const noexcept
 Const overload. Same clamping contract.
 
std::vector< uint8_t > getState () const
 Serializes bands and modes (setup/UI threads; allocates).
 
bool setState (const uint8_t *data, size_t size)
 Restores bands and modes from a blob (tolerant; rejects foreign ids).
 
int buildBandStages (const BandConfig &cfg, BiquadCoeffs *stages) const noexcept
 Fills stages with the ACTUAL biquad cascade for a band (per-stage Butterworth Q for multi-stage LP/HP, single biquad otherwise) and returns the stage count. Public analysis API: UIs use it to draw a magnitude response that matches what the IIR FilterEngine really applies, including the user's resonance on LP/HP cascades, soft mode's Q cap and the matched-bell design. Mirrors the engine's own parameter sanitization (frequency and Q floors). Requires prepare().
 
int buildBandSections (const BandConfig &cfg, BiquadCoeffs *sections, int capacity) const noexcept
 Fills sections with the biquads a band runs, whichever engine runs it, and returns how many (up to 16).
 

Protected Types

enum class  LpStage {
  Idle , Snapshot , Magnitude , Combine ,
  Transform , Partition
}
 
enum class  DesignPace { Sliced , Immediate , Setup }
 How much of a design one advanceDesign() call may do. More...
 

Protected Member Functions

void magnitudeOfBands (const T *frequencies, T *magnitudes, int numPoints, int where) const noexcept
 The product of the enabled bands: all of them (where < 0), or the stereo ones and those placed at where.
 
T effectiveQ (const BandConfig &cfg) const noexcept
 The band Q the audio path actually uses (soft mode caps it by gain).
 
void refreshCompensation () noexcept
 Translates BandConfigs into internal FilterEngine parameters safely.
 
void applyCompensation (AudioBufferView< T > &buffer) noexcept
 The compensation's gain on a block (nothing at rest at unity).
 
void updateActiveFilters () noexcept
 
BiquadCoeffs computeBandCoeffs (const BandConfig &cfg) const noexcept
 Computes single-biquad coefficients for a band (analysis/kernel).
 
bool usesAnalog (const BandConfig &cfg) const noexcept
 Whether a band runs with the analog response (the switch, or a band only it can make).
 
AnalogCascade bandPrototype (const BandConfig &cfg) const noexcept
 The analog prototype of a band.
 
int designSections (const BandConfig &cfg, BiquadCoeffs *sections, int capacity) const noexcept
 The biquads of a band of the analog response.
 
int rampSamples (const BandConfig &from, const BandConfig &to) const noexcept
 How long the coefficients of a band take to reach a new design: long for a small move, short for a jump.
 
void designAnalogBand (int index, const BandConfig &cfg, bool snap) noexcept
 Designs a band of the analog response and starts its cascade towards the design (audio thread, or prepare()).
 
void nextStretch (AnalogBand &band) noexcept
 Starts the next stretch of a glide: designs where it ends and sends the coefficients there.
 
void advanceGlide (AnalogBand &band, int samples) noexcept
 Counts the samples a gliding band has played and starts its next stretch when one ends.
 
void settleAnalogBand (AnalogBand &band) noexcept
 Once a glide has landed: dropped sections leave, and a resting band stops computing.
 
void runBand (int index, AudioBufferView< T > view) noexcept
 One block through a band, in the engine that runs it.
 
void resetBand (int index) noexcept
 
void processMinimumPhase (AudioBufferView< T > buffer) noexcept
 MinimumPhase processing, with each band's on/off state crossfaded over kBandFadeSeconds.
 
void processBandSlice (int i, AudioBufferView< T > view, int n, int activeBands) noexcept
 One band over one slice, on the channels of its scope, with its on/off fade. For a band of the middle or the sides the view is already in that form.
 
void prototypeBandCurves (int index) noexcept
 The analog response of a band over its digital one, on the grid.
 
void refreshPrototype (bool snap) noexcept
 Brings the correction up to date with the bands as they are now, and starts its fade if anything changed.
 
void designPrototype (bool snap) noexcept
 Designs the correction filters from the curves of the bands and fades to them.
 
void clearPrototypeStream () noexcept
 Clears what the correction remembers of the signal.
 
void processPrototype (AudioBufferView< T > buffer) noexcept
 The correction over one block: every channel through its filter, and with placed bands the other channel of the pair through the one that crosses.
 
int resolveKernelLength (double sampleRate) const noexcept
 Kernel length for a sample rate (see setLinearPhaseKernelLength()).
 
void clearLinearPhaseStream () noexcept
 Clears the engine's audio history (not the kernels).
 
void advanceDesign (DesignPace pace) noexcept
 Runs one bounded slice of a kernel design into the inactive set.
 
void conditionBandsAfterLinearPhase () noexcept
 Leaving LinearPhase: clears the bands and runs them over the input the engine still holds (the last whole partition and what there is of the current one), in order, so they resume from the memory of what came just before and not from that of the stretch of audio they last played.
 
void finishDesignNow () noexcept
 Completes a pending design now and adopts it without a crossfade (first block after prepare/reset/mode entry).
 
void runLinearPhaseHop () noexcept
 One partition hop: schedule the design, then convolve every prepared channel (uniformly partitioned overlap-save).
 
void processLinearPhase (AudioBufferView< T > buffer) noexcept
 LinearPhase processing: any block length streams through a partition-sized FIFO, so the output is identical whatever the host's block partition. Channels beyond the prepared count pass through unprocessed (not delayed).
 

Static Protected Member Functions

static double shelfSlopeFromQ (double q, double gainDb) noexcept
 Converts a user-facing shelf Q into the RBJ shelf slope S.
 
static int legacySlope (const BandConfig &cfg) noexcept
 The slope the cookbook engine runs: 6 to 48 dB per octave, whole.
 
static bool restsAtUnity (const BandConfig &cfg) noexcept
 Whether a band does nothing as configured: a gain band within kRestDb of 0 dB.
 
static int glideStretches (const BandConfig &from, const BandConfig &to, int ramp) noexcept
 In how many designs a band goes from one configuration to another: one for every quarter of an octave of frequency, every 12 dB of gain and every octave of Q (linear interpolation of the coefficients between two designs that close stays within half a decibel of the band of the parameters in between), with no stretch shorter than kStretchSamples. 1: straight there.
 
static BandConfig between (const BandConfig &from, const BandConfig &to, double share) noexcept
 The configuration a share of the way between two: frequency and Q in octaves, gain in decibels.
 
static bool sameDesign (const BandConfig &a, const BandConfig &b) noexcept
 Whether two configurations give the same sections (the enabled flag is not part of the design).
 
static T moveTowards (T from, T to, T delta) noexcept
 
static bool prototypeCovers (const BandConfig &cfg) noexcept
 Whether a band is one the correction covers: an elliptic wall is not (its digital form is itself).
 

Protected Attributes

AudioSpec spec_ {}
 
std::atomic< int > numBands_ { 0 }
 
std::array< FilterEngine< T >, MaxBands > bands_ {}
 
std::atomic< Structure > structure_ { Structure::DirectForm }
 setStructure().
 
std::array< StagedBand, MaxBands > staged_ {}
 Published band configurations. The ONLY band storage both threads reach.
 
std::array< BandConfig, MaxBands > masterConfigs_ {}
 
std::array< std::atomic< bool >, MaxBands > bandEnabled_ {}
 
std::atomic< bool > loudnessComp_ { false }
 
std::atomic< T > compensationDb_ { T(0) }
 
BiquadCoeffs kShelf_ {}
 
BiquadCoeffs kHighPass_ {}
 
double compTarget_ = 1.0
 
double compNow_ = 1.0
 
double compStep_ = 0.0
 
int compRamp_ = 2400
 
int compLeft_ = 0
 
std::atomic< bool > softMode_ { false }
 
std::atomic< bool > configDirty_ { false }
 
std::atomic< bool > matchedBells_ { true }
 Matched (de-cramped) bells by default.
 
std::atomic< bool > matchedFilters_ { false }
 Matched LP/HP/BP/shelves: opt-in.
 
std::atomic< bool > analogResponse_ { false }
 Every band from its analog prototype: opt-in.
 
std::atomic< bool > resonantShelves_ { false }
 The Q of a shelf can go above 0.7071: opt-in.
 
std::unique_ptr< std::array< AnalogBand, MaxBands > > analog_
 
std::unique_ptr< PrototypeEngine > prototype_
 The correction of the prototype-phase mode.
 
bool prototypeWasActive_ = false
 The last block ran in that mode.
 
FilterDesign::Band designBand_
 
std::array< bool, MaxBands > bandAnalog_ {}
 Which engine runs each band.
 
std::array< int, MaxBands > bandScope_ {}
 Where each band acts (audio thread's copy).
 
std::atomic< FilterMode > filterMode_ { FilterMode::MinimumPhase }
 
std::atomic< bool > lpDirty_ { true }
 
std::atomic< int > lpKernelRequest_ { 0 }
 0 = automatic length.
 
std::array< T, MaxBands > bandMix_ {}
 
std::vector< T > bandDry_
 
int bandDryChannels_ = 0
 
int bandDryStride_ = 0
 
T bandFadeStep_ = T(1)
 
bool bandSnap_ = true
 
std::unique_ptr< FFTReal< T > > lpFft_
 Partition FFT (2 x partition); gates the engine.
 
std::unique_ptr< FFTReal< T > > lpDesignFft_
 Design FFT (2 x kernel).
 
int lpKernelLength_ = 0
 
int lpPartition_ = 0
 
int lpPartitions_ = 0
 
int lpChannels_ = 0
 
std::array< std::vector< T >, 2 > lpKernelSet_
 Partition spectra, active + incoming.
 
int lpActive_ = 0
 
std::vector< T > lpFdl_
 Per channel: partitions x spectrum.
 
std::vector< T > lpInput_
 
std::vector< T > lpOutput_
 Per channel FIFOs.
 
std::vector< T > lpAccum_
 
std::vector< T > lpBlockTime_
 
std::vector< T > lpBlockTimeOld_
 
std::vector< T > lpWarm_
 The held input the bands are run over on leaving the mode.
 
std::vector< T * > lpWarmChannels_
 
int lpFifoPos_ = 0
 
int lpFdlPos_ = 0
 
bool lpSnap_ = true
 
bool lpWasActive_ = false
 
LpStage lpStage_ = LpStage::Idle
 
int lpStep_ = 0
 
bool lpRestartPending_ = false
 
bool lpSwapPending_ = false
 
int lpDesignBands_ = 0
 
int lpDesignStages_ = 0
 Sections of the bands whose curve this design computes.
 
int lpDesignLive_ = 0
 Bands that act in this design.
 
std::vector< float > lpBandPower_
 Per band: its squared magnitude on the design grid.
 
std::array< bool, MaxBands > lpBandKept_ {}
 The band's curve is that of its stored design.
 
std::array< bool, MaxBands > lpBandDirty_ {}
 This design computes the band's curve.
 
std::array< bool, MaxBands > lpBandLive_ {}
 The band acts in this design.
 
std::array< BiquadCoeffs, MaxBands *5 > lpStages_ {}
 
std::array< int, MaxBands > lpStageCount_ {}
 
std::array< AnalogSection, MaxBands *AnalogCascade::kMaxSections > lpAnalog_ {}
 Prototypes of the analog bands.
 
std::array< int, MaxBands > lpAnalogCount_ {}
 
std::array< int, MaxBands > lpBandGroup_ {}
 Where each band of the design acts (0 when it acts on every channel).
 
int lpSlots_ = 1
 Kernels a set holds: 1, or the matrix of a pair (and one more for further channels).
 
int lpSlot_ = 0
 Kernel of the design being transformed.
 
bool lpDesignPlaced_ = false
 The design in flight is a matrix.
 
std::array< bool, 2 > lpPlaced_ {}
 Whether each kernel set is one.
 
std::vector< T > lpWindow_
 
std::vector< T > lpMag_
 
std::vector< T > lpDesignSpec_
 
std::vector< T > lpDesignTime_
 
std::vector< T > lpKernelTime_
 

Static Protected Attributes

static constexpr int kMaxBandSections = AnalogCascade::kMaxSections
 Most sections a band has.
 
static constexpr int kEngineChannels = 16
 Channels the band engines hold.
 
static constexpr double kRampSlowMs = 40.0
 Glide of a small move of a band of the analog response.
 
static constexpr double kRampFastMs = 10.0
 Glide of a jump.
 
static constexpr int kMaxStretches = 32
 Most designs a glide goes through.
 
static constexpr int kStretchSamples = 16
 Shortest stretch between two of them.
 
static constexpr double kRestDb = 0.05
 A gain band closer to 0 dB than this leaves the path.
 
static constexpr double kTiltCeilingDb = 36.0
 Most a constant tilt lifts its rising end (20 Hz or 20 kHz).
 
static constexpr double kBandFadeSeconds = 0.02
 
static constexpr int kPrototypeTaps = 64
 Length of the correction.
 
static constexpr int kPrototypeDelay = kPrototypeTaps / 2
 Its centre: the latency of the mode.
 
static constexpr int kPrototypeBins = 128
 The correction is designed on 129 frequencies up to Nyquist.
 
static constexpr int kPrototypeSlots = 5
 Left to left, right to right, right to left, left to right, further channels.
 
static constexpr int kPrototypeGroups = 5
 One per Scope.
 
static constexpr int kPrototypeGrid = 32
 Samples between two steps of a fade of the correction.
 
static constexpr double kPrototypeFadeSeconds = 0.02
 
static constexpr double kPrototypeReach = 1.3815510557964274
 Most the correction changes a level: 12 dB, in nepers.
 
static constexpr int kLpMinKernel = 256
 
static constexpr int kLpMaxKernel = 1 << 18
 
static constexpr int kLpPartitionCount = 16
 Partitions per kernel.
 
static constexpr int kLpMinPartition = 64
 
static constexpr int kLpBinBudget = 131072
 Stage evaluations per hop (< 1 ms).
 
static constexpr int kLpProductBudget = 1048576
 Products of kept curves per hop (< 1 ms).
 
static constexpr int kLpPartitionSlices = 1
 Hops spent on partition FFTs.
 
static constexpr int kLpSyncSteps = 16
 Bound of a synchronous design.
 

Detailed Description

template<FloatType T, int MaxBands = 16>
class dspark::Equalizer< T, MaxBands >

Parametric multi-band EQ using cascaded biquads or FFT overlap-save convolution.

Template Parameters
TSample type (float or double).
MaxBandsMaximum number of EQ bands (compile-time, default 16).

Definition at line 144 of file Equalizer.h.

Member Typedef Documentation

◆ Structure

template<FloatType T, int MaxBands = 16>
using dspark::Equalizer< T, MaxBands >::Structure = typename FilterEngine<T>::Structure

How the sections of the bands are realised (FilterEngine::Structure).

Definition at line 679 of file Equalizer.h.

Member Enumeration Documentation

◆ BandType

template<FloatType T, int MaxBands = 16>
enum class dspark::Equalizer::BandType
strong

Filter type for each EQ band.

Enumerator
Peak 

Parametric bell (boost/cut around frequency).

LowShelf 

Shelf: boosts/cuts below frequency.

HighShelf 

Shelf: boosts/cuts above frequency.

LowPass 

Removes frequencies above cutoff.

HighPass 

Removes frequencies below cutoff.

Notch 

Narrow rejection at frequency.

BandPass 

Bandpass around frequency.

Tilt 

Tilt EQ: pivots spectrum around frequency.

AllPass 

Turns the phase around frequency, 180 degrees per order; the level stays.

ConstantTilt 

The same slope across the whole band: gain is in dB per octave (-6 to +6), 0 dB at frequency. The end that rises (20 kHz, or 20 Hz for a negative slope) is held to 36 dB: with the pivot far from the middle of the band the slope is taken down just enough for that end to stop there.

LowPassWall 

Elliptic cut above frequency: flat to it, 100 dB down a quarter of an octave later.

HighPassWall 

Elliptic cut below frequency.

Definition at line 159 of file Equalizer.h.

◆ DesignPace

template<FloatType T, int MaxBands = 16>
enum class dspark::Equalizer::DesignPace
strongprotected

How much of a design one advanceDesign() call may do.

Enumerator
Sliced 

Audio thread, one bounded slice per partition hop.

Immediate 

Audio thread, whole stages at once (bounded seqlock reads).

Setup 

Setup thread, whole stages, unbounded seqlock reads.

Definition at line 2170 of file Equalizer.h.

◆ FilterMode

template<FloatType T, int MaxBands = 16>
enum class dspark::Equalizer::FilterMode
strong

Filter processing mode.

Enumerator
MinimumPhase 

IIR biquads (zero latency, minimum phase shift). Default.

LinearPhase 

Partitioned FFT convolution (fixed latency, see getLatency()).

PrototypePhase 

The bands from their analog prototypes plus a short correction: the phase of the analog curve, 32 samples late.

Definition at line 148 of file Equalizer.h.

◆ LpStage

template<FloatType T, int MaxBands = 16>
enum class dspark::Equalizer::LpStage
strongprotected
Enumerator
Idle 
Snapshot 
Magnitude 
Combine 
Transform 
Partition 

Definition at line 2158 of file Equalizer.h.

◆ Scope

template<FloatType T, int MaxBands = 16>
enum class dspark::Equalizer::Scope
strong

Where in a stereo pair a band acts.

Enumerator
Stereo 

Every channel. Default.

Left 

The first channel only.

Right 

The second channel only.

Mid 

The middle of the first two channels: what they share.

Side 

Their sides: what sets them apart.

Definition at line 178 of file Equalizer.h.

Constructor & Destructor Documentation

◆ ~Equalizer()

template<FloatType T, int MaxBands = 16>
dspark::Equalizer< T, MaxBands >::~Equalizer ( )
default

Non-virtual destructor to prevent vtable instantiation (zero virtual dispatch).

Member Function Documentation

◆ advanceDesign()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::advanceDesign ( DesignPace  pace)
inlineprotectednoexcept

Runs one bounded slice of a kernel design into the inactive set.

Snapshot: pulls every band through its bounded seqlock read (a give-up retries on the next hop) and designs it; a band whose design is the one its kept curve was made from needs nothing more. Magnitude: evaluates the curves of the other bands on at most kLpBinBudget stage-bins of the design grid. Combine: the product of the curves of the bands that act, at most kLpProductBudget of them per hop (in the Magnitude's hop when both fit). Transform: one inverse FFT, the shift to the kernel centre and the window. Partition: forward FFTs of 1/kLpPartitionSlices of the partitions. The finished set is swapped in by the caller (crossfaded during processing).

Definition at line 2217 of file Equalizer.h.

◆ advanceGlide()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::advanceGlide ( AnalogBand &  band,
int  samples 
)
inlineprotectednoexcept

Counts the samples a gliding band has played and starts its next stretch when one ends.

Definition at line 1667 of file Equalizer.h.

◆ applyCompensation()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::applyCompensation ( AudioBufferView< T > &  buffer)
inlineprotectednoexcept

The compensation's gain on a block (nothing at rest at unity).

Definition at line 1168 of file Equalizer.h.

◆ bandPrototype()

template<FloatType T, int MaxBands = 16>
AnalogCascade dspark::Equalizer< T, MaxBands >::bandPrototype ( const BandConfig &  cfg) const
inlineprotectednoexcept

The analog prototype of a band.

Definition at line 1427 of file Equalizer.h.

◆ between()

template<FloatType T, int MaxBands = 16>
static BandConfig dspark::Equalizer< T, MaxBands >::between ( const BandConfig &  from,
const BandConfig &  to,
double  share 
)
inlinestaticprotectednoexcept

The configuration a share of the way between two: frequency and Q in octaves, gain in decibels.

Definition at line 1631 of file Equalizer.h.

◆ buildBandSections()

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::buildBandSections ( const BandConfig &  cfg,
BiquadCoeffs *  sections,
int  capacity 
) const
inlinenoexcept

Fills sections with the biquads a band runs, whichever engine runs it, and returns how many (up to 16).

The analysis API for user interfaces: with the analog response a band can have more sections than buildBandStages() has room for. Requires prepare().

Parameters
cfgBand configuration.
sectionsReceives the sections.
capacityRoom in sections (16 holds any band).
Returns
Number of sections written.

Definition at line 1370 of file Equalizer.h.

◆ buildBandStages()

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::buildBandStages ( const BandConfig &  cfg,
BiquadCoeffs *  stages 
) const
inlinenoexcept

Fills stages with the ACTUAL biquad cascade for a band (per-stage Butterworth Q for multi-stage LP/HP, single biquad otherwise) and returns the stage count. Public analysis API: UIs use it to draw a magnitude response that matches what the IIR FilterEngine really applies, including the user's resonance on LP/HP cascades, soft mode's Q cap and the matched-bell design. Mirrors the engine's own parameter sanitization (frequency and Q floors). Requires prepare().

Parameters
cfgBand configuration to translate into processing stages.
stagesOutput buffer (capacity >= 5).

Definition at line 1319 of file Equalizer.h.

◆ clearLinearPhaseStream()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::clearLinearPhaseStream ( )
inlineprotectednoexcept

Clears the engine's audio history (not the kernels).

Definition at line 2194 of file Equalizer.h.

◆ clearPrototypeStream()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::clearPrototypeStream ( )
inlineprotectednoexcept

Clears what the correction remembers of the signal.

Definition at line 2087 of file Equalizer.h.

◆ computeBandCoeffs()

template<FloatType T, int MaxBands = 16>
BiquadCoeffs dspark::Equalizer< T, MaxBands >::computeBandCoeffs ( const BandConfig &  cfg) const
inlineprotectednoexcept

Computes single-biquad coefficients for a band (analysis/kernel).

Parameters
cfgBand configuration (its q must already be the effective one).
Returns
BiquadCoeffs structure.

Definition at line 1269 of file Equalizer.h.

◆ conditionBandsAfterLinearPhase()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::conditionBandsAfterLinearPhase ( )
inlineprotectednoexcept

Leaving LinearPhase: clears the bands and runs them over the input the engine still holds (the last whole partition and what there is of the current one), in order, so they resume from the memory of what came just before and not from that of the stretch of audio they last played.

Definition at line 2507 of file Equalizer.h.

◆ designAnalogBand()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::designAnalogBand ( int  index,
const BandConfig &  cfg,
bool  snap 
)
inlineprotectednoexcept

Designs a band of the analog response and starts its cascade towards the design (audio thread, or prepare()).

Sections the design adds come in transparent, with their poles, and open; sections it drops close and leave when the glide lands; a band that was resting comes back from the history of its input.

Parameters
indexBand index.
cfgIts configuration.
snapTrue to land at once (prepare(), or a band with no design yet).

Definition at line 1545 of file Equalizer.h.

◆ designPrototype()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::designPrototype ( bool  snap)
inlineprotectednoexcept

Designs the correction filters from the curves of the bands and fades to them.

Definition at line 1978 of file Equalizer.h.

◆ designSections()

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::designSections ( const BandConfig &  cfg,
BiquadCoeffs *  sections,
int  capacity 
) const
inlineprotectednoexcept

The biquads of a band of the analog response.

Every type follows its prototype (FilterDesign::digital()) except the walls: an elliptic cut through the bilinear transform, with its corner held in place, is an elliptic filter again, with its ripple and its floor exact, and only the wall a little steeper.

Definition at line 1484 of file Equalizer.h.

◆ effectiveQ()

template<FloatType T, int MaxBands = 16>
T dspark::Equalizer< T, MaxBands >::effectiveQ ( const BandConfig &  cfg) const
inlineprotectednoexcept

The band Q the audio path actually uses (soft mode caps it by gain).

Definition at line 1105 of file Equalizer.h.

◆ finishDesignNow()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::finishDesignNow ( )
inlineprotectednoexcept

Completes a pending design now and adopts it without a crossfade (first block after prepare/reset/mode entry).

Definition at line 2531 of file Equalizer.h.

◆ getAnalogBandResponse()

template<FloatType T, int MaxBands = 16>
T dspark::Equalizer< T, MaxBands >::getAnalogBandResponse ( int  index,
T  hz 
) const
inlinenoexcept

The response of a band of the analog response as its sections are at this moment, a glide in flight included, in decibels (0 for a band that rests, is off, or that the other engine runs).

Audio thread, or with no block in flight: it reads the band's coefficients as they are. For the curve asked for, from any thread, see getMagnitudeForFrequencyArray().

Parameters
indexBand index.
hzFrequency in hertz.

Definition at line 870 of file Equalizer.h.

◆ getBandConfig()

template<FloatType T, int MaxBands = 16>
BandConfig dspark::Equalizer< T, MaxBands >::getBandConfig ( int  index) const
inlinenoexcept

Returns the current configuration of a band.

Safe from any thread: the band is read through its seqlock into a private copy, so a configuration being published concurrently is either fully seen or fully missed, never mixed with the previous one.

Parameters
indexBand index.
Returns
Copy of the band's BandConfig.

Definition at line 782 of file Equalizer.h.

◆ getBandFilter() [1/2]

template<FloatType T, int MaxBands = 16>
const FilterEngine< T > & dspark::Equalizer< T, MaxBands >::getBandFilter ( int  index) const
inlinenoexcept

Const overload. Same clamping contract.

Definition at line 1004 of file Equalizer.h.

◆ getBandFilter() [2/2]

template<FloatType T, int MaxBands = 16>
FilterEngine< T > & dspark::Equalizer< T, MaxBands >::getBandFilter ( int  index)
inlinenoexcept

Direct access to a band's underlying FilterEngine.

The index is clamped, so an out-of-range one returns band 0 or the last band instead of binding a reference past the end of the band array. A debug build asserts first: clamping keeps a release build defined, it does not make a wrong index mean anything.

Parameters
indexBand index. Clamped, not validated – see the note above.
Returns
Reference to the FilterEngine for this band.

Definition at line 997 of file Equalizer.h.

◆ getCompensationDb()

template<FloatType T, int MaxBands = 16>
T dspark::Equalizer< T, MaxBands >::getCompensationDb ( ) const
inlinenoexcept
Returns
The gain the compensation is heading for, in dB (0 when off).

Definition at line 652 of file Equalizer.h.

◆ getFilterMode()

template<FloatType T, int MaxBands = 16>
FilterMode dspark::Equalizer< T, MaxBands >::getFilterMode ( ) const
inlinenoexcept

Returns the current filter mode.

Definition at line 836 of file Equalizer.h.

◆ getLatency()

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::getLatency ( ) const
inlinenoexcept

Returns the latency in samples.

0 for MinimumPhase; 32 for PrototypePhase at any rate; kernel/2 + kernel/16 for LinearPhase (the zero-phase kernel's centre plus one partition of buffering: 18432 samples at the default 48 kHz kernel), independent of the host block size. Reports 0 when the engine of the mode is unavailable (not prepared yet), so the value always matches the path that actually runs.

Definition at line 851 of file Equalizer.h.

◆ getLinearPhaseKernelLength()

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::getLinearPhaseKernelLength ( ) const
inlinenoexcept

The prepared linear-phase kernel length in taps (0 before prepare()). Read it from the setup thread or once prepared.

Definition at line 908 of file Equalizer.h.

◆ getLoudnessCompensation()

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::getLoudnessCompensation ( ) const
inlinenoexcept
Returns
Whether the loudness is kept.

Definition at line 649 of file Equalizer.h.

◆ getMagnitudeForFrequencyArray() [1/2]

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::getMagnitudeForFrequencyArray ( const T *  frequencies,
T *  magnitudes,
int  numPoints 
) const
inlinenoexcept

Computes the combined magnitude response of all enabled bands.

Evaluates the same per-stage cascade the audio path applies (including soft mode's Q cap and the matched-bell design), so the drawn curve matches what is heard in both filter modes (in LinearPhase within the resolution of the kernel length).

Parameters
frequenciesArray of frequencies in Hz.
magnitudesOutput array (same size, linear scale).
numPointsNumber of frequency points.

Definition at line 938 of file Equalizer.h.

◆ getMagnitudeForFrequencyArray() [2/2]

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::getMagnitudeForFrequencyArray ( const T *  frequencies,
T *  magnitudes,
int  numPoints,
Scope  where 
) const
inlinenoexcept

The magnitude response at one place of the stereo pair: the stereo bands and the bands placed there.

Parameters
frequenciesArray of frequencies in Hz.
magnitudesOutput array (same size, linear scale).
numPointsNumber of frequency points.
whereLeft, Right, Mid or Side (Stereo gives the stereo bands alone).

Definition at line 952 of file Equalizer.h.

◆ getNumBands()

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::getNumBands ( ) const
inlinenoexcept

Returns the number of active bands.

Definition at line 630 of file Equalizer.h.

◆ getSoftMode()

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::getSoftMode ( ) const
inlinenoexcept

Returns whether soft mode is enabled.

Definition at line 921 of file Equalizer.h.

◆ getState()

template<FloatType T, int MaxBands = 16>
std::vector< uint8_t > dspark::Equalizer< T, MaxBands >::getState ( ) const
inline

Serializes bands and modes (setup/UI threads; allocates).

Definition at line 1012 of file Equalizer.h.

◆ getStructure()

template<FloatType T, int MaxBands = 16>
Structure dspark::Equalizer< T, MaxBands >::getStructure ( ) const
inlinenoexcept
Returns
How the bands' sections are realised.

Definition at line 701 of file Equalizer.h.

◆ glideStretches()

template<FloatType T, int MaxBands = 16>
static int dspark::Equalizer< T, MaxBands >::glideStretches ( const BandConfig &  from,
const BandConfig &  to,
int  ramp 
)
inlinestaticprotectednoexcept

In how many designs a band goes from one configuration to another: one for every quarter of an octave of frequency, every 12 dB of gain and every octave of Q (linear interpolation of the coefficients between two designs that close stays within half a decibel of the band of the parameters in between), with no stretch shorter than kStretchSamples. 1: straight there.

Definition at line 1610 of file Equalizer.h.

◆ isAnalogResponse()

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::isAnalogResponse ( ) const
inlinenoexcept

Returns whether bands are designed from their analog prototypes (setAnalogResponse()).

Definition at line 767 of file Equalizer.h.

◆ isMatchedBells()

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::isMatchedBells ( ) const
inlinenoexcept

Returns whether Peak bands use the matched design (setMatchedBells()).

Definition at line 673 of file Equalizer.h.

◆ isMatchedFilters()

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::isMatchedFilters ( ) const
inlinenoexcept

Returns whether non-bell bands use the matched designs (setMatchedFilters()).

Definition at line 722 of file Equalizer.h.

◆ isResonantShelves()

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::isResonantShelves ( ) const
inlinenoexcept

Returns whether the Q of a shelf can go above 0.7071 (setResonantShelves()).

Definition at line 761 of file Equalizer.h.

◆ legacySlope()

template<FloatType T, int MaxBands = 16>
static int dspark::Equalizer< T, MaxBands >::legacySlope ( const BandConfig &  cfg)
inlinestaticprotectednoexcept

The slope the cookbook engine runs: 6 to 48 dB per octave, whole.

Definition at line 1409 of file Equalizer.h.

◆ magnitudeOfBands()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::magnitudeOfBands ( const T *  frequencies,
T *  magnitudes,
int  numPoints,
int  where 
) const
inlineprotectednoexcept

The product of the enabled bands: all of them (where < 0), or the stereo ones and those placed at where.

Definition at line 959 of file Equalizer.h.

◆ moveTowards()

template<FloatType T, int MaxBands = 16>
static T dspark::Equalizer< T, MaxBands >::moveTowards ( T  from,
T  to,
T  delta 
)
inlinestaticprotectednoexcept

Definition at line 1726 of file Equalizer.h.

◆ nextStretch()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::nextStretch ( AnalogBand &  band)
inlineprotectednoexcept

Starts the next stretch of a glide: designs where it ends and sends the coefficients there.

Definition at line 1643 of file Equalizer.h.

◆ prepare()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::prepare ( const AudioSpec &  spec)
inline

Prepares all bands and allocates necessary resources for processing.

Must be called from the host's prepareToPlay/setup method. Performs all memory allocations, including the linear-phase engine, so setFilterMode(LinearPhase) works even when called after prepare(). An invalid spec (non-positive or non-finite fields) is a no-op that keeps the previous state.

Parameters
specAudio environment (sample rate, max block size, channels).

Definition at line 219 of file Equalizer.h.

◆ processBandSlice()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::processBandSlice ( int  i,
AudioBufferView< T >  view,
int  n,
int  activeBands 
)
inlineprotectednoexcept

One band over one slice, on the channels of its scope, with its on/off fade. For a band of the middle or the sides the view is already in that form.

Definition at line 1779 of file Equalizer.h.

◆ processBlock()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::processBlock ( AudioBufferView< T >  buffer)
inlinenoexcept

Processes an audio buffer in-place.

Guarantees zero allocations. Checks atomic flags lock-free to update DSP state if the host changed parameters. In LinearPhase mode a pending band change is designed on this thread in bounded slices and crossfaded in (see the file comment); any block length works and the output does not depend on how the host splits the stream. Switching modes changes getLatency(), so notify the host and consider reset() to clear the other path's tail.

Parameters
bufferAudio data to process.

Definition at line 375 of file Equalizer.h.

◆ processLinearPhase()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::processLinearPhase ( AudioBufferView< T >  buffer)
inlineprotectednoexcept

LinearPhase processing: any block length streams through a partition-sized FIFO, so the output is identical whatever the host's block partition. Channels beyond the prepared count pass through unprocessed (not delayed).

Definition at line 2641 of file Equalizer.h.

◆ processMinimumPhase()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::processMinimumPhase ( AudioBufferView< T >  buffer)
inlineprotectednoexcept

MinimumPhase processing, with each band's on/off state crossfaded over kBandFadeSeconds.

A settled enabled band runs exactly as before (no extra work); a band fading in or out processes a copy and blends it with the dry block. A band fading in restarts from cleared filter state, settled on its current parameters. Blocks longer than the prepared maximum run in prepared-size slices so the dry scratch always holds them.

Definition at line 1741 of file Equalizer.h.

◆ processPrototype()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::processPrototype ( AudioBufferView< T >  buffer)
inlineprotectednoexcept

The correction over one block: every channel through its filter, and with placed bands the other channel of the pair through the one that crosses.

Definition at line 2099 of file Equalizer.h.

◆ processSample()

template<FloatType T, int MaxBands = 16>
T dspark::Equalizer< T, MaxBands >::processSample ( T  input,
int  channel 
)
inlinenoexcept

Processes a single sample through all enabled bands (IIR mode only).

Pending band changes are consumed here too (applied immediately, without the block path's parameter smoothing), so per-sample streams that never call processBlock() still pick up setBand() and friends.

A band placed on the left or the right acts on channel 0 or 1 alone. The bands of the middle and the sides need both channels of a frame and only run in processBlock(), and so does the correction of the PrototypePhase mode: here that mode is its bands alone, with no latency.

Parameters
inputInput sample.
channelChannel index (out-of-range channels pass through).
Returns
EQ'd output sample.

Definition at line 454 of file Equalizer.h.

◆ prototypeBandCurves()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::prototypeBandCurves ( int  index)
inlineprotectednoexcept

The analog response of a band over its digital one, on the grid.

Section by section: the level in nepers and the phase in radians of Ha(jw) / Hd(e^jw). Summing the phases of the sections keeps the total unwrapped, since each of them is small.

Definition at line 1890 of file Equalizer.h.

◆ prototypeCovers()

template<FloatType T, int MaxBands = 16>
static bool dspark::Equalizer< T, MaxBands >::prototypeCovers ( const BandConfig &  cfg)
inlinestaticprotectednoexcept

Whether a band is one the correction covers: an elliptic wall is not (its digital form is itself).

Definition at line 1878 of file Equalizer.h.

◆ rampSamples()

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::rampSamples ( const BandConfig &  from,
const BandConfig &  to 
) const
inlineprotectednoexcept

How long the coefficients of a band take to reach a new design: long for a small move, short for a jump.

Definition at line 1515 of file Equalizer.h.

◆ refreshCompensation()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::refreshCompensation ( )
inlineprotectednoexcept

Translates BandConfigs into internal FilterEngine parameters safely.

Audio thread; called by processBlock()/processSample() when configDirty_ is true. Each band is pulled through its seqlock into a plain local, so the filter is configured from ONE publication. Reading the band by reference instead would let a concurrent setBand() land between two field reads and configure a filter with a frequency from one call and a slope from the next. That is not a theoretical hazard: before this was a seqlock, roughly one adoption in thirty was such a mixture.

The pull is bounded (tryRead): a band whose read gives up is left with the coefficients it already has, and configDirty_ is re-armed so the whole set is retried on a later call. Reconfiguring a band from its published config is idempotent, so retrying all of them costs nothing but the work.

The compensation's target: on a log grid (where pink noise has the same power in every point), the K-weighted mean of the bands' squared magnitude over that of the weighting alone.

Definition at line 1138 of file Equalizer.h.

◆ refreshPrototype()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::refreshPrototype ( bool  snap)
inlineprotectednoexcept

Brings the correction up to date with the bands as they are now, and starts its fade if anything changed.

Cheap when nothing did (one comparison per band), so it runs on every block of the mode.

Parameters
snapTrue to land on the new correction at once (entering the mode).

Definition at line 1938 of file Equalizer.h.

◆ reset()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::reset ( )
inlinenoexcept

Resets all filter states to zero to prevent ringing on playback start.

Definition at line 508 of file Equalizer.h.

◆ resetBand()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::resetBand ( int  index)
inlineprotectednoexcept

Definition at line 1716 of file Equalizer.h.

◆ resolveKernelLength()

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::resolveKernelLength ( double  sampleRate) const
inlineprotectednoexcept

Kernel length for a sample rate (see setLinearPhaseKernelLength()).

Definition at line 2178 of file Equalizer.h.

◆ restsAtUnity()

template<FloatType T, int MaxBands = 16>
static bool dspark::Equalizer< T, MaxBands >::restsAtUnity ( const BandConfig &  cfg)
inlinestaticprotectednoexcept

Whether a band does nothing as configured: a gain band within kRestDb of 0 dB.

Definition at line 1497 of file Equalizer.h.

◆ runBand()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::runBand ( int  index,
AudioBufferView< T >  view 
)
inlineprotectednoexcept

One block through a band, in the engine that runs it.

Definition at line 1695 of file Equalizer.h.

◆ runLinearPhaseHop()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::runLinearPhaseHop ( )
inlineprotectednoexcept

One partition hop: schedule the design, then convolve every prepared channel (uniformly partitioned overlap-save).

Definition at line 2551 of file Equalizer.h.

◆ sameDesign()

template<FloatType T, int MaxBands = 16>
static bool dspark::Equalizer< T, MaxBands >::sameDesign ( const BandConfig &  a,
const BandConfig &  b 
)
inlinestaticprotectednoexcept

Whether two configurations give the same sections (the enabled flag is not part of the design).

Definition at line 1675 of file Equalizer.h.

◆ setAnalogResponse()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setAnalogResponse ( bool  enabled)
inlinenoexcept

Designs every band from its analog prototype (see the file notes).

Off by default. With it on, the curve of each band stays on its analog shape up to Nyquist in every type (FilterDesign), a parameter change ramps the coefficients of the band instead of stepping them, and the slope of a cut is any value from 0 to 96 dB per octave. Applies to the minimum-phase engine, the linear-phase kernel and the analysis curve. A band switching engine fades in over 20 ms.

Definition at line 737 of file Equalizer.h.

◆ setBand() [1/3]

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setBand ( int  index,
const BandConfig &  config 
)
inline

Configures a band with full control over all parameters. Thread-safe.

Non-finite frequency/gain/Q/slope fields and a type that is not one fall back to the band's current values (they would otherwise poison the serialized state, the analysis curve, and the linear-phase kernel); a slope or an order out of range clamps.

Parameters
indexBand index.
configComplete band configuration.

Definition at line 566 of file Equalizer.h.

◆ setBand() [2/3]

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setBand ( int  index,
T  frequency,
T  gainDb 
)
inline

Configures a band with frequency and gain (Peak filter).

Parameters
indexBand index (0 to MaxBands-1).
frequencyCenter frequency in Hz.
gainDbBoost/cut in dB.

Definition at line 531 of file Equalizer.h.

◆ setBand() [3/3]

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setBand ( int  index,
T  frequency,
T  gainDb,
T  q 
)
inline

Configures a band with frequency, gain, and Q.

Parameters
indexBand index.
frequencyCenter frequency in Hz.
gainDbBoost/cut in dB.
qQuality factor.

Definition at line 543 of file Equalizer.h.

◆ setBandEnabled()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setBandEnabled ( int  index,
bool  enabled 
)
inlinenoexcept

Enables or disables a band without changing its parameters.

Parameters
indexBand index.
enabledTrue to enable, false to bypass.

Definition at line 793 of file Equalizer.h.

◆ setFilterMode()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setFilterMode ( FilterMode  mode)
inlinenoexcept

Sets the filter processing mode (minimum, linear or prototype phase).

Works before or after prepare() (the linear-phase and prototype-phase engines are always pre-allocated by prepare()). Wild enum values clamp. Switching modes changes getLatency(): hosts must be notified. The first LinearPhase block after a switch completes any pending kernel design at once; going in or out of PrototypePhase, the bands that change engine come in through the 20 ms band fade. Leaving LinearPhase, the bands (which have not run since the mode was entered) are cleared and run over the input the linear-phase engine still holds, one to two partitions of it (43 to 85 ms with the default kernel): the first block starts from bands that have heard what came just before it, at the one-off cost of that many samples.

Parameters
modeFilter mode.

Definition at line 821 of file Equalizer.h.

◆ setLinearPhaseKernelLength()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setLinearPhaseKernelLength ( int  taps)
inlinenoexcept

Requests the linear-phase kernel length in taps.

Applied at the next prepare() (it sizes the engine). 0 or a negative value selects the automatic length: 32768 taps at 44.1/48 kHz, scaled with the sample rate to the nearest power of two (65536 at 96 kHz). Explicit lengths clamp to [256, 262144] and round up to a power of two. Longer kernels resolve lower frequencies and cost latency (kernel/2 + kernel/16) and memory; CPU per sample barely changes.

Definition at line 900 of file Equalizer.h.

◆ setLoudnessCompensation()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setLoudnessCompensation ( bool  on)
inlinenoexcept

Keeps the loudness (off by default): the bands' change of the K-weighted level of pink noise (as BS.1770 hears it) is taken back by a gain, which moves in 50 ms when the bands change. With bands on the middle, the sides or one channel it reads every band together. processSample() applies it at once.

Definition at line 642 of file Equalizer.h.

◆ setMatchedBells()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setMatchedBells ( bool  enabled)
inlinenoexcept

Switches Peak bands to the analog-matched (de-cramped) design.

Bilinear bells cramp near Nyquist (narrower, response pinned at fs/2); the matched design (BiquadCoeffs::makePeakMatched, impulse-invariant poles with a magnitude-matched numerator) keeps high bells on their analog shape, the state-of-the-art digital EQ behaviour. Applies to the IIR engines, the linear-phase kernel, and the analysis curve alike. On by default (worst audible-band deviation from the analog bell at 48 kHz: 2.9 dB matched vs 11 dB bilinear); set false for the classic bilinear (cookbook) bells.

Definition at line 666 of file Equalizer.h.

◆ setMatchedFilters()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setMatchedFilters ( bool  enabled)
inlinenoexcept

Switches LowPass/HighPass, BandPass and slope-1 shelf bands to the analog-matched designs.

The counterpart of setMatchedBells() for the other band types (BiquadCoeffs::make*Matched, after Vicanek): near Nyquist they keep the analog prototype's shape (48 kHz worst deviation, 20 Hz - 20 kHz: LP at 15 kHz 0.58 dB vs 9.4 dB bilinear, shelves 0.40 dB vs 3.9 dB). LP/HP first-order sections, shelves whose Q maps to a slope below 1, Notch and Tilt stay bilinear. Applies to the IIR engines, the linear-phase kernel and the analysis curve alike. Off by default (bit-compatible).

Definition at line 715 of file Equalizer.h.

◆ setNumBands()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setNumBands ( int  count)
inline

Sets the number of active bands with auto-logarithmic spacing.

Parameters
countNumber of bands (1 to MaxBands).

Definition at line 602 of file Equalizer.h.

◆ setResonantShelves()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setResonantShelves ( bool  enabled)
inlinenoexcept

Lets the Q of a shelf go above 0.7071 (off by default, where a Q above it is read as 0.7071).

With it on, a shelf whose Q is above 0.7071 rises over its plateau before the corner and dips under 0 dB after it, more the higher the Q (the plateau, the half gain at the corner and the inverse cut stay as they are); in a shelf of a higher order the Q acts on its sharpest pair. Such a band runs with the analog response. The Q of a Tilt of order 2 follows the same rule.

Definition at line 754 of file Equalizer.h.

◆ setSoftMode()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setSoftMode ( bool  enabled)
inlinenoexcept

Enables soft mode (anti-ringing Q reduction dynamically based on gain).

Parameters
enabledTrue to enable soft mode.

Definition at line 914 of file Equalizer.h.

◆ setState()

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::setState ( const uint8_t *  data,
size_t  size 
)
inline

Restores bands and modes from a blob (tolerant; rejects foreign ids).

Definition at line 1054 of file Equalizer.h.

◆ setStructure()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::setStructure ( Structure  structure)
inlinenoexcept

Chooses how the bands' sections are realised in minimum phase.

Ladder runs them as normalized ladders (FilterEngine::setStructure()): the same response, a memory that cannot gain energy while a band is automated, for about twice the arithmetic. It applies to the bands of the default minimum-phase engine (not to the analog response, the prototype phase or the linear phase, whose filters do not move that way). Thread-safe; the switch restarts the bands' memory.

Parameters
structureDirectForm (default) or Ladder.

Definition at line 693 of file Equalizer.h.

◆ settleAnalogBand()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::settleAnalogBand ( AnalogBand &  band)
inlineprotectednoexcept

Once a glide has landed: dropped sections leave, and a resting band stops computing.

Definition at line 1682 of file Equalizer.h.

◆ shelfSlopeFromQ()

template<FloatType T, int MaxBands = 16>
static double dspark::Equalizer< T, MaxBands >::shelfSlopeFromQ ( double  q,
double  gainDb 
)
inlinestaticprotectednoexcept

Converts a user-facing shelf Q into the RBJ shelf slope S.

RBJ relation: 1/Q^2 = (A + 1/A) * (1/S - 1) + 2 with A = 10^(dB/40). Q = 0.7071 maps to S = 1 (the standard shelf). Out-of-domain values are clamped to the stable (0, 1] range that the coefficient factory accepts.

Definition at line 1254 of file Equalizer.h.

◆ updateActiveFilters()

template<FloatType T, int MaxBands = 16>
void dspark::Equalizer< T, MaxBands >::updateActiveFilters ( )
inlineprotectednoexcept

Definition at line 1181 of file Equalizer.h.

◆ usesAnalog()

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::usesAnalog ( const BandConfig &  cfg) const
inlineprotectednoexcept

Whether a band runs with the analog response (the switch, or a band only it can make).

Definition at line 1415 of file Equalizer.h.

Member Data Documentation

◆ analog_

template<FloatType T, int MaxBands = 16>
std::unique_ptr<std::array<AnalogBand, MaxBands> > dspark::Equalizer< T, MaxBands >::analog_
protected

Definition at line 2863 of file Equalizer.h.

◆ analogResponse_

template<FloatType T, int MaxBands = 16>
std::atomic<bool> dspark::Equalizer< T, MaxBands >::analogResponse_ { false }
protected

Every band from its analog prototype: opt-in.

Definition at line 2859 of file Equalizer.h.

◆ bandAnalog_

template<FloatType T, int MaxBands = 16>
std::array<bool, MaxBands> dspark::Equalizer< T, MaxBands >::bandAnalog_ {}
protected

Which engine runs each band.

Definition at line 2867 of file Equalizer.h.

◆ bandDry_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::bandDry_
protected

Definition at line 2877 of file Equalizer.h.

◆ bandDryChannels_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::bandDryChannels_ = 0
protected

Definition at line 2878 of file Equalizer.h.

◆ bandDryStride_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::bandDryStride_ = 0
protected

Definition at line 2879 of file Equalizer.h.

◆ bandEnabled_

template<FloatType T, int MaxBands = 16>
std::array<std::atomic<bool>, MaxBands> dspark::Equalizer< T, MaxBands >::bandEnabled_ {}
protected

Definition at line 2847 of file Equalizer.h.

◆ bandFadeStep_

template<FloatType T, int MaxBands = 16>
T dspark::Equalizer< T, MaxBands >::bandFadeStep_ = T(1)
protected

Definition at line 2880 of file Equalizer.h.

◆ bandMix_

template<FloatType T, int MaxBands = 16>
std::array<T, MaxBands> dspark::Equalizer< T, MaxBands >::bandMix_ {}
protected

Definition at line 2876 of file Equalizer.h.

◆ bands_

template<FloatType T, int MaxBands = 16>
std::array<FilterEngine<T>, MaxBands> dspark::Equalizer< T, MaxBands >::bands_ {}
protected

Definition at line 2686 of file Equalizer.h.

◆ bandScope_

template<FloatType T, int MaxBands = 16>
std::array<int, MaxBands> dspark::Equalizer< T, MaxBands >::bandScope_ {}
protected

Where each band acts (audio thread's copy).

Definition at line 2868 of file Equalizer.h.

◆ bandSnap_

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::bandSnap_ = true
protected

Definition at line 2881 of file Equalizer.h.

◆ compensationDb_

template<FloatType T, int MaxBands = 16>
std::atomic<T> dspark::Equalizer< T, MaxBands >::compensationDb_ { T(0) }
protected

Definition at line 2851 of file Equalizer.h.

◆ compLeft_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::compLeft_ = 0
protected

Definition at line 2854 of file Equalizer.h.

◆ compNow_

template<FloatType T, int MaxBands = 16>
double dspark::Equalizer< T, MaxBands >::compNow_ = 1.0
protected

Definition at line 2853 of file Equalizer.h.

◆ compRamp_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::compRamp_ = 2400
protected

Definition at line 2854 of file Equalizer.h.

◆ compStep_

template<FloatType T, int MaxBands = 16>
double dspark::Equalizer< T, MaxBands >::compStep_ = 0.0
protected

Definition at line 2853 of file Equalizer.h.

◆ compTarget_

template<FloatType T, int MaxBands = 16>
double dspark::Equalizer< T, MaxBands >::compTarget_ = 1.0
protected

Definition at line 2853 of file Equalizer.h.

◆ configDirty_

template<FloatType T, int MaxBands = 16>
std::atomic<bool> dspark::Equalizer< T, MaxBands >::configDirty_ { false }
protected

Definition at line 2856 of file Equalizer.h.

◆ designBand_

template<FloatType T, int MaxBands = 16>
FilterDesign::Band dspark::Equalizer< T, MaxBands >::designBand_
protected

Definition at line 2866 of file Equalizer.h.

◆ filterMode_

template<FloatType T, int MaxBands = 16>
std::atomic<FilterMode> dspark::Equalizer< T, MaxBands >::filterMode_ { FilterMode::MinimumPhase }
protected

Definition at line 2871 of file Equalizer.h.

◆ kBandFadeSeconds

template<FloatType T, int MaxBands = 16>
constexpr double dspark::Equalizer< T, MaxBands >::kBandFadeSeconds = 0.02
staticconstexprprotected

Definition at line 1724 of file Equalizer.h.

◆ kEngineChannels

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kEngineChannels = 16
staticconstexprprotected

Channels the band engines hold.

Definition at line 1381 of file Equalizer.h.

◆ kHighPass_

template<FloatType T, int MaxBands = 16>
BiquadCoeffs dspark::Equalizer< T, MaxBands >::kHighPass_ {}
protected

Definition at line 2852 of file Equalizer.h.

◆ kLpBinBudget

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kLpBinBudget = 131072
staticconstexprprotected

Stage evaluations per hop (< 1 ms).

Definition at line 2164 of file Equalizer.h.

◆ kLpMaxKernel

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kLpMaxKernel = 1 << 18
staticconstexprprotected

Definition at line 2161 of file Equalizer.h.

◆ kLpMinKernel

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kLpMinKernel = 256
staticconstexprprotected

Definition at line 2160 of file Equalizer.h.

◆ kLpMinPartition

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kLpMinPartition = 64
staticconstexprprotected

Definition at line 2163 of file Equalizer.h.

◆ kLpPartitionCount

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kLpPartitionCount = 16
staticconstexprprotected

Partitions per kernel.

Definition at line 2162 of file Equalizer.h.

◆ kLpPartitionSlices

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kLpPartitionSlices = 1
staticconstexprprotected

Hops spent on partition FFTs.

Definition at line 2166 of file Equalizer.h.

◆ kLpProductBudget

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kLpProductBudget = 1048576
staticconstexprprotected

Products of kept curves per hop (< 1 ms).

Definition at line 2165 of file Equalizer.h.

◆ kLpSyncSteps

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kLpSyncSteps = 16
staticconstexprprotected

Bound of a synchronous design.

Definition at line 2167 of file Equalizer.h.

◆ kMaxBandSections

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kMaxBandSections = AnalogCascade::kMaxSections
staticconstexprprotected

Most sections a band has.

Definition at line 1380 of file Equalizer.h.

◆ kMaxStretches

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kMaxStretches = 32
staticconstexprprotected

Most designs a glide goes through.

Definition at line 1384 of file Equalizer.h.

◆ kPrototypeBins

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kPrototypeBins = 128
staticconstexprprotected

The correction is designed on 129 frequencies up to Nyquist.

Definition at line 1833 of file Equalizer.h.

◆ kPrototypeDelay

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kPrototypeDelay = kPrototypeTaps / 2
staticconstexprprotected

Its centre: the latency of the mode.

Definition at line 1832 of file Equalizer.h.

◆ kPrototypeFadeSeconds

template<FloatType T, int MaxBands = 16>
constexpr double dspark::Equalizer< T, MaxBands >::kPrototypeFadeSeconds = 0.02
staticconstexprprotected

Definition at line 1837 of file Equalizer.h.

◆ kPrototypeGrid

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kPrototypeGrid = 32
staticconstexprprotected

Samples between two steps of a fade of the correction.

Definition at line 1836 of file Equalizer.h.

◆ kPrototypeGroups

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kPrototypeGroups = 5
staticconstexprprotected

One per Scope.

Definition at line 1835 of file Equalizer.h.

◆ kPrototypeReach

template<FloatType T, int MaxBands = 16>
constexpr double dspark::Equalizer< T, MaxBands >::kPrototypeReach = 1.3815510557964274
staticconstexprprotected

Most the correction changes a level: 12 dB, in nepers.

Definition at line 1838 of file Equalizer.h.

◆ kPrototypeSlots

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kPrototypeSlots = 5
staticconstexprprotected

Left to left, right to right, right to left, left to right, further channels.

Definition at line 1834 of file Equalizer.h.

◆ kPrototypeTaps

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kPrototypeTaps = 64
staticconstexprprotected

Length of the correction.

Definition at line 1831 of file Equalizer.h.

◆ kRampFastMs

template<FloatType T, int MaxBands = 16>
constexpr double dspark::Equalizer< T, MaxBands >::kRampFastMs = 10.0
staticconstexprprotected

Glide of a jump.

Definition at line 1383 of file Equalizer.h.

◆ kRampSlowMs

template<FloatType T, int MaxBands = 16>
constexpr double dspark::Equalizer< T, MaxBands >::kRampSlowMs = 40.0
staticconstexprprotected

Glide of a small move of a band of the analog response.

Definition at line 1382 of file Equalizer.h.

◆ kRestDb

template<FloatType T, int MaxBands = 16>
constexpr double dspark::Equalizer< T, MaxBands >::kRestDb = 0.05
staticconstexprprotected

A gain band closer to 0 dB than this leaves the path.

Definition at line 1386 of file Equalizer.h.

◆ kShelf_

template<FloatType T, int MaxBands = 16>
BiquadCoeffs dspark::Equalizer< T, MaxBands >::kShelf_ {}
protected

Definition at line 2852 of file Equalizer.h.

◆ kStretchSamples

template<FloatType T, int MaxBands = 16>
constexpr int dspark::Equalizer< T, MaxBands >::kStretchSamples = 16
staticconstexprprotected

Shortest stretch between two of them.

Definition at line 1385 of file Equalizer.h.

◆ kTiltCeilingDb

template<FloatType T, int MaxBands = 16>
constexpr double dspark::Equalizer< T, MaxBands >::kTiltCeilingDb = 36.0
staticconstexprprotected

Most a constant tilt lifts its rising end (20 Hz or 20 kHz).

Definition at line 1387 of file Equalizer.h.

◆ loudnessComp_

template<FloatType T, int MaxBands = 16>
std::atomic<bool> dspark::Equalizer< T, MaxBands >::loudnessComp_ { false }
protected

Definition at line 2850 of file Equalizer.h.

◆ lpAccum_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpAccum_
protected

Definition at line 2896 of file Equalizer.h.

◆ lpActive_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpActive_ = 0
protected

Definition at line 2893 of file Equalizer.h.

◆ lpAnalog_

template<FloatType T, int MaxBands = 16>
std::array<AnalogSection, MaxBands * AnalogCascade::kMaxSections> dspark::Equalizer< T, MaxBands >::lpAnalog_ {}
protected

Prototypes of the analog bands.

Definition at line 2918 of file Equalizer.h.

◆ lpAnalogCount_

template<FloatType T, int MaxBands = 16>
std::array<int, MaxBands> dspark::Equalizer< T, MaxBands >::lpAnalogCount_ {}
protected

Definition at line 2919 of file Equalizer.h.

◆ lpBandDirty_

template<FloatType T, int MaxBands = 16>
std::array<bool, MaxBands> dspark::Equalizer< T, MaxBands >::lpBandDirty_ {}
protected

This design computes the band's curve.

Definition at line 2914 of file Equalizer.h.

◆ lpBandGroup_

template<FloatType T, int MaxBands = 16>
std::array<int, MaxBands> dspark::Equalizer< T, MaxBands >::lpBandGroup_ {}
protected

Where each band of the design acts (0 when it acts on every channel).

Definition at line 2920 of file Equalizer.h.

◆ lpBandKept_

template<FloatType T, int MaxBands = 16>
std::array<bool, MaxBands> dspark::Equalizer< T, MaxBands >::lpBandKept_ {}
protected

The band's curve is that of its stored design.

Definition at line 2913 of file Equalizer.h.

◆ lpBandLive_

template<FloatType T, int MaxBands = 16>
std::array<bool, MaxBands> dspark::Equalizer< T, MaxBands >::lpBandLive_ {}
protected

The band acts in this design.

Definition at line 2915 of file Equalizer.h.

◆ lpBandPower_

template<FloatType T, int MaxBands = 16>
std::vector<float> dspark::Equalizer< T, MaxBands >::lpBandPower_
protected

Per band: its squared magnitude on the design grid.

Definition at line 2912 of file Equalizer.h.

◆ lpBlockTime_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpBlockTime_
protected

Definition at line 2896 of file Equalizer.h.

◆ lpBlockTimeOld_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpBlockTimeOld_
protected

Definition at line 2896 of file Equalizer.h.

◆ lpChannels_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpChannels_ = 0
protected

Definition at line 2889 of file Equalizer.h.

◆ lpDesignBands_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpDesignBands_ = 0
protected

Definition at line 2909 of file Equalizer.h.

◆ lpDesignFft_

template<FloatType T, int MaxBands = 16>
std::unique_ptr<FFTReal<T> > dspark::Equalizer< T, MaxBands >::lpDesignFft_
protected

Design FFT (2 x kernel).

Definition at line 2885 of file Equalizer.h.

◆ lpDesignLive_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpDesignLive_ = 0
protected

Bands that act in this design.

Definition at line 2911 of file Equalizer.h.

◆ lpDesignPlaced_

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::lpDesignPlaced_ = false
protected

The design in flight is a matrix.

Definition at line 2923 of file Equalizer.h.

◆ lpDesignSpec_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpDesignSpec_
protected

Definition at line 2926 of file Equalizer.h.

◆ lpDesignStages_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpDesignStages_ = 0
protected

Sections of the bands whose curve this design computes.

Definition at line 2910 of file Equalizer.h.

◆ lpDesignTime_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpDesignTime_
protected

Definition at line 2926 of file Equalizer.h.

◆ lpDirty_

template<FloatType T, int MaxBands = 16>
std::atomic<bool> dspark::Equalizer< T, MaxBands >::lpDirty_ { true }
protected

Definition at line 2872 of file Equalizer.h.

◆ lpFdl_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpFdl_
protected

Per channel: partitions x spectrum.

Definition at line 2894 of file Equalizer.h.

◆ lpFdlPos_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpFdlPos_ = 0
protected

Definition at line 2900 of file Equalizer.h.

◆ lpFft_

template<FloatType T, int MaxBands = 16>
std::unique_ptr<FFTReal<T> > dspark::Equalizer< T, MaxBands >::lpFft_
protected

Partition FFT (2 x partition); gates the engine.

Definition at line 2884 of file Equalizer.h.

◆ lpFifoPos_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpFifoPos_ = 0
protected

Definition at line 2899 of file Equalizer.h.

◆ lpInput_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpInput_
protected

Definition at line 2895 of file Equalizer.h.

◆ lpKernelLength_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpKernelLength_ = 0
protected

Definition at line 2886 of file Equalizer.h.

◆ lpKernelRequest_

template<FloatType T, int MaxBands = 16>
std::atomic<int> dspark::Equalizer< T, MaxBands >::lpKernelRequest_ { 0 }
protected

0 = automatic length.

Definition at line 2873 of file Equalizer.h.

◆ lpKernelSet_

template<FloatType T, int MaxBands = 16>
std::array<std::vector<T>, 2> dspark::Equalizer< T, MaxBands >::lpKernelSet_
protected

Partition spectra, active + incoming.

Definition at line 2892 of file Equalizer.h.

◆ lpKernelTime_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpKernelTime_
protected

Definition at line 2926 of file Equalizer.h.

◆ lpMag_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpMag_
protected

Definition at line 2925 of file Equalizer.h.

◆ lpOutput_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpOutput_
protected

Per channel FIFOs.

Definition at line 2895 of file Equalizer.h.

◆ lpPartition_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpPartition_ = 0
protected

Definition at line 2887 of file Equalizer.h.

◆ lpPartitions_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpPartitions_ = 0
protected

Definition at line 2888 of file Equalizer.h.

◆ lpPlaced_

template<FloatType T, int MaxBands = 16>
std::array<bool, 2> dspark::Equalizer< T, MaxBands >::lpPlaced_ {}
protected

Whether each kernel set is one.

Definition at line 2924 of file Equalizer.h.

◆ lpRestartPending_

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::lpRestartPending_ = false
protected

Definition at line 2907 of file Equalizer.h.

◆ lpSlot_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpSlot_ = 0
protected

Kernel of the design being transformed.

Definition at line 2922 of file Equalizer.h.

◆ lpSlots_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpSlots_ = 1
protected

Kernels a set holds: 1, or the matrix of a pair (and one more for further channels).

Definition at line 2921 of file Equalizer.h.

◆ lpSnap_

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::lpSnap_ = true
protected

Definition at line 2901 of file Equalizer.h.

◆ lpStage_

template<FloatType T, int MaxBands = 16>
LpStage dspark::Equalizer< T, MaxBands >::lpStage_ = LpStage::Idle
protected

Definition at line 2905 of file Equalizer.h.

◆ lpStageCount_

template<FloatType T, int MaxBands = 16>
std::array<int, MaxBands> dspark::Equalizer< T, MaxBands >::lpStageCount_ {}
protected

Definition at line 2917 of file Equalizer.h.

◆ lpStages_

template<FloatType T, int MaxBands = 16>
std::array<BiquadCoeffs, MaxBands * 5> dspark::Equalizer< T, MaxBands >::lpStages_ {}
protected

Definition at line 2916 of file Equalizer.h.

◆ lpStep_

template<FloatType T, int MaxBands = 16>
int dspark::Equalizer< T, MaxBands >::lpStep_ = 0
protected

Definition at line 2906 of file Equalizer.h.

◆ lpSwapPending_

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::lpSwapPending_ = false
protected

Definition at line 2908 of file Equalizer.h.

◆ lpWarm_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpWarm_
protected

The held input the bands are run over on leaving the mode.

Definition at line 2897 of file Equalizer.h.

◆ lpWarmChannels_

template<FloatType T, int MaxBands = 16>
std::vector<T*> dspark::Equalizer< T, MaxBands >::lpWarmChannels_
protected

Definition at line 2898 of file Equalizer.h.

◆ lpWasActive_

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::lpWasActive_ = false
protected

Definition at line 2902 of file Equalizer.h.

◆ lpWindow_

template<FloatType T, int MaxBands = 16>
std::vector<T> dspark::Equalizer< T, MaxBands >::lpWindow_
protected

Definition at line 2925 of file Equalizer.h.

◆ masterConfigs_

template<FloatType T, int MaxBands = 16>
std::array<BandConfig, MaxBands> dspark::Equalizer< T, MaxBands >::masterConfigs_ {}
protected

Control-thread-private master copy. Never read by the audio thread or by any readout: it exists so a setter can fall back to the band's current value for a non-finite field without reading published storage. Single writer by contract, so it needs no synchronization of its own.

Definition at line 2842 of file Equalizer.h.

◆ matchedBells_

template<FloatType T, int MaxBands = 16>
std::atomic<bool> dspark::Equalizer< T, MaxBands >::matchedBells_ { true }
protected

Matched (de-cramped) bells by default.

Definition at line 2857 of file Equalizer.h.

◆ matchedFilters_

template<FloatType T, int MaxBands = 16>
std::atomic<bool> dspark::Equalizer< T, MaxBands >::matchedFilters_ { false }
protected

Matched LP/HP/BP/shelves: opt-in.

Definition at line 2858 of file Equalizer.h.

◆ numBands_

template<FloatType T, int MaxBands = 16>
std::atomic<int> dspark::Equalizer< T, MaxBands >::numBands_ { 0 }
protected

Definition at line 2684 of file Equalizer.h.

◆ prototype_

template<FloatType T, int MaxBands = 16>
std::unique_ptr<PrototypeEngine> dspark::Equalizer< T, MaxBands >::prototype_
protected

The correction of the prototype-phase mode.

Definition at line 2864 of file Equalizer.h.

◆ prototypeWasActive_

template<FloatType T, int MaxBands = 16>
bool dspark::Equalizer< T, MaxBands >::prototypeWasActive_ = false
protected

The last block ran in that mode.

Definition at line 2865 of file Equalizer.h.

◆ resonantShelves_

template<FloatType T, int MaxBands = 16>
std::atomic<bool> dspark::Equalizer< T, MaxBands >::resonantShelves_ { false }
protected

The Q of a shelf can go above 0.7071: opt-in.

Definition at line 2860 of file Equalizer.h.

◆ softMode_

template<FloatType T, int MaxBands = 16>
std::atomic<bool> dspark::Equalizer< T, MaxBands >::softMode_ { false }
protected

Definition at line 2855 of file Equalizer.h.

◆ spec_

template<FloatType T, int MaxBands = 16>
AudioSpec dspark::Equalizer< T, MaxBands >::spec_ {}
protected

Definition at line 2683 of file Equalizer.h.

◆ staged_

template<FloatType T, int MaxBands = 16>
std::array<StagedBand, MaxBands> dspark::Equalizer< T, MaxBands >::staged_ {}
protected

Published band configurations. The ONLY band storage both threads reach.

Definition at line 2836 of file Equalizer.h.

◆ structure_

template<FloatType T, int MaxBands = 16>
std::atomic<Structure> dspark::Equalizer< T, MaxBands >::structure_ { Structure::DirectForm }
protected

setStructure().

Definition at line 2687 of file Equalizer.h.


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