Parks-McClellan Remez FIR design algorithm
Project description
pm-remez: Parks-McClellan Remez FIR design algorithm
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
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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
Built Distributions
File details
Details for the file pm_remez-0.1.3.tar.gz
.
File metadata
- Download URL: pm_remez-0.1.3.tar.gz
- Upload date:
- Size: 60.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66f22e18fc2a6902fc7bcbb2432d13842c930eab916a681c085209ecda583dab |
|
MD5 | 065de2155ed260154f954070ace3ed53 |
|
BLAKE2b-256 | 81d6ffef3fc3b817da8ba3c498de9005c74dd934a4b44d23cb41dbd8457e157e |
File details
Details for the file pm_remez-0.1.3-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: pm_remez-0.1.3-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 16.6 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f76f944cdb840736eb9c23abb9de43195cb65a189000c7802a37f9e0db57788 |
|
MD5 | a0560435fa3f89abd23a0cd156f5e2d9 |
|
BLAKE2b-256 | 6b1ca5db19c77648029cd86104655bbf5de640993e9ddcf2361693f3192124f8 |
File details
Details for the file pm_remez-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pm_remez-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a264cf602085d118aef5fd1d71b1d100b60050056830a936a8fd11dfbd038d0e |
|
MD5 | 6f2b7e4252e8e5f70729851204704ac6 |
|
BLAKE2b-256 | f807f05b3b887de93c7982933faa122bd884512c524fd765e0572ad0e4ba2275 |
File details
Details for the file pm_remez-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pm_remez-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 829.4 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 746adbf7460bf56ee01ea5ae6f9ad6f5e35b479fc0adaa992550c1cdab8d63b0 |
|
MD5 | c740bcfdd6bb70c509398fd03030cd63 |
|
BLAKE2b-256 | 328657d24e7385a14046ae31c77f4b3d4b753721729a7c8b022b1778b2697e70 |
File details
Details for the file pm_remez-0.1.3-cp38-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: pm_remez-0.1.3-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 822.2 kB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7823f65f735d1f2161ae5e8496c1f94564382502832bd7769ca5eea05c9a546f |
|
MD5 | 04575e3590513faf4df53f7e2f065cf1 |
|
BLAKE2b-256 | e204054ebb75751eb2b65b8059d38ba4c9489e661e7eb7463f6f8be24393cbcb |