Hey guys, I was working with maximilian and saw the low and high pass filters, I looking for where i can read or get an explanation of the actual computation thats actually happening. I know the low pass and high pass are essentially the same and that the lowres and hires is the same, but its more again of the computational part, like what the variables mean? and how you would go about calculating the filters and what not.
double maxiFilter::lopass(double input, double cutoff) {
output=outputs[0] + cutoff*(input-outputs[0]);
outputs[0]=output;
return(output);
}
//as above
double maxiFilter::hipass(double input, double cutoff) {
output=input-(outputs[0] + cutoff*(input-outputs[0]));
outputs[0]=output;
return(output);
}
//awesome. cuttof is freq in hz. res is between 1 and whatever. Watch out!
double maxiFilter::lores(double input,double cutoff1, double resonance) {
cutoff=cutoff1;
if (cutoff<10) cutoff=10;
if (cutoff>(maxiSettings::sampleRate)) cutoff=(maxiSettings::sampleRate);
if (resonance<1.) resonance = 1.;
z=cos(TWOPI*cutoff/maxiSettings::sampleRate);
c=2-2*z;
double r=(sqrt(2.0)*sqrt(-pow((z-1.0),3.0))+resonance*(z-1))/(resonance*(z-1));
x=x+(input-y)*c;
y=y+x;
x=x*r;
output=y;
return(output);
}
//working hires filter
double maxiFilter::hires(double input,double cutoff1, double resonance) {
cutoff=cutoff1;
if (cutoff<10) cutoff=10;
if (cutoff>(maxiSettings::sampleRate)) cutoff=(maxiSettings::sampleRate);
if (resonance<1.) resonance = 1.;
z=cos(TWOPI*cutoff/maxiSettings::sampleRate);
c=2-2*z;
double r=(sqrt(2.0)*sqrt(-pow((z-1.0),3.0))+resonance*(z-1))/(resonance*(z-1));
x=x+(input-y)*c;
y=y+x;
x=x*r;
output=input-y;
return(output);
}
Sorry for all the questions in advance.