I’m trying to do a simple resonator as a biquad filter. The thing works in principle, however when changing sample rate, the gain changes vastly.
The thing was derived as a direkt zero pole diagram with zeros on zero and poles at
radius * e^(+-i*omega)
with radius < 1.
The filter coefficients then read
m_b0 = 1 m_b1 = 0; m_b2 = 0; m_a1 = -2 * m_radius * cos(2 * M_PI * m_freq / m_samplerate); m_a2 = m_radius * m_radius;
m_a0 is normalized as 1.
What am I doing wrong? If these coefficients are right then the biquad implementation is probably wrong, but I can’t find an error in neither.