# RBJ Audio-EQ-Cookbook¶

notes
```Equations for creating different equalization filters.
```

```rbj writes with regard to shelving filters:

> _or_ S, a "shelf slope" parameter (for shelving EQ only).  When S = 1,
> the shelf slope is as steep as it can be and remain monotonically
> increasing or decreasing gain with frequency.  The shelf slope, in
> dB/octave, remains proportional to S for all other values for a
> fixed f0/Fs and dBgain.

The precise relation for both low and high shelf filters is

S = -s * log_2(10)/40 * sin(w0)/w0 * (A^2+1)/(A^2-1)

where s is the true shelf midpoint slope in dB/oct and w0, A are defined in
the Cookbook just below the quoted paragraph. It's your responsibility to keep
the overshoots in check by using sensible s values. Also make sure that s has
the right sign -- negative for low boost or high cut, positive otherwise.

To find the relation I first differentiated the dB magnitude response of the
general transfer function in eq. 1 with regard to log frequency, inserted the
low shelf coefficient expressions, and evaluated at w0. Second, I equated this
derivative to s and solved for alpha. Third, I equated the result to rbj's
expression for alpha and solved for S yielding the above formula. Finally
I checked it with the high shelf filter.
```
```Sorry, a slight correction: rewrite the formula as

S = s * log_2(10)/40 * sin(w0)/w0 * (A^2+1)/abs(A^2-1)

```This is a very famous article. I saw many are asking what is the relationship between "Q" and the resonance in low-pass and hi-pass filters.