I tried to implement a 4th order chebyshev-IIR-filter (IIR Form I), but all i get from it is digital white noise (or artefacts). Can anyone help me out?
Please have a look at the code:
Code: Select all
for (int32 i = 0; i < numChannels; i++)
{
int32 sampleFrames = data.numSamples;
float* ptrIn = in[i];
float* ptrOut = out[i];
float tmp;
// el coefficientes
float a0 = 0.0042412407f;
float a1 = 0.016964963f;
float a2 = 0.025447443f;
float a3 = 0.016964963f;
float a4 = 0.0042412407f;
float b0 = 1.f;
float b1 = -2.7280328f;
float b2 = 3.2549775f;
float b3 = -1.9259477f;
float b4 = 0.47514287f;
while (--sampleFrames >= 0)
{
// apply gain
tmp=(*ptrIn++);
(*ptrOut++) = (b0*tmp+b1*hist1+b2*hist2+b3*hist3+b4*hist4)/(a0*tmp+a1*hist1+a2*hist2+a3*hist3+a4*hist4);
hist3=hist2;
hist2=hist1;
hist1=tmp;
}
}Thanks for your help.
André


