multiplierless package

Submodules

multiplierless.fir_design module

CLI for multiplierless FIR filter design — JSON-in, CSD-out.

Reads filter specifications from a JSON file, runs the ellipsoid-method optimization with CSD-quantized coefficients, and outputs:

  • CSD-quantized impulse response coefficients (numeric + CSD string)

  • Optionally, a synthesizable Verilog module via csdigit.csd_multiplier

multiplierless.fir_design.create_lowpass_case_params(N, wpass, wstop, delta0_wpass, delta0_wstop, discretization_factor)[source]

Build a LowpassOracle with fully parameterized filter specs.

multiplierless.fir_design.main(argv=None)[source]

multiplierless.lowpass_oracle_q module

Lowpass Oracle Q

This code defines a class called LowpassOracleQ, which helps design multiplierless lowpass filters. A lowpass filter allows low-frequency signals to pass through while reducing or blocking high-frequency signals. The “multiplierless” aspect means the filter works without multiplication operations.

The LowpassOracleQ class takes two inputs: ‘nnz’ (number of non-zero elements) and ‘lowpass’ (another object related to lowpass filter design).

The main functionality is the ‘assess_optim_q’ method. It evaluates and optimizes the filter design by checking feasibility, converting to CSD representation, and calling the lowpass object’s optimization method.

The code uses spectral factorization, inverse spectral factorization, and CSD (Canonical Signed Digit) representation.

class multiplierless.lowpass_oracle_q.LowpassOracleQ(nnz: int, lowpass: Any)[source]

Bases: object

Oracle for multiplierless lowpass filter design with CSD constraints.

This oracle integrates spectral factorization with Canonical Signed Digit (CSD) representation to enable optimization of FIR filter coefficients while constraining the number of non-zero CSD digits. It is used in ellipsoid method optimization to iteratively refine filter designs.

The oracle assesses feasibility and optimizes filter coefficients by: 1. Converting coefficients to minimum-phase impulse response 2. Converting to CSD representation with the specified constraint 3. Computing the inverse spectral factorization 4. Using cutting planes to guide optimization

assess_optim_q(r: ndarray | float, Spsq: float, retry: bool) Tuple[Tuple[ndarray | float, float], ndarray | float, float | None, bool][source]

Assesses and optimizes the lowpass filter design with CSD constraints.

Parameters:
  • r (Arr) – Filter coefficients.

  • Spsq (float) – Frequency response value.

  • retry (bool) – Whether this is a retry attempt.

Returns:

(cut, rcsd, Spsq2, can_retry) containing optimized coefficients, CSD representation, updated response, and retry flag.

Return type:

Tuple

multiplierless.skeleton module

Multiplierless Filter Design Examples

This module provides examples for designing multiplierless FIR filters using the multiplierless package. These examples demonstrate how to use the core functionality for practical filter design tasks.

References

multiplierless.skeleton.main(args: list[str]) None[source]

Wrapper for multiplierless filter design CLI

This function provides a command-line interface for exploring multiplierless filter design capabilities.

Parameters:

args (List[str]) – command line parameters as list of strings (for example ["--verbose"]).

multiplierless.skeleton.run() None[source]

Calls main() passing the CLI arguments extracted from sys.argv

This function can be used as entry point to create console scripts with setuptools.

multiplierless.spectral_fact module

Spectral Factorization — root-finding (default) + FFT (legacy).

multiplierless.spectral_fact.inverse_spectral_fact(h: ndarray) ndarray[source]
multiplierless.spectral_fact.spectral_fact(r: ndarray) ndarray[source]
multiplierless.spectral_fact.spectral_fact_fft(r: ndarray) ndarray[source]

Kolmogorov 1939 via FFT (legacy).

multiplierless.spectral_fact.spectral_fact_root(r: ndarray, tolerance: float = 1e-08) ndarray[source]

Module contents