Skip to content

loudifier/Biquad-Cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Biquad Cookbook

Biquad filter cookbook implemented in Excel

Biquad Cookbook.xlsx

A ground-up reimplementation of the MiniDSP all-digital-coeffs spreadsheet with more consistent and more useful labeling and graphs between the various filters, additional filter types, and notes indicating the sources of the original filter derivations and calculations.

Lowpass filter sheet

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

Calculation, format

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published