Skip to main content

Module math

Module math 

Source
Expand description

Mathematical abstractions for signal processing

§Mathematical abstractions

This module provides:

  • Scalar — base numeric trait for all types (including integers)
  • Transcendental — Scalar extension with trigonometry (f32/f64)
  • Common mathematical functions (lerp, db conversion, etc.)
  • Vector operations through the vector submodule
  • Fast approximations for DSP

Modules§

vector
Vector operations for DSP

Traits§

Scalar
Base numeric trait for all scalar types.
Transcendental
Transcendental operations (sin, cos, sqrt, exp, ln).

Functions§

db_to_linear
Convert decibels to a linear coefficient
fast_tanh
Fast tanh approximation
freq_to_midi
Convert frequency to a MIDI note
hann_window
Hann window
lerp
Linear interpolation
linear_to_db
Convert a linear coefficient to decibels
midi_to_freq
Convert a MIDI note to frequency
samples_to_seconds
Convert samples to seconds
seconds_to_samples
Convert seconds to samples
soft_clip
Soft clipping