lpfbcomb filter sdram

Freverb style lowpass feedback comb filter 32bit SDRAM
Author: Johannes Taelman/Jani Frilander
License: BSD
Github: janifr/lpfbcomb filter sdram.axo

Inlets

frac32.positive fb

frac32.positive damp

frac32buffer in

Outlets

frac32buffer out

Attributes

spinner delay

Declaration
int32_t *d;
int dpos;
int32_t filter;
Init
static int32_t _array[attr_poly][attr_delay] __attribute__((section(".sdram")));
d = &_array[parent->polyIndex][0];
int i;
for (i = 0; i < attr_delay; i++)
  d[i] = 0;
dpos = 0;
filter = 0;
Control Rate
// int32_t a2 = param_a<<4;
// int32_t b2 = param_b<<4;
int32_t fb = inlet_fb << 4;
int32_t damp1 = inlet_damp << 4;
int32_t damp2 = 0x7ffffff0 - damp1;
Audio Rate
int32_t dout = d[dpos];
// int32_t dout = 0x7ffffff;
filter = ___SMMUL(damp2, dout);
filter = ___SMMLA(damp1, filter << 1, filter);
// outlet_diag = filter;
// int32_t din = ___SMMUL(b2,inlet_in);
// din = ___SMMLA(a2,dout,din);
// d[dpos++]=din>>15;
// int32_t t=___SMMLA(fb,filter<<1,inlet_in);
d[dpos++] = ___SMMLA(fb, filter << 1, inlet_in);
outlet_out = dout;
if (dpos == attr_delay)
  dpos = 0;

Privacy

© 2024 Zrna Research