Skip to main content

Efficient stable IIR lattice filters, adaptive lattice-ladder DSP, and matrix/MIMO lattice experiments for Python

Project description

lattice-dsp

PyPI Python Docs CI

Stable IIR lattice filters, adaptive recursive DSP, and matrix/MIMO lattice experiments for Python.

lattice-dsp is a compact C++/Python toolkit for signal-processing workflows where stability-aware recursive filters matter. It focuses on reflection/PARCOR coefficients, lattice and lattice-ladder IIR filters, adaptive IIR experiments, AR spectral diagnostics, finite-Hankel model-reduction diagnostics, and experimental matrix/MIMO lattice tools.

Install with lattice-dsp; import with lattice_dsp.

python -m pip install lattice-dsp
import lattice_dsp as ld

Why lattice-dsp?

Direct-form IIR denominator updates can move poles outside the unit circle. Lattice parameterizations provide a safer coordinate system: bounded reflection coefficients correspond to stable recursive filters.

This package is intentionally narrower than SciPy or general audio/room-simulation libraries. It is for users who want stable recursive DSP building blocks, finite-section model-reduction diagnostics, and experimental MIMO/state-space lattice workflows in one tested Python package with a compiled backend.

What is included

  • Stable scalar LatticeIIR and LatticeLadderIIR filters.
  • Reflection/PARCOR coefficient conversion for stable IIR denominators.
  • Adaptive lattice-ladder NLMS/RLS-style examples.
  • Burg, Levinson-Durbin, AR, and spectral diagnostics.
  • Batch processing for many independent filters/signals, with optional OpenMP.
  • Finite-Hankel SISO/MIMO reduction helpers and Nehari/AAK-style finite-section diagnostics.
  • MIMO Markov tensor and state-space processing utilities.
  • Matrix-lattice/all-pass examples and causal online MIMO lattice prediction.
  • Tangential Schur/Pick/J-inner diagnostic helpers.
  • Sphinx tutorials, examples, benchmarks, and interoperability recipes.

Quick example: stable IIR from reflection coefficients

import numpy as np
import lattice_dsp as ld

rng = np.random.default_rng(0)
x = rng.normal(size=4096)

reflection = [0.35, -0.2, 0.1]
numerator = [0.25, 0.0, 0.15, 0.7]

print(ld.reflection_to_denominator(reflection))

filt = ld.LatticeIIR(reflection, numerator)
y = filt.process(x)

Quick example: adaptive stable IIR identification

import numpy as np
import lattice_dsp as ld

rng = np.random.default_rng(1)
x = rng.normal(size=8000)

target = ld.LatticeIIR([0.55, -0.32], [0.4, -0.1, 0.65])
desired = np.asarray(target.process(x), dtype=float)

adaptive = ld.AdaptiveLatticeLadderNLMS(
    initial_reflection=[0.0, 0.0],
    initial_taps=[0.0, 0.0, 0.0],
    mu_taps=0.06,
    mu_reflection=0.0015,
    margin=1e-4,
)

error = np.asarray(adaptive.adapt_block(x, desired), dtype=float)

print("learned reflection:", np.round(adaptive.reflection, 4))
print("final MSE:", np.mean(error[-1000:] ** 2))

MIMO and model-reduction scope

lattice-dsp includes MIMO/state-space and matrix-lattice tools, but the scope is deliberately conservative.

Implemented:

  • finite-Hankel SISO reduction as a C++ finite-section Ho-Kalman-style baseline;
  • MIMO block-Hankel reduction from Markov tensors;
  • compiled batched MIMO state-space simulation;
  • causal online MIMO lattice prediction from fitted matrix reflection coefficients;
  • matrix-lattice/all-pass runtime examples and finite-record adjoint diagnostics;
  • finite definite tangential Schur/Pick and J-inner diagnostic utilities.

Out of scope for the current alpha:

  • full infinite-dimensional AAK/Nehari solvers;
  • full matrix-valued AAK/Nehari optimal reduction;
  • generalized indefinite matrix Schur synthesis;
  • production acoustic echo cancellation;
  • complete room-acoustics, wireless, or control-system frameworks.

The docs label offline estimation, causal runtime, inductive evaluation, and transductive/block diagnostics separately so examples are clear about data use.

Documentation

Start here:

Representative examples:

Development

python -m pip install -e ".[dev,examples,benchmark,docs]"
pytest
ruff check .
ruff format .

Build docs locally:

./scripts/build_docs_with_results.sh
xdg-open docs/_build/html/index.html

The native extension is built with scikit-build-core, CMake, pybind11, NumPy, and optional OpenMP. If OpenMP is unavailable, the package falls back to serial batch processing.

Public validation

For a full release-style check:

python -m pip install -e ".[dev,examples,benchmark,docs]"
./scripts/release_validation.sh

For a quicker public-claim check:

PYTHONPATH="$PWD" pytest -q tests/test_release_trust_claims.py

License

Apache-2.0. See LICENSE and NOTICE.md.

Citation

If this package supports your research or teaching, please cite it using CITATION.cff.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lattice_dsp-0.1.1.tar.gz (10.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lattice_dsp-0.1.1-cp314-cp314-win_amd64.whl (244.9 kB view details)

Uploaded CPython 3.14Windows x86-64

lattice_dsp-0.1.1-cp314-cp314-win32.whl (214.3 kB view details)

Uploaded CPython 3.14Windows x86

lattice_dsp-0.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (396.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

lattice_dsp-0.1.1-cp314-cp314-macosx_11_0_arm64.whl (231.3 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

lattice_dsp-0.1.1-cp313-cp313-win_amd64.whl (240.0 kB view details)

Uploaded CPython 3.13Windows x86-64

lattice_dsp-0.1.1-cp313-cp313-win32.whl (210.5 kB view details)

Uploaded CPython 3.13Windows x86

lattice_dsp-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (396.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

lattice_dsp-0.1.1-cp313-cp313-macosx_11_0_arm64.whl (230.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

lattice_dsp-0.1.1-cp312-cp312-win_amd64.whl (240.0 kB view details)

Uploaded CPython 3.12Windows x86-64

lattice_dsp-0.1.1-cp312-cp312-win32.whl (210.5 kB view details)

Uploaded CPython 3.12Windows x86

lattice_dsp-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (396.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

lattice_dsp-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (230.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file lattice_dsp-0.1.1.tar.gz.

File metadata

  • Download URL: lattice_dsp-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lattice_dsp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 535ec85be182d815f7775cb4ad05502b88802036c3ffc7143eb5e84fa675467a
MD5 606266991aa23d0615127cbb8fd36f42
BLAKE2b-256 2db758801cc87c7d8653cf7b25d70e5445c5722ef15fed8e09095d62914caaac

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1.tar.gz:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: lattice_dsp-0.1.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 244.9 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lattice_dsp-0.1.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 ecfcad7c2936b16cf5d4b4998856c21788d5c739a1946ecd5716e59b8f31d2d7
MD5 42298818b28eda2a84e8bb5197fd2962
BLAKE2b-256 f83c68a54af4871e87d2e813ecb6b7a339199dd5c13792a325146efac2d0e330

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp314-cp314-win_amd64.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp314-cp314-win32.whl.

File metadata

  • Download URL: lattice_dsp-0.1.1-cp314-cp314-win32.whl
  • Upload date:
  • Size: 214.3 kB
  • Tags: CPython 3.14, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lattice_dsp-0.1.1-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 c49df8bbee545826e7745fbcec4bf3e1baa815f67f200107b1ebe28ad21c720d
MD5 c2271bfef0699bac105abb211a77f68a
BLAKE2b-256 892e26fb01f13f4a44071733e73c160a1232f261e9beca1f6778f130c4cf1a26

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp314-cp314-win32.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lattice_dsp-0.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 22f7402650f2e50d78a88222cf2958a6c5f7f31280ab02a2d71b9ea4ec942784
MD5 3f7ed297ec4de4ae282557c9b543ba39
BLAKE2b-256 30c5ad5f8b5097d4a0a3c278effe6b57f7644701856e85f627493bd8770b518b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lattice_dsp-0.1.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9649f8cda8c6570233df5468e5146af5a6a605efa942f1315eb000f6737b07f
MD5 ad3287ad1283dca74cea154edddf8bff
BLAKE2b-256 f593e9541079c49bdf9a1ae59487989e479c16fc173ea22fb751c56bc0e0998e

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: lattice_dsp-0.1.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 240.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lattice_dsp-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b38cbcac791ead84f9f521426511eabea36ae24bfa5f5dabde5a06f95c6de843
MD5 ed851ab726a4f99db7292d1074ffd739
BLAKE2b-256 2e54a16d1c0ff7d160969d2a89e1d4895c0eade1554c9d259ca617db33f735a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp313-cp313-win_amd64.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp313-cp313-win32.whl.

File metadata

  • Download URL: lattice_dsp-0.1.1-cp313-cp313-win32.whl
  • Upload date:
  • Size: 210.5 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lattice_dsp-0.1.1-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 ef0394e57a66b91a2306e6e9ae7c1f4000ad27724151cc02ae74ee3589c33c47
MD5 40c5b80ca63f4ff0303a7b4b609de187
BLAKE2b-256 ce34f69adf10f7fc3a5ec7554ccc8e9cc1b5c221f54252662cef5530ff93148c

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp313-cp313-win32.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lattice_dsp-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a09408329f3e7347fc4921d69668d70e4da0c3e1a5c03fcc197ea93317e25488
MD5 2df4ae0b035de02acbcb07b2d7fedf8b
BLAKE2b-256 022faab1c0c58b19a412402454628b31cd13b6d602c21e020b8ce83f48b2fa5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lattice_dsp-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fbfa0ff6f4ed738c172423e7a6f620056946c43f3013934e9f5551cfca558c55
MD5 d6c515cf8f9ab2f23d38dd26b0b6390d
BLAKE2b-256 3e70adf51d0b7f8b0ad7de2ee507a52f5a2bb100f9712611396d3ec5ba190dcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: lattice_dsp-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 240.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lattice_dsp-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2df52f10ee4377b395690155ea2690913be56066063efc068543ce31ce299570
MD5 a7be42f9988639489340b8df45064b2b
BLAKE2b-256 09588c54b7eff3b1a1cea39ed61a7c70f38e53aedcbbdb3640d336c144b0a8b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp312-cp312-win_amd64.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp312-cp312-win32.whl.

File metadata

  • Download URL: lattice_dsp-0.1.1-cp312-cp312-win32.whl
  • Upload date:
  • Size: 210.5 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lattice_dsp-0.1.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 79842620eff4124cf78c2b97da75ae4f27cea605d51c6083e2afead22b1e1c07
MD5 57bdca2ac4dae2e8d11d2b16a4209533
BLAKE2b-256 f0ae0d04184c1f28c3748ee562cdbf12c300064f2894b47cdb43a4ff77978c6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp312-cp312-win32.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lattice_dsp-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f9012e7591196a17fa76ab45a3ee2f3157f9cd752c156b0351ed39ef83b12dec
MD5 a7b7e62df49a646f47ee7a72b073e857
BLAKE2b-256 85aab1705bdd6a815119eb3f35d394848dcb980c826ab0559d7f249732540120

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lattice_dsp-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lattice_dsp-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c482156744fdaea2794934b0724e4610da34410ec70b1b0c370f55636414fdb
MD5 750003c8ae9c04c6389d62b8d8054a5f
BLAKE2b-256 ccd062c3caf4f6a543d06046af60fa0d463301398e3d93f444f53202ed463864

See more details on using hashes here.

Provenance

The following attestation bundles were made for lattice_dsp-0.1.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on smiryusupov/lattice-dsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page