Skip to main content

Parks-McClellan Remez FIR design algorithm

Project description

pm-remez: Parks-McClellan Remez FIR design algorithm

Crates.io Rust Rust Docs Python Python Docs License License: MIT

pm-remez is a modern Rust implementation of the Parks-McClellan Remez exchange algorithm. It can be used as a Rust library and as a Python package via its Python bindings.

pm-remez supports the design of FIR filters with even symmetry and odd symmetry, and with an even number of taps and an odd number of taps, by reducing all these cases to the even symmetry odd number of taps case. The desired frequency response in each band, as well as the weights, can be defined as arbitrary functions. The library can use double-precision IEEE 754 floating-point numbers for calculations, as well as other higher precision floating-point implementations, such as num-bigfloat. This can be used to solve numerically challenging problems that are difficult to solve using double-precision arithmetic.

The implementation draws ideas from a paper by S.I. Filip to make the algorithm robust against numerical errors. These ideas include the use of Chebyshev proxy root finding to find the extrema of the weighted error function in the Remez exchange step.

Documentation

The documentation for the Rust crate is hosted in docs.rs/pm-remez.

The documentation for the Python package is hosted in pm-remez.readthedocs.io.

The Python package documentation contains a series of examples that show how to use pm-remez to design commonly used types of FIR filters. These illustrate the capabilities of pm-remez and also serve as a filter design guide. The documentation of the Rust crate contains a few examples of the Rust API. The Python examples can also be written in Rust (and in fact this is done as part of integration testing).

Python package

The pm-remez Python package is published in PyPI. There are pre-built binary packages for common architectures and operating systems. For these, the package can be installed by doing

pip install pm-remez

Building

The pm-remez crate uses ndarray-linalg to solve eigenvalue problems. This in turn depends on LAPACK. The pm-remez crate has several feature flags that are used to select the LAPACK backend. Exactly one of these features needs to be enabled to build pm-remez. The feature flags are openblas-static, openblas-system, netlib-static, netlib-system, intel-mkl-static and intel-mkl-system. The -static versions of each flag build the LAPACK backend and link statically against it. The -system versions link against a system-installed library (linking can be dynamic or static depending on which type of library is installed). For example,

cargo build --release --features openblas-system

will build against a system-installed OpenBLAS library.

The Python package is built using maturin. It can be built with

maturin build --release

or

python -mbuild

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

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

pm_remez-0.1.2.tar.gz (60.4 kB view details)

Uploaded Source

Built Distributions

pm_remez-0.1.2-cp38-abi3-win_amd64.whl (16.6 MB view details)

Uploaded CPython 3.8+ Windows x86-64

pm_remez-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

pm_remez-0.1.2-cp38-abi3-macosx_11_0_arm64.whl (829.4 kB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

pm_remez-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl (822.2 kB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

Details for the file pm_remez-0.1.2.tar.gz.

File metadata

  • Download URL: pm_remez-0.1.2.tar.gz
  • Upload date:
  • Size: 60.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for pm_remez-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6736818f529609037a97cfd9584d0eda0f0d93589575ff3b54b9ef0337f219df
MD5 de35372d29b32034951814c4ab869b5e
BLAKE2b-256 433b68188bd82e97c9ed77dd48c9558362deae09f01b8f8ca647042f0a2e7d68

See more details on using hashes here.

File details

Details for the file pm_remez-0.1.2-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for pm_remez-0.1.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 aef5f9a3986fba60dcd52570ed637992130645eefc1081110ba7f46a3225be9f
MD5 a123239b01fb21d4a65e8f91b3fef02b
BLAKE2b-256 dff7db7a8c54eef02da6ef442a154f020ae92361938892acbee1633d4338853e

See more details on using hashes here.

File details

Details for the file pm_remez-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pm_remez-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd92a15ddc1371d1fafad05f68f3f3a7487e974d5ce0813437df9c8353d875ed
MD5 0db96f969b9ac441856943a606873be6
BLAKE2b-256 d2ed75c32c4771e301129986a04503d33c89f2f0d6fa34512a8f22e5b5c4fbf3

See more details on using hashes here.

File details

Details for the file pm_remez-0.1.2-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pm_remez-0.1.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 de83718bb6b37229285abef3203424f82334e39507ffd6ab399866795a8bd608
MD5 a8cbc880302f43feb8ee313973acbec5
BLAKE2b-256 1a41e33319a4e20505f99e9cff95482cd1a8e606614427553ad4f2ba1d518251

See more details on using hashes here.

File details

Details for the file pm_remez-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pm_remez-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 89a63a4b91c4fa94bf55399551f01a3195d0591cd0e2d62f7aca53fc9ece714f
MD5 4c359a50c7b8c927dcb1b387dd701104
BLAKE2b-256 0876bf07ee9d0248a29f2e65695d4df9c9a125c50f2ce6d942688f5dc26c1298

See more details on using hashes here.

Supported by

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