Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
exp_mod.hpp File Reference

Exponential modulation converter. More...

Detailed Description

Exponential modulation converter.

exp_mod() maps a normalized modulation signal, typically [-1.0, 1.0], to a frequency in Hz as base * 2^(mod * depth), so equal steps of the signal give equal intervals at any base frequency.

// Scalar, inside a per-sample loop
float freq = sbl::dsp::math::exp_mod(cutoff_hz, lfo_value, 2.0f);
// Buffer, over a whole modulation buffer
float freq_buf[48];
sbl::dsp::math::exp_mod(lfo_buf, freq_buf, frames, cutoff_hz, 2.0f);
float exp_mod(float base, float mod, float depth, float lo=DEFAULT_LO_HZ, float hi=DEFAULT_HI_HZ)
Apply exponential modulation to a base frequency (scalar).
Definition exp_mod.hpp:49

Definition in file exp_mod.hpp.

#include <cstdint>
#include <sbl/dsp/math/fast_math.hpp>

Go to the source code of this file.

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::dsp
 The audio stack.
 
namespace  sbl::dsp::math
 Math for the audio stack.
 

Functions

float sbl::dsp::math::exp_mod (float base, float mod, float depth, float lo=DEFAULT_LO_HZ, float hi=DEFAULT_HI_HZ)
 Apply exponential modulation to a base frequency (scalar).
 
void sbl::dsp::math::exp_mod (const float *mod, float *freq_out, uint16_t frames, float base, float depth, float lo=DEFAULT_LO_HZ, float hi=DEFAULT_HI_HZ)
 Apply exponential modulation to a buffer.
 

Variables

constexpr float sbl::dsp::math::DEFAULT_LO_HZ = 20.0f
 
constexpr float sbl::dsp::math::DEFAULT_HI_HZ = 20000.0f