inverseFilter

Linear maximum changerate filter. Limits the rise/fall of the input signal, adding harmonics to the signal. Eg. a sine turns into a triangle.
Author: Remco van der Most
License: BSD
Github: sss/filter/inverseFilter.axo

Inlets

frac32buffer input

Outlets

frac32buffer output

Parameters

frac32.u.map rate

Declaration
int32_t val;
int32_t prev;
Init
val = 0;
Audio Rate
int32_t diff = inlet_in - val;
int32_t sign = diff > 0 ? 1 : -1;
diff = diff > 0 ? diff : -diff;
int32_t freq = ___SMMUL(param_rate << 3, param_rate << 2);
freq = ___SMMUL(freq << 3, freq << 2);
diff = diff > freq ? freq : diff;
diff = diff * sign;
val += diff;

outlet_out = val;
prev = inlet_in;

Privacy

© 2024 Zrna Research