DSP#
The yup_dsp module provides the real-time audio processing building blocks of
the framework: mathematical utilities, windowing, noise, FFTs and spectral
analysis, filter design, filter implementations, crossovers, dynamics
processing, metering, convolution, delay lines, resampling, and
time-stretching / pitch-shifting.
Modules covered: yup_dsp.
Note
yup_dsp depends on yup_core, yup_audio_basics (for AudioBuffer,
ProcessSpec, and friends) and yup_simd. On Apple platforms it can use the
Accelerate framework (vDSP) for FFTs, and it optionally links
pffft_library and bungee_library when those third-party libraries are
available in the build.
In this area#
Math, windowing & noise -
DspMathconversion and analysis helpers, theWindowFunctionstoolkit (17 window types), and theWhiteNoise/PinkNoisegenerators.Frequency domain -
FFTProcessor(with FFTW3 / vDSP / PFFFT / Ooura backends),SpectrumAnalyzerState, and the low-levelOouraFFT8g.Filter design -
FilterDesignerandAnalogFilterDesignerfor Butterworth, Chebyshev and Bessel filters, plus the analog prototype helpers (AnalogPoles,AnalogSaturator,AnalogFilterCoefficients,StateVariableCoefficients).Filters - the processing primitives (
FirstOrder,Biquad, cascades, coefficient structs) and the ready-to-use filter classes: first-order, RBJ biquad, Zoelzer, state-variable, Butterworth, Linkwitz-Riley crossovers, direct FIR, analog-mapped filters, and comb filters.Dynamics & metering -
HardClipper,SoftClipper,BlunterClipper, theAaIirAntialiaseroversampling helper,LevelProcessor, the K-weightedLoudnessFilter, and theKMeterStatemetering model.Onset detection -
FilterBank,Spectrogram, the spectral flux ODFs (SuperFluxODF,ComplexFluxODF),OnsetPeakPicker, and the end-to-endOnsetDetector.Convolution & delay - the
PartitionedConvolverand theFractionallyAddressedDelayinterpolation delay line.Resampling -
Oversampler,Resampler,SincTable, and theCircularBufferhelper.Time-stretching & pitch-shifting - the
TimeStretchProcessorwith its time-domain and Bungee backends.
Key building blocks#
The module is organized around a few core ideas:
Coefficient containers are separate from processing. Filter design produces coefficient structs (
FirstOrderCoefficients,BiquadCoefficients,StateVariableCoefficients, …); the processing classes (FirstOrder,Biquad, and the higher-level filter wrappers) consume them. You can design coefficients on any thread and apply them to a real-time-safe processor.Realtime-safe by convention. The per-sample processing methods are
noexcept, allocation-free, and designed for the audio thread. Configuration methods such asprepare()are explicitly not realtime-safe and must be called during initialization.Backend pluggability.
FFTProcessorandTimeStretchProcessorselect among several backends at runtime (or compile time) so the same public API works across platforms and optional dependencies.Templates over
float/double. Most processing classes are templated on the sample type, withfloatanddoubleinstantiations (WindowFunctionsFloat,WindowFunctionsDouble,Biquad<float>, …).
Realtime rules of thumb#
Audio thread
Only the per-sample processing entry points are safe to call from the audio
thread. Call prepare(), reset() (where documented as non-realtime),
setSampleRate(), and coefficient-design functions outside of the audio
callback, then pass values in via atomic or parameter-change mechanisms.