Skip to main content

Module math

Module math 

Source
Expand description

Math utilities for audio processing.

Macros§

nz
Utility macro for getting a NonZero from a literal. Especially useful for passing in ChannelCount and Samplerate. Equivalent to: const { core::num::NonZero::new($n).unwrap() }

Constants§

E
Euler’s number (e)
LN_2
ln(2)
LN_10
ln(10)
LOG2_10
log2(10)
LOG2_E
log2(e)
LOG10_2
log10(2)
LOG10_E
log10(e)
PI
Archimedes’ constant (π)
TAU
The full circle constant (τ)

Functions§

db_to_linear
Converts decibels to linear amplitude scale.
linear_to_db
Converts linear amplitude scale to decibels.