b_asic.sfg_generators

B-ASIC signal flow graph generators.

This module contains a number of functions generating SFGs for specific functions.

b_asic.sfg_generators.direct_form_1_iir(b: Sequence[complex], a: Sequence[complex], name: str | None = None, mult_properties: dict[str, int] | dict[str, dict[str, int]] | None = None, add_properties: dict[str, int] | dict[str, dict[str, int]] | None = None) SFG

Generate a direct-form IIR filter of type I with coefficients a and b.

b_asic.sfg_generators.direct_form_2_iir(b: Sequence[complex], a: Sequence[complex], name: str | None = None, mult_properties: dict[str, int] | dict[str, dict[str, int]] | None = None, add_properties: dict[str, int] | dict[str, dict[str, int]] | None = None) SFG

Generate a direct-form IIR filter of type II with coefficients a and b.

b_asic.sfg_generators.direct_form_fir(coefficients: Sequence[complex], name: str | None = None, mult_properties: dict[str, int] | dict[str, dict[str, int]] | None = None, add_properties: dict[str, int] | dict[str, dict[str, int]] | None = None) SFG

Generate a signal flow graph of a direct form FIR filter.

The coefficients parameter is a sequence of impulse response values:

coefficients = [h0, h1, h2, ..., hN]

Leading to the transfer function:

\[\sum_{i=0}^N h_iz^{-i}\]
Parameters:
coefficients1D-array

Coefficients to use for the FIR filter section.

nameName, optional

The name of the SFG. If None, “Direct-form FIR filter”.

mult_propertiesdictionary, optional

Properties passed to ConstantMultiplication.

add_propertiesdictionary, optional

Properties passed to Addition.

Returns:
Signal flow graph
b_asic.sfg_generators.ldlt_matrix_inverse(N: int, name: str | None = None, mads_properties: dict[str, int] | dict[str, dict[str, int]] | None = None, reciprocal_properties: dict[str, int] | dict[str, dict[str, int]] | None = None) SFG

Generate an SFG for the LDLT matrix inverse algorithm.

Parameters:
Nint

Dimension of the square input matrix.

nameName, optional

The name of the SFG. If None, “Direct-form FIR filter”.

mads_propertiesdictionary, optional

Properties passed to MADS.

reciprocal_propertiesdictionary, optional

Properties passed to Reciprocal.

Returns:
SFG

Signal Flow Graph

b_asic.sfg_generators.radix_2_dif_fft(points: int) SFG

Generate a radix-2 decimation-in-frequency FFT structure.

Parameters:
pointsint

Number of points for the FFT, needs to be a positive power of 2.

Returns:
SFG

Signal Flow Graph

b_asic.sfg_generators.symmetric_fir(coefficients: Sequence[complex], name: str | None = None, mult_properties: dict[str, int] | dict[str, dict[str, int]] | None = None, add_properties: dict[str, int] | dict[str, dict[str, int]] | None = None) SFG

Generate a signal flow graph of a symmetric FIR filter.

The coefficients parameter is a sequence of impulse response values of even length:

coefficients = [h0, h1, h2, ..., hN]

Leading to the transfer function:

\[\sum_{i=0}^N h_iz^{-i}\]
Parameters:
coefficients1D-array

Coefficients to use for the FIR filter section.

nameName, optional

The name of the SFG. If None, “Transposed direct-form FIR filter”.

mult_propertiesdictionary, optional

Properties passed to ConstantMultiplication.

add_propertiesdictionary, optional

Properties passed to Addition.

Returns:
Signal flow graph
b_asic.sfg_generators.transposed_direct_form_fir(coefficients: Sequence[complex], name: str | None = None, mult_properties: dict[str, int] | dict[str, dict[str, int]] | None = None, add_properties: dict[str, int] | dict[str, dict[str, int]] | None = None) SFG

Generate a signal flow graph of a transposed direct form FIR filter.

The coefficients parameter is a sequence of impulse response values:

coefficients = [h0, h1, h2, ..., hN]

Leading to the transfer function:

\[\sum_{i=0}^N h_iz^{-i}\]
Parameters:
coefficients1D-array

Coefficients to use for the FIR filter section.

nameName, optional

The name of the SFG. If None, “Transposed direct-form FIR filter”.

mult_propertiesdictionary, optional

Properties passed to ConstantMultiplication.

add_propertiesdictionary, optional

Properties passed to Addition.

Returns:
Signal flow graph
b_asic.sfg_generators.wdf_allpass(coefficients: Sequence[float], name: str | None = None, latency: int | None = None, latency_offsets: dict[str, int] | None = None, execution_time: int | None = None) SFG

Generate a signal flow graph of a WDF allpass section based on symmetric two-port adaptors.

Simplifies the SFG in case an adaptor operation is 0.

Parameters:
coefficients1D-array

Coefficients to use for the allpass section.

nameName, optional

The name of the SFG. If None, “WDF allpass section”.

latencyint, optional

Latency of the symmetric two-port adaptors.

latency_offsetsoptional

Latency offsets of the symmetric two-port adaptors.

execution_timeint, optional

Execution time of the symmetric two-port adaptors.

Returns:
Signal flow graph