|
RADLib
RADical C++ application framework
|
Reusable DSP primitives for audio, SDR/IQ, plotting, and analysis. More...
#include <RADCore/RADLicenseGate.h>#include <array>#include <cstddef>#include <cstdint>#include <initializer_list>#include <vector>
Include dependency graph for RADDsp.h:Go to the source code of this file.
Classes | |
| struct | RADDsp::ComplexSample |
| Complex I/Q sample used by SDR and constellation-oriented helpers. More... | |
| class | RADDsp::FftPlan |
| Reusable power-of-two complex FFT plan with cached bit-reversal and twiddle factors. More... | |
| class | RADDsp::MatrixF |
| Row-major dense floating-point matrix for DSP transforms and small linear algebra. More... | |
| struct | RADDsp::BiquadCoefficients |
| Normalized direct-form biquad coefficients with a0 folded into all terms. More... | |
| struct | RADDsp::BiquadState |
| Stateful direct-form biquad delay elements. More... | |
| struct | RADDsp::EqualizerBand |
| One 16-band equalizer band setting. More... | |
| class | RADDsp::BiquadCascade |
| Stateful cascade of biquad sections. More... | |
| class | RADDsp::Equalizer16Band |
| 16-band peaking-EQ built from a biquad cascade. More... | |
| struct | RADDsp::StereoFrame |
| One stereo audio frame used by stateful real-time effects. More... | |
| struct | RADDsp::DelaySettings |
| Shared settings for stereo delay-line effects. More... | |
| class | RADDsp::DigitalDelay |
| Clean stereo delay with fractional delay reads and optional cross-feedback. More... | |
| struct | RADDsp::AnalogDelaySettings |
| Extra controls for tape/analog-style modulated stereo delay. More... | |
| class | RADDsp::AnalogModDelay |
| Stereo modulated delay with low-pass feedback and soft saturation. More... | |
Namespaces | |
| RADDsp | |
Functions | |
| void | RADDsp::applyGain (std::vector< float > &samples, float gain) |
| Multiplies every scalar sample by gain in place. More... | |
| std::vector< float > | RADDsp::mix (const std::vector< float > &a, const std::vector< float > &b) |
| Adds two scalar buffers sample-by-sample; extra tail samples are preserved from the longer input. More... | |
| float | RADDsp::peak (const std::vector< float > &samples) |
| Returns the absolute peak amplitude in a scalar sample buffer. More... | |
| float | RADDsp::rms (const std::vector< float > &samples) |
| Returns root-mean-square amplitude for a scalar sample buffer. More... | |
| void | RADDsp::normalizePeak (std::vector< float > &samples, float targetPeak=1.0f) |
| Scales samples so their absolute peak equals targetPeak when possible. More... | |
| std::vector< float > | RADDsp::sine (float frequencyHz, float seconds, uint32_t sampleRate, float amplitude=1.0f) |
| Generates a sine wave at frequencyHz for seconds at sampleRate. More... | |
| std::vector< float > | RADDsp::whiteNoise (size_t count, float amplitude=1.0f, uint32_t seed=0x524144u) |
| Generates deterministic white noise using seed for repeatable tests and examples. More... | |
| std::vector< float > | RADDsp::linearResample (const std::vector< float > &interleaved, uint16_t channels, uint32_t sourceRate, uint32_t targetRate) |
| Resamples interleaved scalar audio using linear interpolation. More... | |
| std::vector< std::vector< float > > | RADDsp::deinterleave (const std::vector< float > &interleaved, uint16_t channels) |
| Splits interleaved channel data into one vector per channel. More... | |
| std::vector< float > | RADDsp::interleave (const std::vector< std::vector< float >> &channels) |
| Combines per-channel buffers into interleaved channel order. More... | |
| std::vector< float > | RADDsp::magnitude (const std::vector< ComplexSample > &samples) |
| Converts complex I/Q samples to magnitude values. More... | |
| std::vector< float > | RADDsp::phase (const std::vector< ComplexSample > &samples) |
| Converts complex I/Q samples to phase values in radians. More... | |
| void | RADDsp::applyGain (std::vector< ComplexSample > &samples, float gain) |
| Multiplies every complex sample by gain in place. More... | |
| std::vector< ComplexSample > | RADDsp::frequencyShift (const std::vector< ComplexSample > &samples, float frequencyHz, uint32_t sampleRate) |
| Frequency-shifts complex I/Q samples by frequencyHz at sampleRate. More... | |
| std::vector< float > | RADDsp::hannWindow (size_t count) |
| Builds a Hann window with count coefficients. More... | |
| std::vector< float > | RADDsp::hammingWindow (size_t count) |
| Builds a Hamming window with count coefficients. More... | |
| std::vector< float > | RADDsp::blackmanWindow (size_t count) |
| Builds a Blackman window with count coefficients. More... | |
| std::vector< float > | RADDsp::rectangularWindow (size_t count) |
| Builds a rectangular window with count coefficients. More... | |
| void | RADDsp::applyWindow (std::vector< float > &samples, const std::vector< float > &window) |
| Applies a window to samples in place up to the smaller buffer size. More... | |
| std::vector< float > | RADDsp::firFilter (const std::vector< float > &samples, const std::vector< float > &taps) |
| Applies an FIR filter using taps and returns filtered samples. More... | |
| std::vector< float > | RADDsp::convolve (const std::vector< float > &a, const std::vector< float > &b) |
| Convolves two scalar buffers using an FFT-based implementation. More... | |
| std::vector< float > | RADDsp::crossCorrelate (const std::vector< float > &a, const std::vector< float > &b) |
| Cross-correlates a and b using FFT-based convolution with reversed b. More... | |
| std::vector< float > | RADDsp::normalizedCrossCorrelate (const std::vector< float > &a, const std::vector< float > &b) |
| Cross-correlates and normalizes by signal energy when possible. More... | |
| std::vector< float > | RADDsp::onePoleLowPass (const std::vector< float > &samples, float alpha) |
| Applies a simple one-pole low-pass filter with alpha in the 0..1 smoothing range. More... | |
| FftPlan | RADDsp::createFftPlan (size_t size) |
| Creates a reusable FFT plan for power-of-two sizes. More... | |
| std::vector< ComplexSample > | RADDsp::fft (const std::vector< ComplexSample > &samples, bool inverse=false) |
| Computes a complex FFT for power-of-two sizes and DFT fallback otherwise. More... | |
| std::vector< std::vector< ComplexSample > > | RADDsp::fftMany (const std::vector< std::vector< ComplexSample >> &frames, bool inverse=false) |
| Computes many equal-sized power-of-two FFTs using one reusable plan. More... | |
| std::vector< ComplexSample > | RADDsp::fftFrames (const std::vector< ComplexSample > &frames, size_t frameSize, bool inverse=false) |
| Computes many contiguous equal-sized power-of-two FFT frames using one reusable plan. More... | |
| std::vector< float > | RADDsp::magnitudeSpectrum (const std::vector< ComplexSample > &spectrum) |
| Converts complex spectrum bins to magnitudes. More... | |
| std::vector< float > | RADDsp::powerSpectrum (const std::vector< ComplexSample > &spectrum) |
| Converts complex spectrum bins to power values. More... | |
| std::vector< float > | RADDsp::designLowPassFIR (size_t taps, float cutoffHz, uint32_t sampleRate) |
| Designs a windowed-sinc low-pass FIR filter. More... | |
| BiquadCoefficients | RADDsp::designBiquadLowPass (float cutoffHz, uint32_t sampleRate, float q=0.70710678f) |
| Designs an RBJ low-pass biquad. More... | |
| BiquadCoefficients | RADDsp::designBiquadHighPass (float cutoffHz, uint32_t sampleRate, float q=0.70710678f) |
| Designs an RBJ high-pass biquad. More... | |
| BiquadCoefficients | RADDsp::designBiquadBandPass (float centerHz, uint32_t sampleRate, float q=1.0f) |
| Designs an RBJ band-pass biquad. More... | |
| BiquadCoefficients | RADDsp::designBiquadNotch (float centerHz, uint32_t sampleRate, float q=1.0f) |
| Designs an RBJ notch biquad. More... | |
| BiquadCoefficients | RADDsp::designBiquadPeakingEQ (float centerHz, uint32_t sampleRate, float gainDb, float q=1.0f) |
| Designs an RBJ peaking equalizer biquad. More... | |
| std::vector< float > | RADDsp::decimate (const std::vector< float > &samples, size_t factor) |
| Keeps every factor-th sample after low-pass filtering should be applied by caller when needed. More... | |
| std::vector< float > | RADDsp::interpolateZeros (const std::vector< float > &samples, size_t factor) |
| Inserts factor-1 zeros between samples. More... | |
| std::vector< float > | RADDsp::mixCosine (const std::vector< float > &samples, float frequencyHz, uint32_t sampleRate) |
| Mixes scalar samples with a cosine oscillator. More... | |
| void | RADDsp::automaticGainControl (std::vector< float > &samples, float targetRms=0.25f, float maxGain=32.0f) |
| Applies simple automatic gain control toward targetRms. More... | |
| MatrixF | RADDsp::identityMatrix (size_t size) |
| Builds a square identity matrix. More... | |
| MatrixF | RADDsp::diagonalMatrix (const std::vector< float > &diagonal) |
| Builds a diagonal matrix from diagonal values. More... | |
| MatrixF | RADDsp::transpose (const MatrixF &matrix) |
| Returns the transpose of matrix. More... | |
| MatrixF | RADDsp::add (const MatrixF &a, const MatrixF &b) |
| Adds matrices with matching dimensions, or returns an empty matrix. More... | |
| MatrixF | RADDsp::subtract (const MatrixF &a, const MatrixF &b) |
| Subtracts matrices with matching dimensions, or returns an empty matrix. More... | |
| MatrixF | RADDsp::scale (const MatrixF &matrix, float scalar) |
| Multiplies every matrix value by scalar. More... | |
| MatrixF | RADDsp::hadamard (const MatrixF &a, const MatrixF &b) |
| Multiplies matching matrix elements, or returns an empty matrix. More... | |
| MatrixF | RADDsp::multiply (const MatrixF &a, const MatrixF &b) |
| Multiplies two dense matrices, or returns an empty matrix for incompatible dimensions. More... | |
| std::vector< float > | RADDsp::multiply (const MatrixF &matrix, const std::vector< float > &vector) |
| Multiplies a dense matrix by a vector, or returns an empty vector for incompatible dimensions. More... | |
| std::vector< float > | RADDsp::multiply (const MatrixF &matrix, std::initializer_list< float > vector) |
| Multiplies a dense matrix by an initializer-list vector. More... | |
| float | RADDsp::dot (const std::vector< float > &a, const std::vector< float > &b) |
| Returns the dot product of equal-size vectors, or 0 for mismatched sizes. More... | |
| float | RADDsp::l2Norm (const std::vector< float > &vector) |
| Returns the Euclidean norm of vector. More... | |
| std::vector< float > | RADDsp::normalizeVector (const std::vector< float > &vector) |
| Returns a normalized copy of vector, or zeros for zero-length input energy. More... | |
| MatrixF | RADDsp::outerProduct (const std::vector< float > &a, const std::vector< float > &b) |
| Builds the outer product a * b^T. More... | |
| MatrixF | RADDsp::covarianceMatrix (const MatrixF &observations) |
| Computes a covariance matrix from row-major observations where each row is one observation. More... | |
| bool | RADDsp::invert (const MatrixF &matrix, MatrixF &inverse, float epsilon=1.0e-6f) |
| Computes the inverse of a square matrix with partial pivoting. More... | |
| bool | RADDsp::solveLinearSystem (const MatrixF &matrix, const std::vector< float > &rhs, std::vector< float > &solution, float epsilon=1.0e-6f) |
| Solves matrix * x = rhs using Gaussian elimination with partial pivoting. More... | |
Reusable DSP primitives for audio, SDR/IQ, plotting, and analysis.