DSPRelated.com
Forums

Audio application problem

Started by PROVENTEK MINDCRAFT AB January 17, 2004
Hi folks,

I'm working with an dsp audio application and I desperately
need an algorithm for tone control.

The filter is described in my spec as a Baxendall filter
with the axial point of 1kHz and the characteristics is
a maximum of +-6dB per octave.

So far I have implemented low and high pass second order
Butterworh IIR filters with coefficients calculated with
Matlab and they work fine.
For the filter below 1kHz +6dB/octave I ran into problems.
I don't know how to calculate the filter coefficients and
which function to use. I have tried yulewalk calculated
parameters and it did not work at all. Any suggestions?

The developent platform is a SHARC DSP EZ-Kit Lite
equipped with a ADSP 21061 (floating point) and the
sampling rate is 44,100 kHz.

Regards T Landgren


PROVENTEK MINDCRAFT AB wrote:

> Hi folks, > > I'm working with an dsp audio application and I desperately > need an algorithm for tone control. > > The filter is described in my spec as a Baxendall filter > with the axial point of 1kHz and the characteristics is > a maximum of +-6dB per octave. > > So far I have implemented low and high pass second order > Butterworh IIR filters with coefficients calculated with > Matlab and they work fine. > For the filter below 1kHz +6dB/octave I ran into problems. > I don't know how to calculate the filter coefficients and > which function to use. I have tried yulewalk calculated > parameters and it did not work at all. Any suggestions? > > The developent platform is a SHARC DSP EZ-Kit Lite > equipped with a ADSP 21061 (floating point) and the > sampling rate is 44,100 kHz. > > Regards T Landgren
http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
"Jerry Avins" <jya@ieee.org> wrote in message
news:40096010$0$6092$61fed72c@news.rcn.com...
> PROVENTEK MINDCRAFT AB wrote: > > > Hi folks, > > > > I'm working with an dsp audio application and I desperately > > need an algorithm for tone control. > > > > The filter is described in my spec as a Baxendall filter > > with the axial point of 1kHz and the characteristics is > > a maximum of +-6dB per octave. > > > > So far I have implemented low and high pass second order > > Butterworh IIR filters with coefficients calculated with > > Matlab and they work fine. > > For the filter below 1kHz +6dB/octave I ran into problems. > > I don't know how to calculate the filter coefficients and > > which function to use. I have tried yulewalk calculated > > parameters and it did not work at all. Any suggestions? > > > > The developent platform is a SHARC DSP EZ-Kit Lite > > equipped with a ADSP 21061 (floating point) and the > > sampling rate is 44,100 kHz. > > > > Regards T Landgren > > http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt > > Jerry
The cookbook mentioned in Jerry's link includes a 2nd order shelving filter that can be used for a tone control. It does not, however, include a first order shelving filter which is what _I think_ the traditional analog tone control uses. However, if you are familiar with the bi-linear Z transform, you can probably derive a first order variant from the analog prototype transfer function. Alternatively, by playing with the shelf slope parameter, you should be able to make a 2nd order filter that has a maximum slope of 6dB/octave.
On Mon, 19 Jan 2004 10:48:20 -0800, "Jon Harris"
<goldentully@hotmail.com> wrote:

>"Jerry Avins" <jya@ieee.org> wrote in message >news:40096010$0$6092$61fed72c@news.rcn.com... >> PROVENTEK MINDCRAFT AB wrote:
[snippage]
>> http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt >> >> Jerry > > >The cookbook mentioned in Jerry's link includes a 2nd order shelving filter >that can be used for a tone control. It does not, however, include a first >order shelving filter which is what _I think_ the traditional analog tone >control uses.
The regular bass and treble controls on your stereo are 2nd order. Regards, Allan.
"Allan Herriman" <allan.herriman.hates.spam@ctam.com.au.invalid> wrote in
message news:ftuo00lm1a2huldts7knk9bh7mp4rv9edg@4ax.com...
> On Mon, 19 Jan 2004 10:48:20 -0800, "Jon Harris" > <goldentully@hotmail.com> wrote: > > >"Jerry Avins" <jya@ieee.org> wrote in message > >news:40096010$0$6092$61fed72c@news.rcn.com... > >> PROVENTEK MINDCRAFT AB wrote: > [snippage] > >>
http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt
> >> > >> Jerry > > > > > >The cookbook mentioned in Jerry's link includes a 2nd order shelving
filter
> >that can be used for a tone control. It does not, however, include a
first
> >order shelving filter which is what _I think_ the traditional analog tone > >control uses. > > The regular bass and treble controls on your stereo are 2nd order.
That's interesting to know. The only thing I've actually measured is a Mackie 1604VLZ-Pro mixer. It's high and low EQ were 6dB/octave, so I assumed 1st order. From that I generalized to think that most treble/bass controls were first order, but that may well be a faulty assumption. Can anyone else confirm Allan's assertion?
Jon Harris wrote:

> "Allan Herriman" <allan.herriman.hates.spam@ctam.com.au.invalid> wrote ... >>The regular bass and treble controls on your stereo are 2nd order. > > > That's interesting to know. The only thing I've actually measured is a > Mackie 1604VLZ-Pro mixer. It's high and low EQ were 6dB/octave, so I > assumed 1st order. From that I generalized to think that most treble/bass > controls were first order, but that may well be a faulty assumption. > > Can anyone else confirm Allan's assertion?
http://msswartz.tripod.com/baxandall1.htm shows a typical analog tone control "stack". (I use separate bass and treble controls in a feedback configuration, but the equations are substantially the same.) To a first approximation, it's second order. In detail, it's worse. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Jerry Avins" <jya@ieee.org> wrote in message
news:400db2c7$0$15588$61fed72c@news.rcn.com...
> Jon Harris wrote: > > > "Allan Herriman" <allan.herriman.hates.spam@ctam.com.au.invalid> wrote
...
> >>The regular bass and treble controls on your stereo are 2nd order. > > > > > > That's interesting to know. The only thing I've actually measured is a > > Mackie 1604VLZ-Pro mixer. It's high and low EQ were 6dB/octave, so I > > assumed 1st order. From that I generalized to think that most
treble/bass
> > controls were first order, but that may well be a faulty assumption. > > > > Can anyone else confirm Allan's assertion? > > http://msswartz.tripod.com/baxandall1.htm shows a typical analog tone > control "stack". (I use separate bass and treble controls in a feedback > configuration, but the equations are substantially the same.) To a first > approximation, it's second order. In detail, it's worse.
On the other hand, http://www.rane.com/pdf/acceler.pdf makes this claim: "Almost universally, these [Baxendall] shelving tone controls use one-pole filter circuits. The steepest response slope that can ever by achieved by a one-pole filter is, of course, 6 dB/octave (or 20 dB/decade, equivalent terms). This would be for an ideal filter circuit. In practice, the overall shelving tone-control transfer function results in a response slope that rarely exceeds about 3 dB/octave. (Due to the close proximity of the pole and zero of the transfer function, there is near cancellation; a 2.7-dB/octave slope is typical for &#4294967295;12 dB designs.)" Has anyone actually measured the frequency response curve of their HiFi's treble/bass circuits?
On Tue, 20 Jan 2004 17:59:17 -0500, Jerry Avins <jya@ieee.org> wrote:

>Jon Harris wrote: > >> "Allan Herriman" <allan.herriman.hates.spam@ctam.com.au.invalid> wrote ... >>>The regular bass and treble controls on your stereo are 2nd order. >> >> >> That's interesting to know. The only thing I've actually measured is a >> Mackie 1604VLZ-Pro mixer. It's high and low EQ were 6dB/octave, so I >> assumed 1st order. From that I generalized to think that most treble/bass >> controls were first order, but that may well be a faulty assumption. >> >> Can anyone else confirm Allan's assertion? > >http://msswartz.tripod.com/baxandall1.htm shows a typical analog tone >control "stack". (I use separate bass and treble controls in a feedback >configuration, but the equations are substantially the same.) To a first >approximation, it's second order. In detail, it's worse.
There's a discussion about the transfer function in this old sci.electronics.design thread: http://groups.google.com/groups?threadm=7edjrg%24n1j%241%40wrqnews.wrq.com Brief summary: The transfer function of the classic Baxandall is bicubic (3 poles, 3 zeros), but this is due to the way the circuit is designed. A simplified version that doesn't have all the interactions between the controls would only have two poles and two zeros. Certainly, only two poles and two zeros are needed to get the desired tone control effect. Regards, Allan.
"Jon Harris" <goldentully@hotmail.com> wrote in message news:<bukd3a$j2d2g$1@ID-210375.news.uni-berlin.de>...
> "Jerry Avins" <jya@ieee.org> wrote in message > news:400db2c7$0$15588$61fed72c@news.rcn.com... > > Jon Harris wrote: > > > > > "Allan Herriman" <allan.herriman.hates.spam@ctam.com.au.invalid> wrote > ... > > >>The regular bass and treble controls on your stereo are 2nd order. > > > > > > > > > That's interesting to know. The only thing I've actually measured is a > > > Mackie 1604VLZ-Pro mixer. It's high and low EQ were 6dB/octave, so I > > > assumed 1st order. From that I generalized to think that most > treble/bass > > > controls were first order, but that may well be a faulty assumption. > > > > > > Can anyone else confirm Allan's assertion? > > > > http://msswartz.tripod.com/baxandall1.htm shows a typical analog tone > > control "stack". (I use separate bass and treble controls in a feedback > > configuration, but the equations are substantially the same.) To a first > > approximation, it's second order. In detail, it's worse. > > On the other hand, http://www.rane.com/pdf/acceler.pdf makes this claim: > > "Almost universally, these [Baxendall] shelving tone controls use one-pole > filter circuits. The steepest response slope that can ever by achieved by a > one-pole filter is, of course, 6 dB/octave (or 20 dB/decade, equivalent > terms). This would be for an ideal filter circuit. In practice, the overall > shelving tone-control transfer function results in a response slope that > rarely exceeds about 3 dB/octave. (Due to the close proximity of the pole > and zero of the transfer function, there is near cancellation; a > 2.7-dB/octave slope is typical for &#4294967295;12 dB designs.)" > > Has anyone actually measured the frequency response curve of their HiFi's > treble/bass circuits?
I guess it's a matter of definition. The steepest possible slope is indeed six dB./octave, but the analog circuit actually has four breakpoints, and we usually pretend that two of them cancel. <sidebar> Look closely at the curve when one control is set to full boost and the other is flat. You will see a dip before the boost begins. That is not an optical illusion, but evidence that the cancelling breaks don't cancel. I'll show you how to make the cancellation exact if you want to. </sidebar> A tone control boosts or cuts for a while, then flattens out. It takes two breakpoints to do that: one pole, one zero. I called that second order. Was I wrong? Jerry
"Jerry Avins" <jya@ieee.org> wrote in message
news:5cc6b040.0401202141.f4ef95e@posting.google.com...
> "Jon Harris" <goldentully@hotmail.com> wrote in message
news:<bukd3a$j2d2g$1@ID-210375.news.uni-berlin.de>...
> > "Jerry Avins" <jya@ieee.org> wrote in message > > news:400db2c7$0$15588$61fed72c@news.rcn.com... > > > Jon Harris wrote: > > > > > > > "Allan Herriman" <allan.herriman.hates.spam@ctam.com.au.invalid>
wrote
> > ... > > > >>The regular bass and treble controls on your stereo are 2nd order. > > > > > > > > > > > > That's interesting to know. The only thing I've actually measured
is a
> > > > Mackie 1604VLZ-Pro mixer. It's high and low EQ were 6dB/octave, so
I
> > > > assumed 1st order. From that I generalized to think that most > > treble/bass > > > > controls were first order, but that may well be a faulty assumption. > > > > > > > > Can anyone else confirm Allan's assertion? > > > > > > http://msswartz.tripod.com/baxandall1.htm shows a typical analog tone > > > control "stack". (I use separate bass and treble controls in a
feedback
> > > configuration, but the equations are substantially the same.) To a
first
> > > approximation, it's second order. In detail, it's worse. > > > > On the other hand, http://www.rane.com/pdf/acceler.pdf makes this claim: > > > > "Almost universally, these [Baxendall] shelving tone controls use
one-pole
> > filter circuits. The steepest response slope that can ever by achieved
by a
> > one-pole filter is, of course, 6 dB/octave (or 20 dB/decade, equivalent > > terms). This would be for an ideal filter circuit. In practice, the
overall
> > shelving tone-control transfer function results in a response slope that > > rarely exceeds about 3 dB/octave. (Due to the close proximity of the
pole
> > and zero of the transfer function, there is near cancellation; a > > 2.7-dB/octave slope is typical for &#4294967295;12 dB designs.)" > > > > Has anyone actually measured the frequency response curve of their
HiFi's
> > treble/bass circuits? > > I guess it's a matter of definition. The steepest possible slope is > indeed six dB./octave, but the analog circuit actually has four > breakpoints, and we usually pretend that two of them cancel.
The digital 2nd order (biquad) version is capable of 12 dB/octave slopes without overshoot/undershoot (i.e. a slight dip before it starts to rise) or even more than that if you don't mind overshoot.
> <sidebar> Look closely at the curve when one control is set to full > boost and the other is flat. You will see a dip before the boost > begins. That is not an optical illusion, but evidence that the > cancelling breaks don't cancel. I'll show you how to make the > cancellation exact if you want to. </sidebar>
Interestingly, I recently read about a digital EQ that also offers this feature, claiming it sounds better that way! Maybe it just sounds more like people are used to?
> A tone control boosts or cuts for a while, then flattens out. It takes > two breakpoints to do that: one pole, one zero. I called that second > order. Was I wrong?
I don't know what is standard in the analog world, but with digital filtering, something with one pole and one zero would be first order. A biquad (quadratic in both numerator and denominator) is second order and has 2 poles and 2 zeros.