DSPRelated.com
Forums

Symmetric boost and cut Equlizer using bandpass filters

Started by Unknown December 3, 2007
Hi,

I am trying to implement Symmetric boost and cut digital Equlizer
using bandpass filters.  I found this link which has some help:
http://72.14.235.104/search?q=cache:UIvZnXeDalgJ:www.freepatentsonline.com/5524022.html+symmetric+response+bandpass+filters+for+graphic+equalizer&hl=en&ct=clnk&cd=1&gl=in

In fact I did implement in Matlab.  But for -ve gains, output is
incorrect.  (gain is applied after the bandpass filter.).  Actually I
am still not clear how to calculate "k1" as given in Fig.14 of that
document.

I am using bandpass-butterworth-IIR-biquads; where b1=0 (in
b0*x0+b1*x1+b2*x2-a1*y1-a2*y2)

Has anybody implemented this before? Or any other general symmetric
cut-boost bandpass equalizer design? Help please!

Thanks,
Balaji
This might be useful:
http://musicdsp.org/files/Audio-EQ-Cookbook.txt

-Markus
<subscribemehere@yahoo.co.in> escribi&#4294967295; en el mensaje 
news:cfb41a00-f558-4317-8a66-1e9ac1bebbe9@a35g2000prf.googlegroups.com...
> Hi, > > I am trying to implement Symmetric boost and cut digital Equlizer > using bandpass filters. I found this link which has some help: > http://72.14.235.104/search?q=cache:UIvZnXeDalgJ:www.freepatentsonline.com/5524022.html+symmetric+response+bandpass+filters+for+graphic+equalizer&hl=en&ct=clnk&cd=1&gl=in > > In fact I did implement in Matlab. But for -ve gains, output is > incorrect. (gain is applied after the bandpass filter.). Actually I > am still not clear how to calculate "k1" as given in Fig.14 of that > document. > > I am using bandpass-butterworth-IIR-biquads; where b1=0 (in > b0*x0+b1*x1+b2*x2-a1*y1-a2*y2) > > Has anybody implemented this before? Or any other general symmetric > cut-boost bandpass equalizer design? Help please! > > Thanks, > Balaji
Hi, k1 is the linear gain, which you derive from gain in decibels k = 10^(G/20) - 1; Still, there seems to be a flaw on the way they moved from fig 13 to fig 14, equation (7) to (8). I would like to discuss here the validity of the authors' deduction for the new structure. It is like if you could completely remove a zero from the IIR filter by multiplying the whole filter for a new gain. The signal m1 in figure 13 is NOT the same signal m1 as in figure 14. How could the authors make it work? Still, I am awaiting for some comments on this document too. Regards, -- Jaime Andres Aranguren C. SanJaaC Electronics Soluciones en DSP www.sanjaac.com -- Posted via a free Usenet account from http://www.teranews.com
On Dec 3, 6:24 pm, "Jaime Andres Aranguren Cardona" <j...@nospam-
sanjaac.com> wrote:
> <subscribemeh...@yahoo.co.in> escribi&#4294967295; en el mensajenews:cfb41a00-f558-4317-8a66-1e9ac1bebbe9@a35g2000prf.googlegroups.com... > > > Hi, > > > I am trying to implement Symmetric boost and cut digital Equlizer > > using bandpass filters. I found this link which has some help: > >http://72.14.235.104/search?q=cache:UIvZnXeDalgJ:www.freepatentsonlin... > > > In fact I did implement in Matlab. But for -ve gains, output is > > incorrect. (gain is applied after the bandpass filter.). Actually I > > am still not clear how to calculate "k1" as given in Fig.14 of that > > document. > > > I am using bandpass-butterworth-IIR-biquads; where b1=0 (in > > b0*x0+b1*x1+b2*x2-a1*y1-a2*y2) > > > Has anybody implemented this before? Or any other general symmetric > > cut-boost bandpass equalizer design? Help please! > > > Thanks, > > Balaji > > Hi, > > k1 is the linear gain, which you derive from gain in decibels > > k = 10^(G/20) - 1; > > Still, there seems to be a flaw on the way they moved from fig 13 to fig 14, > equation (7) to (8). I would like to discuss here the validity of the > authors' deduction for the new structure. It is like if you could completely > remove a zero from the IIR filter by multiplying the whole filter for a new > gain. The signal m1 in figure 13 is NOT the same signal m1 as in figure 14. > > How could the authors make it work? > > Still, I am awaiting for some comments on this document too. > > Regards, > > -- > > Jaime Andres Aranguren C. > SanJaaC Electronics > Soluciones en DSPwww.sanjaac.com
Yes. This is the equation I too used: k = 10^(G/20) - 1; in fact, "gain" values at the peak are perfect for both +ve and -ve. problem is with Q. Q changes a lot for -ve gain cases (phase problem). As you pointed out doubt is with "m1" and how is figure14 got from figure13. Waiting for respose ... Balaji
On Dec 3, 8:24 am, "Jaime Andres Aranguren Cardona" <j...@nospam-
sanjaac.com> wrote:
> <subscribemeh...@yahoo.co.in> escribi&#4294967295; en el mensajenews:cfb41a00-f558-4317-8a66-1e9ac1bebbe9@a35g2000prf.googlegroups.com... > > > > > Hi, > > > I am trying to implement Symmetric boost and cut digital Equlizer > > using bandpass filters. I found this link which has some help: > >http://72.14.235.104/search?q=cache:UIvZnXeDalgJ:www.freepatentsonlin... > > > In fact I did implement in Matlab. But for -ve gains, output is > > incorrect. (gain is applied after the bandpass filter.). Actually I > > am still not clear how to calculate "k1" as given in Fig.14 of that > > document. > > > I am using bandpass-butterworth-IIR-biquads; where b1=0 (in > > b0*x0+b1*x1+b2*x2-a1*y1-a2*y2) > > > Has anybody implemented this before? Or any other general symmetric > > cut-boost bandpass equalizer design? Help please! > > > Thanks, > > Balaji > > Hi, > > k1 is the linear gain, which you derive from gain in decibels > > k = 10^(G/20) - 1; > > Still, there seems to be a flaw on the way they moved from fig 13 to fig 14, > equation (7) to (8). I would like to discuss here the validity of the > authors' deduction for the new structure. It is like if you could completely > remove a zero from the IIR filter by multiplying the whole filter for a new > gain. The signal m1 in figure 13 is NOT the same signal m1 as in figure 14. >
i tried the USPTO site: http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&r=1&f=G&l=50&s1=5524022.PN.&OS=PN/5524022&RS=PN/5524022 and i still couldn't view the images (i'm using linux, and Firefox says there is a missing plugin, but i can't figure out what it is and how to get it). anyway, i want to say a few things about the subject. i'm gonna borrow from the audio EQ cookbook, but i'll try to keep some consistency with the above. another reference is: http://ccrma.stanford.edu/~jos/filters/Peaking_Equalizers.html . implementing a 2nd-order parametric (boost/cut) EQ can always be modeled by 2nd-order BPF, with gain, in parallel to a wire: .-----. .---. in ----*---->| BPF |------>| k |------>(+)----> out | '-----' '---' ^ | | '--------------------------------' where k = 10^(G/20) - 1 as above. the resonant frequency of the BPF is the center frequency of the boost/cut of the parametric EQ (w0). the bandwidth (BW) and Q of the parametric EQ can be defined a variety of way, and the only difference between designs ultiimately ends up as being a simple difference in this definition of BW or Q. if you have a BPF and you measure or define Q the traditional EE and relate that to bandwidth defined the traditional EE manner (the spacing between the -3.01 dB bandedges) except to express the bandwidth in octaves instead of Hz, the relationship between Q and BW is: 1/Q = 2*sinh( ln(2)/2*BW ) but, if we are mapping these analog designs to digital using the bilinear transform, the BW (for a given Q) gets squished a little and a first-order approximation to unsquishing the BW results in this Q <--
> BW mapping:
1/Q = 2*sinh( ln(2)/2*BW * w0/sin(w0) ) commonly, the Q of the parametric EQ is defined simply as the Q of the BPF that is in parallel to the wire. this is common in the analog parametric EQs that have been around for more than a half century. if you represent the overall transfer function as: b0 + b1*z^-1 + b2*z^-2 H(z) = ------------------------ a0 + a1*z^-1 + a2*z^-2 there really are only 5 degrees of freedom so usually you'll normalize them by dividing by a0: (b0/a0) + (b1/a0)*z^-1 + (b2/a0)*z^-2 H(z) = --------------------------------------- 1 + (a1/a0)*z^-1 + (a2/a0)*z^-2 for the boost/cut parametric with Q defined to be the same as the BPF Q, the coefficients come out to be: b0 = 1 + (k+1)*sin(w0)/(2*Q) b1 = -2*cos(w0) b2 = 1 - (k+1)*sin(w0)/(2*Q) a0 = 1 + sin(w0)/(2*Q) a1 = -2*cos(w0) a2 = 1 - sin(w0)/(2*Q) but the problem with this is that is that the boost and cut are not symmetrical (and i cannot find a drawing on the web that shows this). from its *appearance*, the BW of the cut filters (of the same Q, same w0, and opposite dB) is squished in comparison to the BW of the boost filter. if you want your boost/cut behavior to be symmetrical, you must fudge the meaning of "Q", either in the boost, or in the cut, or a little in both. usually the audio guys like the above definition for the boost case (where k+1 > 1). if you want a symmetrical cut (where k+1 < 1), simply switch the numerator and denominator coefficients around from the boost filter (with dB boost equal to the dB cut you want). then you have two filters with transfer functions that are reciprocals of each other and will multiply each other to get one. for 0 < k+1 < 1: b0 = 1 + sin(w0)/(2*Q) b1 = -2*cos(w0) b2 = 1 - sin(w0)/(2*Q) a0 = 1 + (1/(k+1))*sin(w0)/(2*Q) a1 = -2*cos(w0) a2 = 1 - (1/(k+1))*sin(w0)/(2*Q) lastly, a point i've been repeatedly trying to make for at least 13 years ( http://musicdsp.org/files/EQ-Coefficients.pdf ) is: 1. you have only 5 degrees of freedom regarding the design of the coefficients to implement a 2nd-order paramtric boost/cut filter or *any* 2nd-order IIR filter. 2. 4 of the 5 degrees of freedom are nailed down with NO MENTION OF BANDWIDTH OR Q. 3. so the remaining degree of freedom is the only one that can be a function of Q or bandwidth. 4. then any design of a biquad parametric boost/cut EQ that agrees with some other completely independent design of a biquad parametric boost/cut EQ filter in all of the parameters can have its only difference in behavior or shape in its Q (or bandwidth). 5. if two different design methods can agree in the spec by what they mean by "bandwidth" or Q (and, axiomatically, they agree in the spec about the other 4 specs or "degrees of freedom") then they MUST come up with the same 5 normalized coefficients. so, even though the procedures and math for the different design methods may not appear identical, THEY ARE EQUIVALENT except for possibly how they define Q or BW and that is only an issue of definition. so, i would recommend designing the biquad boost/cut parametric EQ using the simplest mathematical expressions and just try to get a good definition for what you mean by Q or BW. i don't care what paper it is or patent it is, it is a completely solved problem (determining the coefficients) and the various methods depicted in the literature are all equivalent (except, possibly, for their difference in definition of BW).


> but the problem with this is that is that the boost and cut are not > symmetrical (and i cannot find a drawing on the web that shows this). > from its *appearance*, the BW of the cut filters (of the same Q, same > w0, and opposite dB) is squished in comparison to the BW of the boost > filter. if you want your boost/cut behavior to be symmetrical, you > must fudge the meaning of "Q", either in the boost, or in the cut, or > a little in both.
Yes, of course. The classic definition of Q works only if the gain is higher then 1. If the gain is smaller then 1, then the design Q should be multiplied by gain.
> 1. you have only 5 degrees of freedom regarding the design > of the coefficients to implement a 2nd-order paramtric > boost/cut filter or *any* 2nd-order IIR filter.
Actually you have 4 degrees of freedom per each section plus the common gain which is one more degree of freedom. I was thinking of a way to represent those degrees of freedom with a set of the obvious parameters, so every possible response type can be represented. Such as: 1. Gain at zero 2. Gain at Nyquist 3. A frequency 4. Gain at this frequency 5. Q of this frequency What do you think? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Dec 3, 2:12 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> > but the problem with this is that is that the boost and cut are not > > symmetrical (and i cannot find a drawing on the web that shows this). > > from its *appearance*, the BW of the cut filters (of the same Q, same > > w0, and opposite dB) is squished in comparison to the BW of the boost > > filter. if you want your boost/cut behavior to be symmetrical, you > > must fudge the meaning of "Q", either in the boost, or in the cut, or > > a little in both. > > Yes, of course. The classic definition of Q works only if the gain is > higher then 1. If the gain is smaller then 1, then the design Q should > be multiplied by gain. > > > 1. you have only 5 degrees of freedom regarding the design > > of the coefficients to implement a 2nd-order paramtric > > boost/cut filter or *any* 2nd-order IIR filter. > > Actually you have 4 degrees of freedom per each section plus the common > gain which is one more degree of freedom.
no, these are not cascaded BPFs where you can roll the common gain into one big K at the beginning or end. each of these sections have a DC and Nyquist gain speced (usually to 0 dB) and the boost or cut is relative to that spec. each section has 5 specs to nail down, and you are fortuitously given 5 degrees of freedom (a1, a2, b0, b1, b2) to do it. oh, i guess you're right, that you can factor out b0 from all of the numerator coefs and roll that into one big K. i tried to mention that in the cookbook. nonetheless, it doesn't change the main thesis i was making in the "Equivalence of Various Methods..." paper. i probably should have sought to publish that, or something like it in the JAES, but i thought, at the time, the potatoes were too small. so it got a convention preprint. r b-j
ooops, forgot to reply to this.

On Dec 3, 2:12 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:

> I was thinking of a way to represent those degrees of freedom with a set > of the obvious parameters, so every possible response type can be > represented. Such as: > > 1. Gain at zero > 2. Gain at Nyquist > 3. A frequency > 4. Gain at this frequency > 5. Q of this frequency > > What do you think?
it's exactly what i was thinking 14 years ago about this. r b-j

robert bristow-johnson wrote:


>>I was thinking of a way to represent those degrees of freedom with a set >>of the obvious parameters, so every possible response type can be >>represented. Such as: >> >>1. Gain at zero >>2. Gain at Nyquist >>3. A frequency >>4. Gain at this frequency >>5. Q of this frequency >> >>What do you think? > > > it's exactly what i was thinking 14 years ago about this.
..And then what? My next step was the joint optimization, search for global optima. Slow like hell, although it usually converges to a pretty optimal solution. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Dec 3, 2:43 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> robert bristow-johnson wrote: > >>I was thinking of a way to represent those degrees of freedom with a set > >>of the obvious parameters, so every possible response type can be > >>represented. Such as: > > >>1. Gain at zero > >>2. Gain at Nyquist > >>3. A frequency > >>4. Gain at this frequency > >>5. Q of this frequency > > >>What do you think? > > > it's exactly what i was thinking 14 years ago about this. > > ..And then what?
as long as we all know what we are talking about when we say "Q", then it's just an issue of 5 equations and 5 unknowns. not much more designing to do.
> My next step was the joint optimization, search for global optima. Slow > like hell, although it usually converges to a pretty optimal solution.
what's getting optimized? there are no additional knobs left to twist or twiddle. you have these constraints: 1. Gain at zero 2. Gain at Nyquist 3. A frequency 4. Gain at this frequency 5. Q of this frequency and you satisfy those constraints by adjusting a1, a2, b0, b1, and b2. what's left? r b-j