Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Chapters

See Also

Embedded SystemsFPGAElectronics
Chapter Contents:

Search Introduction to Digital Filters

  

Book Index | Global Index


Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?

  

Peaking Equalizers

A peaking equalizer filter section provides a boost or cut in the vicinity of some center frequency. It may also be called a parametric equalizer section. The gain far away from the boost or cut is unity, so it is convenient to combine a number of such sections in series. Additionally, a high and/or low shelf (§B.4 above) are nice to include in series with one's peaking eq sections.

The analog transfer function for a peak filter is given by [103,5,6]

$\displaystyle H(s) = 1 + H_R(s)
$

where $ H_R(s)$ is a two-pole resonator:

$\displaystyle H_R(s) \isdef R\cdot \frac{Bs}{s^2+Bs + 1}
$

The transfer function can be written in the normalized form [103]

$\displaystyle H(s) = \frac{s^2 + gBs + 1}{s^2+Bs + 1},
$

where $ g$ is approximately the desired gain at the boost (or cut), and $ B$ is the desired bandwidth. When $ g>1$, a boost is obtained at frequency $ \omega=1$. For $ g<1$, a cut filter is obtained at that frequency. In particular, when $ g=0$, there are infinitely deep notches at $ \omega=\pm 1$, and when $ g=1$, the transfer function reduces to $ H(s)=1$ (no boost or cut). The parameter $ B$ controls the width of the boost or cut.

It is easy to show that both zeros and both poles are on the unit circle in the left-half $ s$ plane, and when $ g<1$ (a ``cut''), the zeros are closer to the $ j\omega$ axis than the poles.

Again, the bilinear transform can be used to convert the analog peaking equalizer section to digital form.

Figure B.15 gives a matlab listing for a peaking EQ section. Figure B.16 shows the resulting plot for an example call:

boost(2,0.25,0.1);
The frequency-response utility myfreqz, listed in Fig.7.1, can be substituted for freqz.

Figure B.15: Matlab function for designing (and optionally testing) a peaking equalizer section.

 
function [B,A] = boost(gain,fc,bw,fs);
%BOOST - Design a boost filter at given gain, center
%        frequency fc, bandwidth bw, and sampling rate fs
%        (default = 1).
%
% J.O. Smith 11/28/02
% Reference: Zolzer: Digital Audio Signal Processing, p. 124

if nargin<4, fs = 1; end
if nargin<3, bw = fs/10; end

Q = fs/bw;
wcT = 2*pi*fc/fs;

K=tan(wcT/2);
V=gain;

b0 =  1 + V*K/Q + K^2;
b1 =  2*(K^2 - 1);
b2 =  1 - V*K/Q + K^2;
a0 =  1 + K/Q + K^2;
a1 =  2*(K^2 - 1);
a2 =  1 - K/Q + K^2;
A = [a0 a1 a2] / a0;
B = [b0 b1 b2] / a0;

if nargout==0
  figure(1);
  freqz(B,A);
  title('Boost Frequency Response')
end

Figure B.16: Frequency response of a second-order peaking equalizer section tuned to give a 6 dB peak of width $ \approx f_s/10$ at center frequency $ f_s/4$.
\includegraphics[width=\twidth]{eps/tboost}

A Faust implementation of the peaking equalizer is available as the function peak_eq in filter.lib distributed with Faust (Appendix K) starting with version 0.9.9.4k-par.


Previous: Exercise
Next: Time-Varying Two-Pole Filters

Order a Hardcopy of Introduction to Digital Filters


About the Author: Julius Orion Smith III
Julius Smith's background is in electrical engineering (BS Rice 1975, PhD Stanford 1983). He is presently Professor of Music and Associate Professor (by courtesy) of Electrical Engineering at Stanford's Center for Computer Research in Music and Acoustics (CCRMA), teaching courses and pursuing research related to signal processing applied to music and audio systems. See http://ccrma.stanford.edu/~jos/ for details.


Comments


 

dannyb wrote:

1/12/2011
 
Clearly there is a typo in the code of Figure B.15 -- the numerator coefs are (almost) identical to those of the denomerator. After re-deriving, I found the following: b0 = V*K/Q, b1 = 0, b2=-V*K/Q. Note, I haven't tested these though.
 

dannyb wrote:

1/12/2011
 
I tested the above and found another typo: "Q = fs/bw;" should be "Q = fc/bw;".
 

JOS wrote:

2/5/2011
 
I thoroughly sympathize with your confusion. I found it confusing myself looking at it again for the first time in several years. I checked and the coefficient formulas are straight out of Zolzer's book (page 124, Table 5.3). What I need to do is derive things more fully. This is planned for the second edition. Also, it would be better if Q were fc/bw, but that would not be correct here because Q is defined for a unit resonance frequency (Zolzer calls it Q_infinity). I'm going to rewrite this section from scratch for the second edition. In the meantime the code should actually work ok. For simplicity, only use the sampling rate fs=1, and think of B as bandwidth in normalized Hz (so 0.25 is one fourth the sampling rate). It is really 1/Q, which is really 2*alpha, where alpha is the real part of the pole of the resonator in normalized form (resonance tuned to 1 radian/second). That can be considered normalized bandwidth which will get multiplied by the desired peak frequency wc. As I say, I am going to rewrite this whole section from scratch and add a pointer here when it exists on the Web.
 

dannyb wrote:

3/23/2011
 
Thanks you for the correction. My error/confusion were due to arriving at this section upon searching for code for a resonator, and so my derivation and comments would apply to resonator, not a boost! Your boost code works as stated. I apologize for my careless reading and erroneous comments.

Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )