I figured out a 6db hi pass from this filter but i am wondering which part of the equation describes the feedback loop in order to try out different saturators? Is it literally just saturate the input?
something like in = 2*tanh(in*drive/2);
Code: Select all
void setParams(double newSampleRate, double newCutoff, double newRes) {
sampleRate = newSampleRate;
cutoff = newCutoff;
g = tan(M_PI*cutoff/sampleRate);
res = newRes;
k = 2*res;
a0 = 1.0/(pow((1.0 + g),2.0) - g*k);
a1 = k*a0;
a2 = (1 + g)*a0;
a3 = g*a2;
a4 = g*a0;
a5 = g*a4;
}
double process(double in) {
v1 = a1*ic2eq + a2*ic1eq + a3*in;
v2 = a2*ic2eq + a4*ic1eq + a5*in;
hi = in-v1;
ic1eq = 2*(v1 - k*v2) - ic1eq;
ic2eq = 2*(v2) - ic2eq;
low = v2;
return low;
}
