lattice-dsp is an alpha-stage scientific Python package for experiments with stability-aware recursive signal processing. It focuses on IIR lattice filters, reflection/PARCOR coefficient parameterizations, adaptive recursive filtering, AR diagnostics, and finite-dimensional MIMO/model-reduction examples.
The scalar filtering pieces are the most direct practical APIs. The MIMO, Schur/Pick, and model-reduction pieces are best read as tested experimental diagnostics rather than production solvers.
Recursive IIR filters are compact, but direct-form denominator updates can be hard to control. A small coefficient change can move poles outside the unit circle and make a filter unstable.
Lattice parameterizations provide a stability-aware coordinate system. In the scalar case, reflection or PARCOR coefficients with magnitude less than one correspond to stable recursive filters.
The package is meant for experiments where this coordinate system is useful: stable IIR filtering, adaptive recursive filtering, AR diagnostics, and finite-dimensional model-reduction or MIMO examples. It is not a replacement for SciPy or a production audio/control framework.
What the package does
For scalar IIR filters, lattice-dsp provides conversions between reflection coefficients and denominator polynomials, plus lattice and lattice-ladder filtering APIs.
For example, bounded reflection coefficients
|k_i| < 1
define a stable recursive denominator. This makes them useful for adaptive filtering, where unconstrained denominator updates can otherwise leave the stable region.
The package includes finite-section model-reduction tools for scalar and MIMO systems.
For scalar filters, lattice-dsp can build finite Hankel matrices from impulse responses and compute lower-order state-space or IIR candidates. For MIMO systems, it works with Markov tensors of shape
(\text{samples}, \text{outputs}, \text{inputs}).
These tools are documented as finite-dimensional diagnostics and baselines, not as full infinite-dimensional optimal solvers.
A distinctive part of lattice-dsp is the matrix/MIMO lattice direction.
The package includes examples and utilities for:
causal online MIMO lattice prediction;
matrix-lattice all-pass responses;
streaming paraunitary-style analysis;
finite-record adjoint diagnostics;
MIMO block-Hankel reduction;
bridge diagnostics from MIMO Markov data to matrix-lattice scaffolds;
finite definite tangential Schur/Pick checks.
The documentation separates causal runtime APIs from offline estimation and finite-record diagnostics. This distinction matters: a fitted model may be used causally, while the fitting or diagnostic step may require a full finite record.
Algorithms
The package connects several related DSP and systems ideas:
Schur and Levinson-Durbin recursions;
reflection/PARCOR stability coordinates;
lattice and lattice-ladder IIR realizations;
Burg AR estimation;
block Levinson and multichannel AR modeling;
finite Hankel operators and Ho-Kalman-style reduction;
finite-section Nehari/AAK intuition;
matrix all-pass and J-inner diagnostics;
right tangential Schur/Pick interpolation data.
The implementation uses a Python API with C++/pybind11 kernels for core filtering, finite-Hankel, and MIMO state-space routines.
Benchmarks
The benchmarks are intended to measure practical trade-offs rather than produce universal performance claims.