lphp1

1st order lowpass filter and high pass filter. Based on scale and square discretization (better HP filter).
Author: Smashed Transistors
License: LGPL
Github: tiar/filter/lphp1.axo

Inlets

frac32buffer input

frac32.bipolar pitch

Outlets

frac32buffer output

frac32buffer hp

Parameters

frac32.s.map.pitch pitch

Declaration
int32_t lp;
Init
lp = 0;
Control Rate
// krate
uint32_t F;
MTOFEXTENDED(param_pitch + inlet_pitch, F);

int32_t a = (1 << 30) - (F >> (2 + 4));
for (int i = 0; i < 6; i++) {
  a = ___SMMUL(a, a) << 2;
}
a = (1 << 30) - a;
Audio Rate
outlet_lp = lp = ___SMMLA(a, inlet_in - lp, lp >> 2) << 2;
outlet_hp = inlet_in - lp;

Privacy

© 2024 Zrna Research