DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
dspark Namespace Reference

Main namespace for the DSPark framework. More...

Namespaces

namespace  AnalogRandom
 
namespace  detail
 
namespace  harmony
 
namespace  plugin
 
namespace  simd
 
namespace  Smoothers
 
namespace  wdf
 

Classes

class  ADSREnvelope
 Classic ADSR envelope generator with exponential curves. More...
 
class  AlgorithmicReverb
 16-line FDN reverb with Jot absorption and 6 presets. More...
 
class  AudioBuffer
 Owning audio buffer with contiguous, 32-byte aligned storage. More...
 
class  AudioBufferView
 Non-owning view over audio channel data. More...
 
class  AudioFile
 Abstract base class for audio file readers and writers. More...
 
struct  AudioFileInfo
 Metadata describing an audio file's format and dimensions. More...
 
struct  AudioSpec
 Describes the audio environment for a DSP processor. More...
 
class  AutoGain
 Block-adaptive automatic gain compensation with SIMD-friendly linear interpolation. More...
 
class  Biquad
 Biquad filter using Transposed Direct Form II (TDF-II) with thread-safe updates. More...
 
struct  BiquadCoeffs
 Stores normalised biquad coefficients (b0, b1, b2, a1, a2), always double. More...
 
class  ChordDetector
 Monophonic-buffer chord recognition with confidence gating. More...
 
class  Chorus
 Multi-voice chorus/flanger with true stereo spread and smooth parameter handling. More...
 
class  Clipper
 Real-time audio clipper with analog modeling and anti-aliasing features. More...
 
class  Compressor
 High-fidelity modular compressor designed for real-time applications. More...
 
class  Convolver
 Real-time partitioned convolution using overlap-save with FFT. More...
 
class  Crossfade
 Artifact-free, SIMD-friendly crossfader for two audio signals. More...
 
class  CrossoverFilter
 Linkwitz-Riley crossover with 2-12 bands, LR12/LR24/LR48. More...
 
class  DCBlocker
 DC blocking filter with configurable Butterworth order (1-10). More...
 
class  DeEsser
 Stereo-linked, CPU-optimized dynamic-EQ de-esser. More...
 
class  Delay
 
class  DenormalGuard
 RAII scope guard to disable denormalised (subnormal) floating-point numbers. More...
 
class  Dither
 TPDF dithering processor with optional 1st-order noise shaping. More...
 
class  DryWetMixer
 Pre-allocated, SIMD-friendly dry/wet blender for real-time audio. More...
 
class  DynamicEQ
 Dynamic parametric EQ with dual above/below threshold per band. More...
 
class  EnvelopeFollower
 Attack/release envelope detector (Peak or RMS). More...
 
class  Equalizer
 Parametric multi-band EQ using cascaded biquads or FFT overlap-save convolution. More...
 
class  Expander
 Downward expander with ratio control, hysteresis, and sidechain. More...
 
class  FFTComplex
 In-place Cooley-Tukey radix-2 DIT FFT for complex data. More...
 
class  FFTReal
 FFT optimised for real-valued input signals (the common audio case). More...
 
class  FilterEngine
 Professional multi-mode filter with cascaded biquad stages. More...
 
class  FIRDesign
 Static methods for designing FIR filter coefficients. More...
 
class  FIRFilter
 FIR filter using direct-form convolution with a mirrored delay line. More...
 
class  FrequencyShifter
 Constant-Hz frequency shift optimized via Quadrature Oscillator. More...
 
class  Gain
 Professional click-free gain processor. More...
 
class  Goertzel
 Single-frequency magnitude detector using the Goertzel algorithm. More...
 
class  GranularProcessor
 Granular clouds and spectral-freeze textures from live input. More...
 
class  Hilbert
 90-degree phase-differencing network (analytic-signal generator). More...
 
class  Hysteresis
 Per-channel Jiles-Atherton hysteresis processor (field in, M out). More...
 
class  LadderFilter
 4-pole resonant ladder filter (Moog topology, TPT discretization). More...
 
class  LevelFollower
 Per-channel peak and RMS envelope follower with lock-free readout. More...
 
class  Limiter
 High-performance brickwall lookahead limiter. More...
 
class  LoudnessMeter
 Real-time safe EBU R128 loudness meter. More...
 
struct  MidSide
 Static utility for Mid/Side stereo encoding and decoding. More...
 
class  MinBlepTable
 Shared minimum-phase band-limited step (minBLEP) residual table. More...
 
class  ModulationRouter
 Fixed-capacity source-to-target router with per-route depth/smoothing. More...
 
class  Mp3File
 
class  MultibandCompressor
 Multi-band compressor: crossover split, per-band compression, sum. More...
 
class  NoiseGate
 High-performance noise gate with state machine, hysteresis, and zero-allocation processing. More...
 
class  NoiseGenerator
 Generates decorellated noise (white, pink, brown) across multiple channels. More...
 
class  OnsetDetector
 Causal SuperFlux onset detector with lock-free readout. More...
 
class  Oscillator
 Band-limited oscillator featuring PolyBLEP anti-aliasing and analog-modeled integration. More...
 
class  Oversampling
 Power-of-two oversampling processor with polyphase anti-aliasing. More...
 
class  Panner
 
class  PhaseCorrelation
 Correlation/balance meter and goniometer data source. More...
 
class  Phaser
 Zero-latency, highly optimized allpass-based phaser. More...
 
class  Phasor
 Phase accumulator generating a [0, 1) ramp for oscillators and modulation. More...
 
class  PitchDetector
 Thread-safe YIN pitch detector with lock-free readout. More...
 
class  PitchFollower
 Gated, octave-safe, semitone-smoothed pitch tracking source. More...
 
class  PitchShifter
 Real-time phase-vocoder pitch shifter (+-12 semitones, stereo-linked). More...
 
class  ProcessorChain
 Compile-time chain of audio processors. More...
 
class  Resampler
 Windowed-sinc sample rate converter optimized for real-time DSP. More...
 
class  Reverb
 Convolution reverb with IR loading, dry/wet, and pre-delay. More...
 
class  RingBuffer
 Power-of-two circular buffer with compile-time interpolated read access. More...
 
class  RingModulator
 Signal x carrier ring modulation with mix control and zero-latency smoothing. More...
 
class  SampleAndHold
 Holds a sample value for N samples or until externally triggered. More...
 
class  Saturation
 Professional multi-algorithm saturation processor with analog simulation. More...
 
class  SmoothedValue
 Zero-allocation parameter smoother for real-time audio. More...
 
class  SpectralDenoiser
 Learn-a-profile spectral gate (hiss/hum/room-tone reduction). More...
 
class  SpectralProcessor
 High-performance STFT analysis-modification-synthesis pipeline. More...
 
class  SpectrumAnalyzer
 Real-time FFT spectrum analyser with per-bin smoothing and peak hold. More...
 
class  SpinLock
 A minimal, real-time safe spin lock with a TTAS wait loop. More...
 
class  SpscQueue
 
class  StateReader
 Tolerant reader: missing keys yield defaults, unknown keys are skipped. More...
 
class  StateVariableFilter
 TPT State Variable Filter with simultaneous multi-output. More...
 
class  StateWriter
 Serializes key/value parameters into a versioned blob. More...
 
class  StereoWidth
 High-performance stereo image processor with phase-aligned bass mono. More...
 
class  TapeMachine
 Reel-to-reel tape emulation with physical hysteresis and transport. More...
 
class  TransformerModel
 Physical audio-transformer coloration (flux-domain JA hysteresis). More...
 
class  TransientDesigner
 Zero-allocation, thread-safe transient shaper. More...
 
class  Tremolo
 LFO-driven amplitude modulation with stereo auto-pan option. More...
 
class  TruePeakDetector
 Per-channel 4x-oversampled inter-sample peak estimator. More...
 
class  TubePreamp
 One/two 12AX7 stages with sag and a WDF tone circuit. More...
 
class  Vibrato
 Professional-grade pitch vibrato with LFO FM and parameter smoothing. More...
 
class  WaveshapeTable
 Zero-latency lookup-table waveshaper with RT-safe gain modulation. More...
 
class  WavetableOscillator
 Professional mipmapped wavetable oscillator for bandlimited synthesis. More...
 
class  WavFile
 Complete WAV file reader and writer in pure C++20. More...
 
struct  WindowFunctions
 Static utility generating window functions for DSP analysis/synthesis. More...
 
class  ZeroLatencyConvolver
 Gardner-style non-uniform partitioned convolver (zero latency, flat CPU). More...
 

Concepts

concept  FloatType
 Constrains a type to IEEE floating-point (float or double).
 
concept  AudioProcessor
 A type that can prepare, process audio blocks, and reset state.
 
concept  SampleProcessor
 An AudioProcessor that additionally supports scalar per-sample processing.
 
concept  GeneratorProcessor
 A real-time safe source processor (oscillators, noise, LFOs).
 

Enumerations

enum class  InterpMethod { Linear , Cubic , Hermite , Lagrange }
 Interpolation method for fractional-sample reads. More...
 

Functions

template<FloatType T>
decibelsToGain (T dB, T minusInfinityDb=T(-100)) noexcept
 Converts a value in decibels to linear gain.
 
template<FloatType T>
gainToDecibels (T gain, T minusInfinityDb=T(-100)) noexcept
 Converts a linear gain value to decibels.
 
template<FloatType T>
mapRange (T value, T inMin, T inMax, T outMin, T outMax) noexcept
 Maps a value from one range to another (linear interpolation).
 
template<FloatType T>
fastTanh (T x) noexcept
 Fast tanh approximation using Pade rational function.
 
template<FloatType T>
fastPow10 (T x) noexcept
 Fast approximation of 10^x using exp2.
 
template<FloatType T>
fastExp (T x) noexcept
 Fast approximation of e^x via std::exp2 (~2x faster than std::exp on MSVC).
 
template<FloatType T>
fastTan (T x) noexcept
 Fast approximation of tan(x) using a Pade [5,4] rational approximant.
 
template<FloatType T>
fastSin (T x) noexcept
 Fast sine approximation (degree-9 odd minimax polynomial).
 
template<FloatType T>
fastCos (T x) noexcept
 Fast cosine approximation. See fastSin() for accuracy notes (float error is ~7e-6 here: half an ulp more from the pi/2 offset).
 
template<FloatType T>
fastLog (T x) noexcept
 Fast natural logarithm approximation.
 
template<FloatType T>
wrapPhase (T phase) noexcept
 Normalises a phase value to the range [0, 2*pi).
 
template<FloatType T>
interpolateLinear (T y0, T y1, T frac) noexcept
 Linear interpolation between two adjacent samples.
 
template<FloatType T>
interpolateLinear (const T *buffer, int length, T position) noexcept
 Linear interpolation reading directly from a circular buffer.
 
template<FloatType T>
interpolateHermite (T y0, T y1, T y2, T y3, T frac) noexcept
 4-point, 3rd-order Hermite interpolation (optimized x-form).
 
template<FloatType T>
interpolateHermite (const T *buffer, int length, T position) noexcept
 
template<FloatType T>
interpolateCubic (const T *buffer, int length, T position) noexcept
 Alias of interpolateHermite (Catmull-Rom evaluated in Hermite form). Kept for backward compatibility.
 
template<FloatType T>
interpolateLagrange (T y0, T y1, T y2, T y3, T frac) noexcept
 4-point Lagrange interpolation from discrete samples.
 
template<FloatType T>
interpolateLagrange (const T *buffer, int length, T position) noexcept
 
template<FloatType T>
interpolateAllpass (T currentSample, T previousSample, T frac, T &state) noexcept
 Allpass interpolation (first-order Thiran) for fractional delay.
 
std::string stateToJson (const std::vector< uint8_t > &blob)
 Renders a state blob as a flat JSON object string.
 
std::vector< uint8_t > stateFromJson (const std::string &json)
 Parses the JSON produced by stateToJson() back into a blob.
 
constexpr uint32_t stateId (const char(&tag)[5]) noexcept
 Builds a FOURCC processor id, e.g. dspark::stateId("COMP").
 

Variables

template<FloatType T>
constexpr T pi = std::numbers::pi_v<T>
 Pi (3.14159...) for the given floating-point type.
 
template<FloatType T>
constexpr T twoPi = T(2) * std::numbers::pi_v<T>
 2 * Pi (6.28318...).
 
template<FloatType T>
constexpr T invTwoPi = T(1) / twoPi<T>
 1 / (2 * Pi) (0.15915...). Useful for fast phase divisions.
 
template<FloatType T>
constexpr T halfPi = std::numbers::pi_v<T> / T(2)
 Pi / 2 (1.57079...). Quarter period; sin/cos phase offset.
 
template<FloatType T>
constexpr T sqrt2 = std::numbers::sqrt2_v<T>
 Square root of 2 (1.41421...).
 
template<FloatType T>
constexpr T invSqrt2 = T(1) / std::numbers::sqrt2_v<T>
 1 / square root of 2 (0.70710...). Butterworth Q factor.
 
constexpr std::size_t kCacheLineSize = 64
 

Detailed Description

Main namespace for the DSPark framework.

Enumeration Type Documentation

◆ InterpMethod

enum class dspark::InterpMethod
strong

Interpolation method for fractional-sample reads.

Enumerator
Linear 

2-point linear (fast, lower quality)

Cubic 

4-point Catmull-Rom (good balance)

Hermite 

4-point Hermite (smooth transients, best for modulated delay)

Lagrange 

4-point Lagrange (highest accuracy, static delay)

Definition at line 42 of file RingBuffer.h.

Function Documentation

◆ decibelsToGain()

template<FloatType T>
T dspark::decibelsToGain ( dB,
minusInfinityDb = T(-100) 
)
inlinenoexcept

Converts a value in decibels to linear gain.

Parameters
dBValue in decibels.
minusInfinityDbValues at or below this threshold return 0. Default: -100 dB.
Returns
Linear gain (0 for silence, 1 for unity, >1 for boost).

Definition at line 65 of file DspMath.h.

◆ fastCos()

template<FloatType T>
T dspark::fastCos ( x)
inlinenoexcept

Fast cosine approximation. See fastSin() for accuracy notes (float error is ~7e-6 here: half an ulp more from the pi/2 offset).

Parameters
xArgument in radians.
Returns
Approximation of cos(x).

Definition at line 244 of file DspMath.h.

◆ fastExp()

template<FloatType T>
T dspark::fastExp ( x)
inlinenoexcept

Fast approximation of e^x via std::exp2 (~2x faster than std::exp on MSVC).

Uses the identity e^x = 2^(x * log2(e)).

Parameters
xExponent. No range clamping is applied.
Returns
Approximation of e^x.

Definition at line 167 of file DspMath.h.

◆ fastLog()

template<FloatType T>
T dspark::fastLog ( x)
inlinenoexcept

Fast natural logarithm approximation.

Splits the input into exponent and mantissa via std::frexp, then evaluates the classic 4-term atanh series (Cephes style) for ln of the mantissa, centred on [sqrt(0.5), sqrt(2)). Relative error is below 2e-7: ample for envelope/dB work. Roughly 2-4x faster than std::log.

Parameters
xInput value. Must be > 0 (no guard: matches std::log contract).
Returns
Approximation of ln(x).

Definition at line 261 of file DspMath.h.

◆ fastPow10()

template<FloatType T>
T dspark::fastPow10 ( x)
inlinenoexcept

Fast approximation of 10^x using exp2.

Uses the identity 10^x = 2^(x * log2(10)). Useful in dB conversions where exact precision is not critical.

Parameters
xExponent.
Returns
Approximation of 10^x.

Definition at line 148 of file DspMath.h.

◆ fastSin()

template<FloatType T>
T dspark::fastSin ( x)
inlinenoexcept

Fast sine approximation (degree-9 odd minimax polynomial).

Maximum error ~4e-6 in either precision (over 110 dB below the signal): inaudible even for audio-rate synthesis. The degree-9 minimax coefficients are stored to ~7 significant digits, so the double path is coefficient- limited to the same ~3.2e-6 as float rather than reaching double's own resolution (measured M-002, audit_ag2). Use std::sin where sub-ppm accuracy is required. About 3-6x faster than std::sin depending on platform. The input is range-reduced internally (two-term Cody-Waite), so any finite argument within a few thousand periods of zero stays accurate.

Parameters
xArgument in radians.
Returns
Approximation of sin(x).

Definition at line 213 of file DspMath.h.

◆ fastTan()

template<FloatType T>
T dspark::fastTan ( x)
inlinenoexcept

Fast approximation of tan(x) using a Pade [5,4] rational approximant.

Accurate to better than 0.01% for |x| <= 1.45 and ~0.1% up to the 1.52 fallback limit. Outside that range, falls back to std::tan to avoid the singularities at +-pi/2 producing absurd results.

Useful for the bilinear-transform tan(pi*f/Fs) term: with this accuracy a 20 kHz cutoff at 44.1 kHz lands within a fraction of a cent of the target. Roughly 3x faster than std::tan on MSVC.

Parameters
xArgument in radians.
Returns
Approximation of tan(x).

Definition at line 187 of file DspMath.h.

◆ fastTanh()

template<FloatType T>
T dspark::fastTanh ( x)
inlinenoexcept

Fast tanh approximation using Pade rational function.

Approximately 5x faster than std::tanh. Optimized for SIMD without branching. Input is clamped to [-3, 3] maintaining C0 continuity to prevent aliasing. Max output amplitude is ~0.9954.

Note
The clamp at |x| = 3 is C0 but not C1: the derivative has a small discontinuity there (output is already ~0.9954, so the resulting kink is inaudible in practice). Use std::tanh where exact C1 behaviour matters.
Parameters
xInput value.
Returns
Approximation of tanh(x), smoothly bounded.

Definition at line 126 of file DspMath.h.

◆ gainToDecibels()

template<FloatType T>
T dspark::gainToDecibels ( gain,
minusInfinityDb = T(-100) 
)
inlinenoexcept

Converts a linear gain value to decibels.

Parameters
gainLinear gain (must be >= 0).
minusInfinityDbReturned for zero or negative gain. Default: -100 dB.
Returns
Value in decibels.

Definition at line 78 of file DspMath.h.

◆ interpolateAllpass()

template<FloatType T>
T dspark::interpolateAllpass ( currentSample,
previousSample,
frac,
T &  state 
)
inlinenoexcept

Allpass interpolation (first-order Thiran) for fractional delay.

Perfectly flat magnitude response at every frequency, unlike polynomial interpolators (which low-pass); the cost is a frequency-dependent phase response and a recursive state.

Warning
Allpass interpolation is IIR (recursive). Do NOT modulate frac quickly (e.g. audio-rate LFOs): the state carries history filtered with the previous coefficient and produces loud clicks. Best for static or slowly changing delays; use interpolateHermite for modulated delay lines.

The filter is stable for any frac > 0, but as frac approaches 0 the pole approaches z = -1 and the interpolator rings for thousands of samples near Nyquist. Canonical usage keeps the fractional delay in [0.5, 1.5): when the fractional part f of the total delay is below 0.5, read one integer sample earlier and pass frac = f + 1 instead.

Parameters
currentSampleThe current input sample (x[n]).
previousSampleThe previous input sample (x[n-1]).
fracFractional delay in samples, relative to x[n]. Stable for any value > 0; see the [0.5, 1.5) mapping above for clean low-frac behaviour.
stateAllpass filter state (y[n-1]). Maintained by the caller; initialise to 0 and keep one state per delay tap per channel.
Returns
Interpolated sample value (y[n]).

Definition at line 266 of file Interpolation.h.

◆ interpolateCubic()

template<FloatType T>
T dspark::interpolateCubic ( const T *  buffer,
int  length,
position 
)
inlinenoexcept

Alias of interpolateHermite (Catmull-Rom evaluated in Hermite form). Kept for backward compatibility.

Definition at line 165 of file Interpolation.h.

◆ interpolateHermite() [1/2]

template<FloatType T>
T dspark::interpolateHermite ( const T *  buffer,
int  length,
position 
)
inlinenoexcept

Definition at line 138 of file Interpolation.h.

◆ interpolateHermite() [2/2]

template<FloatType T>
T dspark::interpolateHermite ( y0,
y1,
y2,
y3,
frac 
)
inlinenoexcept

4-point, 3rd-order Hermite interpolation (optimized x-form).

Mathematically identical to Catmull-Rom but evaluated with fewer multiplications than the standard polynomial form.

Parameters
y0Sample at index n-1.
y1Sample at index n.
y2Sample at index n+1.
y3Sample at index n+2.
fracFractional position between y1 and y2 (0.0 to 1.0).
Returns
Interpolated sample.

Definition at line 113 of file Interpolation.h.

◆ interpolateLagrange() [1/2]

template<FloatType T>
T dspark::interpolateLagrange ( const T *  buffer,
int  length,
position 
)
inlinenoexcept

Definition at line 217 of file Interpolation.h.

◆ interpolateLagrange() [2/2]

template<FloatType T>
T dspark::interpolateLagrange ( y0,
y1,
y2,
y3,
frac 
)
inlinenoexcept

4-point Lagrange interpolation from discrete samples.

Reconstructs polynomials up to degree 3 exactly (the divisions of the Lagrange basis are precomputed constants).

Parameters
y0Sample at index n-1.
y1Sample at index n.
y2Sample at index n+1.
y3Sample at index n+2.
fracFractional position between y1 and y2 (0.0 to 1.0).
Returns
Interpolated sample.

Definition at line 183 of file Interpolation.h.

◆ interpolateLinear() [1/2]

template<FloatType T>
T dspark::interpolateLinear ( const T *  buffer,
int  length,
position 
)
inlinenoexcept

Linear interpolation reading directly from a circular buffer.

The buffer is treated as circular: reading at position length - 0.5 interpolates between the last and the first sample.

Parameters
bufferPointer to the start of the audio buffer.
lengthSize of the buffer in samples (must be > 0).
positionAbsolute read position.
Returns
Interpolated sample.
Precondition
0 <= position < length. Violations assert in debug builds; release builds clamp to the nearest valid sample (NaN reads position 0).

Definition at line 78 of file Interpolation.h.

◆ interpolateLinear() [2/2]

template<FloatType T>
T dspark::interpolateLinear ( y0,
y1,
frac 
)
inlinenoexcept

Linear interpolation between two adjacent samples.

Parameters
y0Sample at index n.
y1Sample at index n+1.
fracFractional position (0.0 to 1.0).
Returns
Interpolated sample.

Definition at line 59 of file Interpolation.h.

◆ mapRange()

template<FloatType T>
T dspark::mapRange ( value,
inMin,
inMax,
outMin,
outMax 
)
inlinenoexcept

Maps a value from one range to another (linear interpolation).

Includes a safety check to prevent division by zero if inMin == inMax.

Parameters
valueThe input value to remap.
inMinLower bound of the input range.
inMaxUpper bound of the input range.
outMinLower bound of the output range.
outMaxUpper bound of the output range.
Returns
Remapped value. Returns outMin if input bounds are identical.

Definition at line 101 of file DspMath.h.

◆ stateFromJson()

std::vector< uint8_t > dspark::stateFromJson ( const std::string &  json)
inline

Parses the JSON produced by stateToJson() back into a blob.

Accepts exactly that flat subset (id/version/params of numbers and bools); returns an empty vector on malformed input. Number-typed params re-enter as floats; integer-coded modes survive because setState() readers request the type they stored, and stateToJson tags ints without decimals – both int and float lookups are attempted by the float/int read pair below.

Definition at line 633 of file StateBlob.h.

◆ stateId()

constexpr uint32_t dspark::stateId ( const char(&)  tag[5])
constexprnoexcept

Builds a FOURCC processor id, e.g. dspark::stateId("COMP").

Definition at line 639 of file StateBlob.h.

◆ stateToJson()

std::string dspark::stateToJson ( const std::vector< uint8_t > &  blob)
inline

Renders a state blob as a flat JSON object string.

Definition at line 619 of file StateBlob.h.

◆ wrapPhase()

template<FloatType T>
T dspark::wrapPhase ( phase)
inlinenoexcept

Normalises a phase value to the range [0, 2*pi).

Optimized for hot paths: avoids std::fmod (slow, hostile to vectorisation) in favour of inverse multiplication and flooring.

Parameters
phasePhase in radians.
Returns
Phase wrapped safely to [0, 2*pi).

Definition at line 294 of file DspMath.h.

Variable Documentation

◆ halfPi

template<FloatType T>
constexpr T dspark::halfPi = std::numbers::pi_v<T> / T(2)
inlineconstexpr

Pi / 2 (1.57079...). Quarter period; sin/cos phase offset.

Definition at line 45 of file DspMath.h.

◆ invSqrt2

template<FloatType T>
constexpr T dspark::invSqrt2 = T(1) / std::numbers::sqrt2_v<T>
inlineconstexpr

1 / square root of 2 (0.70710...). Butterworth Q factor.

Definition at line 51 of file DspMath.h.

◆ invTwoPi

template<FloatType T>
constexpr T dspark::invTwoPi = T(1) / twoPi<T>
inlineconstexpr

1 / (2 * Pi) (0.15915...). Useful for fast phase divisions.

Definition at line 42 of file DspMath.h.

◆ kCacheLineSize

constexpr std::size_t dspark::kCacheLineSize = 64
inlineconstexpr

Definition at line 53 of file SpscQueue.h.

◆ pi

template<FloatType T>
constexpr T dspark::pi = std::numbers::pi_v<T>
inlineconstexpr

Pi (3.14159...) for the given floating-point type.

Definition at line 36 of file DspMath.h.

◆ sqrt2

template<FloatType T>
constexpr T dspark::sqrt2 = std::numbers::sqrt2_v<T>
inlineconstexpr

Square root of 2 (1.41421...).

Definition at line 48 of file DspMath.h.

◆ twoPi

template<FloatType T>
constexpr T dspark::twoPi = T(2) * std::numbers::pi_v<T>
inlineconstexpr

2 * Pi (6.28318...).

Definition at line 39 of file DspMath.h.