DSPRelated.com
Forums

Interpolated Constant-Q Equalizer

Started by Unknown November 20, 2007
Hello Tim,

On 21 nov, 00:19, Tim Wescott <t...@seemywebsite.com> wrote:

> I think you did. And while you can't have MATLAB running in your box, you > should have plenty of processor ticks lying around to update the filter > design -- you don't have to redesign the filter at the sampling rate, only > often enough (once every 10ms will probably be more than fine) to satisfy > humans.
Absolutely agreed. Someone (externally to comp.dsp) suggested having a look at Harris, Fred & Brooking, Eric preprint from AES convention # 95, which it seems to have exactly what I am looking for. I will give it a try, hopefully I will make the EQU perform as desired. I want to thank all of you who sent me a comment, I found it very enriching and refreshing; I was stuck on trying to replicate the analog filters in digital domain. Sometimes one has to stop thinking in your own way, take a new breath and listen to others. Regards, JaaC
Jaime,

i only recently got to my computer and noticed your email as well as
this post.  i may have to come back to this later as this is the
"Thanksgiving Day" holiday here in the US and my family came down from
Vermont to Boston to visit.

is there a problem (other than numerical) in cascading 31 "parametric
EQs" with fixed, logarithmically spaced center frequencies, and equal
bandwidth (in octaves)?  if your word width is wide enough, you might
be able to get away with that and you will always hit the slider
settings.

it would "sound better" (less quantization noise) if the cascaded
filters were transformed to parallel filters (sorta like a
conventional graphic EQ), but getting the coefficients for the
numerators (the poles are the same) of the parallel sections would be
a nasty bitch.

about the boost-3 dB bandwidth (that everyone seems to like, but is
not symmetrical with a cut of the same dB) vs. the boost/2 dB
bandwidth (that i used and where the idea came from Andy Moorer and
that nobody seems to like), there is a simple mapping of the two
bandwidths.  please refer to the cookbook so i may use the same
semantic.

for the conventional EQ in *boost* mode, the Q of the filter is the
same as the Q of the BPF that is parallel to a wire.  if you account
for bilinear transform frequency warping:

             1/Q = 2*sinh( ln(2)/2 * BW * w0/sin(w0) )

but, given my fucked-up definition for Q (that is symmetrical and
equally fucked up for boost *or* cut) the relationship between the
real Q and my bogus Q (call it Qrbj) is:

             Qrbj =  Q/A

         where A  =  10^(dBboostGain/40) .


so, if you define "alpha" to be

    alpha = sin(w0)*A*sinh( ln(2)/2 * BW * w0/sin(w0) )

for A > 1 (the boost case) and

    alpha = sin(w0)/A*sinh( ln(2)/2 * BW * w0/sin(w0) )

for A < 1 (the cut case), and use the existing peakingEQ coefficient
formulae, you will have symmetrical boost and cut characteristics and,
for *boost* (not for cut), the resonance Q of the peaking EQ will be
the same as for the hypothetical parallel BPF which is what they like
in the audio practitioner convention.  but the Q will be even further
off in the cut case, but i think people would prefer to have the boost/
cut symmetry over having the Q in the cut case match the Q of the
parallel BPF.

lemme know if there are more questions (either here or by email) but
don't expect a prompt response.  "holidays" are sometimes busy.  i
might get to it next week.

BTW, Ricardo Garcia says "hola".  we both be at Kurzweil Music
Systems.

r b-j
robert bristow-johnson wrote:
> Jaime, > > i only recently got to my computer and noticed your email as well as > this post. i may have to come back to this later as this is the > "Thanksgiving Day" holiday here in the US and my family came down from > Vermont to Boston to visit. > > is there a problem (other than numerical) in cascading 31 "parametric > EQs" with fixed, logarithmically spaced center frequencies, and equal > bandwidth (in octaves)? if your word width is wide enough, you might > be able to get away with that and you will always hit the slider > settings. > > it would "sound better" (less quantization noise) if the cascaded > filters were transformed to parallel filters (sorta like a > conventional graphic EQ), but getting the coefficients for the > numerators (the poles are the same) of the parallel sections would be > a nasty bitch. >
Why? Can't you just sum the weighted outputs of 31 BPFs? -- Dirk http://www.transcendence.me.uk/ - Transcendence UK Remote Viewing classes in London
On Dec 6, 8:35 pm, Dirk Bruere at NeoPax <dirk.bru...@gmail.com>
wrote:
> robert bristow-johnson wrote: > > Jaime, > > > i only recently got to my computer and noticed your email as well as > > this post. i may have to come back to this later as this is the > > "Thanksgiving Day" holiday here in the US and my family came down from > > Vermont to Boston to visit. > > > is there a problem (other than numerical) in cascading 31 "parametric > > EQs" with fixed, logarithmically spaced center frequencies, and equal > > bandwidth (in octaves)? if your word width is wide enough, you might > > be able to get away with that and you will always hit the slider > > settings. > > > it would "sound better" (less quantization noise) if the cascaded > > filters were transformed to parallel filters (sorta like a > > conventional graphic EQ), but getting the coefficients for the > > numerators (the poles are the same) of the parallel sections would be > > a nasty bitch. > > Why? Can't you just sum the weighted outputs of 31 BPFs?
if you set the weights to 1 (0 dB), they don't add perfectly to 1. you'll get some ripple in the frequency response, even with the slidersareall set to 0 dB.
robert bristow-johnson wrote:
> On Dec 6, 8:35 pm, Dirk Bruere at NeoPax <dirk.bru...@gmail.com> > wrote: >> robert bristow-johnson wrote: >>> Jaime, >>> i only recently got to my computer and noticed your email as well as >>> this post. i may have to come back to this later as this is the >>> "Thanksgiving Day" holiday here in the US and my family came down from >>> Vermont to Boston to visit. >>> is there a problem (other than numerical) in cascading 31 "parametric >>> EQs" with fixed, logarithmically spaced center frequencies, and equal >>> bandwidth (in octaves)? if your word width is wide enough, you might >>> be able to get away with that and you will always hit the slider >>> settings. >>> it would "sound better" (less quantization noise) if the cascaded >>> filters were transformed to parallel filters (sorta like a >>> conventional graphic EQ), but getting the coefficients for the >>> numerators (the poles are the same) of the parallel sections would be >>> a nasty bitch. >> Why? Can't you just sum the weighted outputs of 31 BPFs? > > if you set the weights to 1 (0 dB), they don't add perfectly to 1. > you'll get some ripple in the frequency response, even with the > slidersareall set to 0 dB.
Yes, I can see that. Question is how much ripple is tolerable? For example, in the app I'm interested in 1dB of ripple would be OK - maybe even 2 or 3. -- Dirk http://www.transcendence.me.uk/ - Transcendence UK Remote Viewing classes in London
On Dec 7, 4:19 pm, Dirk Bruere at NeoPax <dirk.bru...@gmail.com>
wrote:

> > Yes, I can see that. > Question is how much ripple is tolerable? For example, in the app I'm > interested in 1dB of ripple would be OK - maybe even 2 or 3.
well, i guess what is tolerable depends on who is tolerating it. for me, if i had a graphic equalizer, i would hope that setting all of the faders to right in the middle, at 0 dB, would result in a "wire". perhaps with some known and constant delay, but with completely flat frequency response (magnitude). i would want a graphic equalizer (or any equalizer) that is set to 0 dB gain to do nothing (except a little delay, if i can't get away with no delay) to the signal passed through. r b-j
robert bristow-johnson wrote:
> On Dec 7, 4:19 pm, Dirk Bruere at NeoPax <dirk.bru...@gmail.com> > wrote: > >> Yes, I can see that. >> Question is how much ripple is tolerable? For example, in the app I'm >> interested in 1dB of ripple would be OK - maybe even 2 or 3. > > well, i guess what is tolerable depends on who is tolerating it. for > me, if i had a graphic equalizer, i would hope that setting all of the > faders to right in the middle, at 0 dB, would result in a "wire". > perhaps with some known and constant delay, but with completely flat > frequency response (magnitude). i would want a graphic equalizer (or > any equalizer) that is set to 0 dB gain to do nothing (except a little > delay, if i can't get away with no delay) to the signal passed > through. > > r b-j
Well, that's pretty easy - bypass the filtering if all set to 0dB! When the user starts tweaking stuff to match something (usually their aesthetic expectations) all that ripple and crap is meanigless because they'll tweak 'by ear'. -- Dirk http://www.transcendence.me.uk/ - Transcendence UK Remote Viewing classes in London
On Dec 8, 1:06 pm, Dirk Bruere at NeoPax <dirk.bru...@gmail.com>
wrote:
> > > Well, that's pretty easy - bypass the filtering if all set to 0dB!
for 31 staggered BPFs in parallel? it doesn't seem easy to me. for 31 peaking EQs in series, that's easy. and we know that these 31 sections can be remapped to parallel (with the denominator coefficients unchanged) by partial fraction expansion (maybe the Heaviside trick, but i dunno how to program a machine to do that auto- magically, but with no coincident poles it might not be too hard). anyway, is this what you mean by "pretty easy"?
> When the user starts tweaking stuff to match something (usually their > aesthetic expectations) all that ripple and crap is meanigless because > they'll tweak 'by ear'.
i agree with that, which is why i am less worried about Jaime's problem than perhaps he is. (if they're all set to 12 dB, there will be some ripple, but not if they're set to 0 dB, if you figure out the partial fraction expansion.) ya know, i dunno if someone did a paper on it, but that would be a worthy project to assign an earnest grad student that wants to figure something out. given a transfer function that is a product of biquads, in which there are no coincident roots in the denominator. i know this Heaviside Partial Expansion is what they called it in my old textbooks (where i first learned about Laplace Transform), but i am having trouble citing something on the web. at Wikipedia, i think they are calling the method: "Par&#4294967295;vartya S&#4294967295;tra". oh, i guess i get a few hits when i type in "Heaviside Expansion Theorem" into Google. so i have two questions: 1. does anybody know if there is a mathematical reference that precedes Heaviside for this trick to do partial fraction expansion? is this "Par&#4294967295;vartya S&#4294967295;tra" the same thing? does it precede Oliver Heaviside? 2. anyone care to write a nice and clean program in C that does the partial fraction expansion for non-multiple roots in the denominator? i s'pose it would do something like the MATLAB function "residue()", except that i think "residue" gets unfactored polynomials and, in this case, your polynomials would be known to be factored to irreducible quadratics. a function like that would be useful to convert the coefficients of a bunch of peaking EQs that are in series to a bunch of biquads in parallel (that might look a little like BPFs, but are not exactly that). someone should do that and post the code here. i would be happy to put it to use. :-) r b-j
robert bristow-johnson wrote:
> On Dec 8, 1:06 pm, Dirk Bruere at NeoPax <dirk.bru...@gmail.com> > wrote: >> >> Well, that's pretty easy - bypass the filtering if all set to 0dB! > > > for 31 staggered BPFs in parallel? it doesn't seem easy to me. > > for 31 peaking EQs in series, that's easy. and we know that these 31 > sections can be remapped to parallel (with the denominator > coefficients unchanged) by partial fraction expansion (maybe the > Heaviside trick, but i dunno how to program a machine to do that auto- > magically, but with no coincident poles it might not be too hard). > anyway, is this what you mean by "pretty easy"?
No, I mean *really* easy! if (all_filters == 0) output_codec = input_codec; -- Dirk http://www.transcendence.me.uk/ - Transcendence UK Remote Viewing classes in London
On Dec 9, 10:28 am, Dirk Bruere at NeoPax <dirk.bru...@gmail.com>
wrote:
> robert bristow-johnson wrote: > > On Dec 8, 1:06 pm, Dirk Bruere at NeoPax <dirk.bru...@gmail.com> > > wrote: > > >> Well, that's pretty easy - bypass the filtering if all set to 0dB! > > > for 31 staggered BPFs in parallel? it doesn't seem easy to me. > > > for 31 peaking EQs in series, that's easy. and we know that these 31 > > sections can be remapped to parallel (with the denominator > > coefficients unchanged) by partial fraction expansion (maybe the > > Heaviside trick, but i dunno how to program a machine to do that auto- > > magically, but with no coincident poles it might not be too hard). > > anyway, is this what you mean by "pretty easy"? > > No, I mean *really* easy! > > if (all_filters == 0) > output_codec = input_codec;
so you mean a switch. how closely to exactly 0 dB does each slider have to get for it to be considered 0? so if even one slider is off (possibly due to mismarking) by a millismidgen, then you get the big ripply effect because your test above fails? does this switch go "click" when it actually *does* kick in? then touch a slider by just a teeny bit, and does it go click again? to avoid the clicks, does your switch fade in and fade out when engaged or disengaged? that's simple? needless to say, i do not like switches like that. that's why i didn't like the harris & Brooking paper regarding EQ. switches attached to continuous controls suck. r b-j