Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI disclosure

Biquad Cookbook

A collection of tools and documentation for designing audio EQs with and calculating coefficients for biquad filters

Webpage that lets you easily build up an EQ and see the combined frequency response, phase, impulse response, and group delay of multiple filters. Load a frequency response curve and see the effective response with those filters applied. Includes a Monte Carlo optimization routine to fine-tune filters to match a target response curve.

EQ designer


A simple text file in the style of the RBJ cookbook, with additional filter types


A ground-up reimplementation of the MiniDSP all-digital-coeffs spreadsheet with more consistent and more useful labeling and graphs between the various filters, and additional filter types

Lowpass filter sheet


Filters, Calculation, and format

Filter types included:

  • 1st order Lowpass
  • 1st order Highpass
  • 1st order Allpass
  • 1st order Low Shelf
  • 1st order High Shelf
  • 2nd order Lowpass
  • 2nd order Highpass
  • 2nd order Allpass
  • 2nd order Low Shelf
  • 2nd order High Shelf
  • Peaking EQ
  • Bandpass (constant skirt)
  • Bandpass (constant peak)
  • Notch
  • Linkwitz Transform

Each filter is calculated from a number of input parameters, corner or center frequency, Q, gain, etc, along with the sampling rate, Fs, and an Output Gain value in dB. The output gain value simply scales the b coefficients to increase headroom for filters with gain or make up amplitude from attenuating filters, and can be safely ignored by setting the value to 0.

The filter coefficients are calculated as they would be used in the typical biquad Direct Form I:

y[n] = (b0/a0)*x[n] + (b1/a0)*x[n-1] + (b2/a0)*x[n-2] - (a1/a0)*y[n-1] - (a2/a0)*y[n-2]

The coefficients are presented in the raw form and also in a normalized form scaled such that a0 is equal to 1, reducing the memory and calculation to five coefficients

The labeling and arrangement of the coefficients matches the RBJ cookbook, which seems to be the de facto standard. The b coefficients are used for the feedforward path and the a coefficients are used for the feedback path. The feedback path is subtracted from the output, so the a coefficients are "normal", as opposed to the MiniDSP spreadsheet where the a coefficients have their sign reversed. Other platforms may require different ordering, but you can use these coefficients as they are in:

  • SigmaStudio
  • Teensy Audio Library
  • SciPy/NumPy
  • MATLAB/Octave (after accounting for MATLAB 1-indexing)

References

The filter calculations come from a few sources:

The frequency and phase response graphs are derived from this digital filter cheat sheet.

About

Biquad filter cookbook implemented in Excel

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages