Vokbuz wrote: ↑Mon Oct 11, 2021 10:21 am Please show your "process" method.
For http://www.earlevel.com/main/2016/12/08 ... e-grapher/ try this:
a coefficients (zeros):
0.7921204236492381
1.0
b coefficients (poles):
1.0
0.20787957635076193
Code: Select all
// Process methods
// IIR processing
T Process(T in, int channel) {
assert(channel < MAXNUMCHANNELS);
switch (mType)
{
case OnepoleHighpass:
z1[channel] = in * a0 + z1[channel] * b1;
in -= z1[channel];
return in;
break;
case OnepoleLowpass:
z1[channel] = in * a0 + z1[channel] * b1;
return z1[channel];
break;
default: // for all two poles
double out = in * a0 + z1[channel];
z1[channel] = in * a1 + z2[channel] - b1 * out;
z2[channel] = in * a2 - b2 * out;
return out;
break;
}
} // Process one sample
void ProcessBlock(T** inputs, T** outputs, int nChans, int nFrames) {
for (auto c = 0; c < nChans; c++)
{
for (auto s = 0; s < nFrames; s++)
{
Process(inputs[c][s], c);
}
}
} // Process entire buffer