Skip to content

Commit

Permalink
added SVF (zero-delay fb) for normalised BP filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
dariosanfilippo committed May 7, 2020
1 parent 9cf5951 commit aa915bb
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions suppression.lib
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,54 @@ with {

// Invert phase at cut-off
phase_invert(cf, x) = allpass(cf, x) : allpass(cf);

// 2p2z state-variable filter with zero-delay feedback topology
// inputs are cutoff, Q, shelving boost (linear amp.), input signal
// outputs are LP, HP, BP, BP_normalised, LS, HS, BS, notch, peak, AP
svf2blti(cf, q, k, in) = tick
~ ( _,
_) : ( !,
!,
_,
_,
_,
_,
_,
_,
_,
_,
_,
_)
with {
r = 1/2*(1/q);
g = m2.w(cf)/2;
tick(s1, s2) = u1,
u2,
lp,
hp,
bp,
bp_norm,
ls,
hs,
b_shelf,
notch,
peak,
ap
with {
u1 = v1+bp;
u2 = v2+lp;
v1 = hp*g;
v2 = bp*g;
hp = (in-s1*(2*r+g)-s2)/(1+2*r+g*g);
bp = s1+v1;
lp = s2+v2;
bp_norm = bp*2*r;
b_shelf = in+k*bp_norm;
ls = in+k*lp;
hs = in+k*hp;
notch = in-bp_norm;
ap = in-4*r*bp;
peak = lp-hp;
};
};

0 comments on commit aa915bb

Please sign in to comment.