[PD-dev] ggee: equalizer - bug?

Ben Saylor bsaylor at Macalester.edu
Tue Nov 26 09:04:25 CET 2002


Hi Guenter + all,

I was trying to build a graphic EQ using a chain of RBJ peaking filters
(inspired by a message on music-dsp) and noticed that ggee's equalizer
object doesn't seem to generate the right coefficients.  I'm guessing
it's supposed to be the peakingEQ from
http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt.
The code in question is (ggee/filters/equalizer.c)

	t_float b0 = 1 + alpha*e_A(x->x_gain);
	t_float b1 = -2.*cos(omega);
	t_float b2 = 1;
	t_float a0 = 1 + alpha;
	t_float a1 = -2.*cos(omega);
	t_float a2 = 1 - alpha;

but I think it should be

	t_float b0 = 1 + alpha * e_A(x->x_gain);
	t_float b1 = -2. * cos(omega);
	t_float b2 = 1 - alpha * e_A(x->x_gain);
	t_float a0 = 1 + alpha / e_A(x->x_gain);
	t_float a1 = -2. * cos(omega);
	t_float a2 = 1 - alpha / e_A(x->x_gain);

After changing these lines, it behaves as expected (as a peaking filter,
while before it was a funny-shaped peak with a notch beside it).

Ben




More information about the Pd-dev mailing list