Skip to content

Instantly share code, notes, and snippets.

@sletz
Created May 1, 2025 17:49
Show Gist options
  • Select an option

  • Save sletz/c0e43d3705de22d3041904ccac570dcc to your computer and use it in GitHub Desktop.

Select an option

Save sletz/c0e43d3705de22d3041904ccac570dcc to your computer and use it in GitHub Desktop.
//========================= Introduction =======================================
// Vicanek's Matched (Decramped) Second-Order Filters
//================================================================================
//
// This collection implements high-quality, double-precision second-order filters
// based on the work of Vicanek, offering improved frequency accuracy and dynamic
// response over traditional biquads—especially near Nyquist.
//
// Standard digital filter designs (like bilinear-transformed biquads) suffer from
// frequency warping, which distorts the placement of poles and zeros. Vicanek's
// method, detailed in his paper *"Digital Biquads: Real Poles and Zeros"*, proposes
// a set of matched filter formulas that eliminate such warping, preserving the
// intended analog-like behavior and frequency response.
//
// The filters provided here include:
//
// • `lowpass2Matched` — second-order lowpass with resonance
// • `highpass2Matched` — second-order highpass with resonance
// • `bandpass2Matched` — second-order bandpass with resonance
// • `peaking2Matched` — second-order peaking EQ
// • `biquad` — generic difference equation implementation
//
// Each filter relies on carefully derived coefficient formulas that guarantee
// accurate placement of the frequency response peak and preserve Q and gain behavior.
//
// ⚠️ **Note:** These filters require **double-precision** floating-point support
// to maintain numerical stability and accuracy.
//
// #### Reference:
// Vicanek, M. (2014). *Digital Biquads: Real Poles and Zeros*.
// https://www.vicanek.de/articles/BiquadFits.pdf
//
// #### Author: Dario Sanfilippo
// #### License: MIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment