http://www.musicdsp.org/en/latest/Filte ... lp-hp.html
here is the code in question, there are some revisions posted in the link as well:
Code: Select all
void SetLPF(float fCut, float fSampling)
{
float w = 2.0 * fSampling;
float Norm;
fCut *= 2.0F * PI;
Norm = 1.0 / (fCut + w);
b1 = (w - fCut) * Norm;
a0 = a1 = fCut * Norm;
}
void SetHPF(float fCut, float fSampling)
{
float w = 2.0 * fSampling;
float Norm;
fCut *= 2.0F * PI;
Norm = 1.0 / (fCut + w);
a0 = w * Norm;
a1 = -a0;
b1 = (w - fCut) * Norm;
}
Where
out[n] = in[n]*a0 + in[n-1]*a1 + out[n-1]*b1;
How are the coefficients being set here? Is it something like an approximation to using exp by using two terms of a Taylor series?
I was wondering, because it looks completely unfamiliar to me.
Thanks for any help