Expand description
§Mathematical abstractions and utilities for DSP
This module combines:
- Numeric types (
Transcendental) for f32/f64 abstraction - Conversion between linear scales and dB
- Fast math functions (tanh, sin, exp)
- Signal generation (sine, saw, square)
- Window functions for granular synthesis
- Interpolation and smoothing
Structs§
- Smoother
- Exponential smoothing (one-pole filter)
Functions§
- blackman_
window - Blackman window
- cubic_
interpolate - Cubic interpolation (Hermite)
- db_
to_ linear - Convert decibels to linear coefficient
- fast_
exp - Fast exponential approximation (Padé approximant)
- fast_
sin - Fast sine approximation (Taylor series)
- fast_
tanh - Fast tanh approximation (Padé approximant)
- freq_
to_ midi - Convert frequency to MIDI note
- hamming_
window - Hamming window
- hann_
window - Hann window
- lagrange_
interpolate - Least-squares interpolation (for fractional delays)
- lerp
- Linear interpolation
- linear_
to_ db - Convert linear coefficient to decibels
- midi_
to_ freq - Convert MIDI note to frequency
- samples_
to_ seconds - Convert samples to seconds
- saw_
phase - Generate sawtooth wave (phase 0..1)
- seconds_
to_ samples - Convert seconds to samples
- sine_
phase - Generate sine wave (phase 0..1)
- soft_
clip - Soft clipping (wave shaping)
- square_
phase - Generate square wave (phase 0..1, pulse_width 0..1)
- triangle_
phase - Generate triangle wave (phase 0..1)
- variable_
window - Variable-shape window (0 = rectangular, 1 = Hann)