v2.0.0
Loading...
Searching...
No Matches
iirfilter.h File Reference

Butterworth IIR filter design and application via numerically stable second-order sections. More...

#include "dsp_global.h"
#include <Eigen/Core>
#include <QVector>
Include dependency graph for iirfilter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  UTILSLIB::IirBiquad
 Coefficients of one second-order IIR section (biquad). More...
class  UTILSLIB::IirFilter
 Butterworth IIR filter design and application using second-order sections. More...

Namespaces

namespace  UTILSLIB
 Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).

Detailed Description

Butterworth IIR filter design and application via numerically stable second-order sections.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.1.0
Date
March 2026

Direct-form realisations of high-order IIR filters are numerically unstable on finite-precision hardware because tiny coefficient perturbations cause large pole-position errors. IirFilter side-steps the problem by factoring every Butterworth design into a cascade of second-order sections (biquads, SOS), each carrying one conjugate pole pair, then iterating the cascade with the standard Direct-Form II topology. The result is well-behaved up to very high orders and is the same arrangement that scipy.signal.sosfilt uses.

The design itself follows the classical pipeline: analogue Butterworth prototype → lowpass-to-(LP|HP|BP|BS) frequency transform with pre-warped edge frequencies → bilinear s→z mapping. Zero-phase filtering is provided by running the SOS cascade forward, time-reversing, running it a second time and time-reversing again, which cancels the per-section group delay exactly.

Reference: A. V. Oppenheim & R. W. Schafer, "Discrete-Time Signal Processing", 3rd ed., Ch. 7.

Definition in file iirfilter.h.