b_asic.fft_operations

Inheritance diagram of b_asic.fft_operations

B-ASIC FFT Operations Module.

Contains selected FFT butterfly operations.

class b_asic.fft_operations.R2Butterfly(src0: SignalSourceProvider | None = None, src1: SignalSourceProvider | None = None, name: str = '', latency: int | None = None, latency_offsets: dict[str, int] | None = None, execution_time: int | None = None)

Bases: AbstractOperation

Radix-2 butterfly operation for FFTs.

Gives the result of adding its two inputs, as well as the result of subtracting the second input from the first one. This corresponds to a 2-point DFT.

\[\begin{split}y_0 & = x_0 + x_1\\ y_1 & = x_0 - x_1\end{split}\]
Parameters:
src0, src1SignalSourceProvider, optional

The two signals to compute the 2-point DFT of.

nameName, optional

Operation name.

latencyint, optional

Operation latency (delay from input to output in time units).

latency_offsetsdict[str, int], optional

Used if inputs have different arrival times or if the inputs should arrive after the operator has stared. For example, {"in0": 0, "in1": 1} which corresponds to src1 arriving one time unit later than src0 and one time unit later than the operator starts. If not provided and latency is provided, set to zero. Hence, the previous example can be written as {"in1": 1} only.

execution_timeint, optional

Operation execution time (time units before operator can be reused).

evaluate(a, b, data_type=None) int | float | complex | type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | APyFixed | APyCFixed | APyFloat | APyCFloat

Evaluate the operation and generate a list of output values.

Parameters:
*inputs

List of input values.

data_typeDataType, optional

Data type to use for quantization during evaluation.

is_linear = True
classmethod type_name() TypeName

Get the type name of this graph component.

class b_asic.fft_operations.R2DIFButterfly(w: complex, src0: SignalSourceProvider | None = None, src1: SignalSourceProvider | None = None, name: str = '', latency: int | None = None, latency_offsets: dict[str, int] | None = None, execution_time: int | None = None)

Bases: AbstractOperation

Radix-2 decimation-in-frequency butterfly operation for FFTs.

Gives the result of adding its two inputs, as well as the result of subtracting the second input from the first one. This corresponds to a 2-point DFT. The second output is multiplied with the provided twiddle factor (TF).

\[\begin{split}y_0 & = x_0 + x_1\\ y_1 & = w(x_0 - x_1)\end{split}\]
Parameters:
wcomplex

Twiddle factor to multiply the second output with.

src0, src1SignalSourceProvider, optional

The two signals to compute the 2-point DFT of.

nameName, optional

Operation name.

latencyint, optional

Operation latency (delay from input to output in time units).

latency_offsetsdict[str, int], optional

Used if inputs have different arrival times or if the inputs should arrive after the operator has stared. For example, {"in0": 0, "in1": 1} which corresponds to src1 arriving one time unit later than src0 and one time unit later than the operator starts. If not provided and latency is provided, set to zero. Hence, the previous example can be written as {"in1": 1} only.

execution_timeint, optional

Operation execution time (time units before operator can be reused).

evaluate(a, b, data_type=None) int | float | complex | type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | APyFixed | APyCFixed | APyFloat | APyCFloat

Evaluate the operation and generate a list of output values.

Parameters:
*inputs

List of input values.

data_typeDataType, optional

Data type to use for quantization during evaluation.

is_linear = True
classmethod type_name() TypeName

Get the type name of this graph component.

property w: complex

Get the twiddle factor.

class b_asic.fft_operations.R2DITButterfly(w: complex, src0: SignalSourceProvider | None = None, src1: SignalSourceProvider | None = None, name: str = '', latency: int | None = None, latency_offsets: dict[str, int] | None = None, execution_time: int | None = None)

Bases: AbstractOperation

Radix-2 decimation-in-time butterfly operation for FFTs.

Gives the result of adding its two inputs, as well as the result of subtracting the second input from the first one. This corresponds to a 2-point DFT. The second input is multiplied with the provided twiddle factor (TF).

\[\begin{split}y_0 & = x_0 + w*x_1\\ y_1 & = x_0 - w*x_1\end{split}\]
Parameters:
wcomplex

Twiddle factor to multiply the second input with.

src0, src1SignalSourceProvider, optional

The two signals to compute the 2-point DFT of.

nameName, optional

Operation name.

latencyint, optional

Operation latency (delay from input to output in time units).

latency_offsetsdict[str, int], optional

Used if inputs have different arrival times or if the inputs should arrive after the operator has stared. For example, {"in0": 0, "in1": 1} which corresponds to src1 arriving one time unit later than src0 and one time unit later than the operator starts. If not provided and latency is provided, set to zero. Hence, the previous example can be written as {"in1": 1} only.

execution_timeint, optional

Operation execution time (time units before operator can be reused).

evaluate(a, b, data_type=None) int | float | complex | type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | APyFixed | APyCFixed | APyFloat | APyCFloat

Evaluate the operation and generate a list of output values.

Parameters:
*inputs

List of input values.

data_typeDataType, optional

Data type to use for quantization during evaluation.

is_linear = True
classmethod type_name() TypeName

Get the type name of this graph component.

property w: complex

Get the twiddle factor.

class b_asic.fft_operations.R2TFButterfly(w0: complex, w1: complex, src0: SignalSourceProvider | None = None, src1: SignalSourceProvider | None = None, name: str = '', latency: int | None = None, latency_offsets: dict[str, int] | None = None, execution_time: int | None = None)

Bases: AbstractOperation

Radix-2 butterfly operation for FFTs with twiddle factor (TF) multiplications at both outputs.

Gives the result of adding its two inputs, as well as the result of subtracting the second input from the first one. This corresponds to a 2-point DFT. Both outputs are multiplied with the provided TFs.

\[\begin{split}y_0 & = w_0(x_0 + x_1)\\ y_1 & = w_1(x_0 - x_1)\end{split}\]
Parameters:
w0complex

Twiddle factor to multiply the first output with.

w1complex

Twiddle factor to multiply the second output with.

src0, src1SignalSourceProvider, optional

The two signals to compute the 2-point DFT of.

nameName, optional

Operation name.

latencyint, optional

Operation latency (delay from input to output in time units).

latency_offsetsdict[str, int], optional

Used if inputs have different arrival times or if the inputs should arrive after the operator has stared. For example, {"in0": 0, "in1": 1} which corresponds to src1 arriving one time unit later than src0 and one time unit later than the operator starts. If not provided and latency is provided, set to zero. Hence, the previous example can be written as {"in1": 1} only.

execution_timeint, optional

Operation execution time (time units before operator can be reused).

evaluate(a, b, data_type=None) int | float | complex | type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | APyFixed | APyCFixed | APyFloat | APyCFloat

Evaluate the operation and generate a list of output values.

Parameters:
*inputs

List of input values.

data_typeDataType, optional

Data type to use for quantization during evaluation.

is_linear = True
classmethod type_name() TypeName

Get the type name of this graph component.

property w0: complex

Get the twiddle factor that the first output is multiplied with.

property w1: complex

Get the twiddle factor that the second output is multiplied with.

class b_asic.fft_operations.R3Winograd(src0: SignalSourceProvider | None = None, src1: SignalSourceProvider | None = None, src2: SignalSourceProvider | None = None, name: str = '', latency: int | None = None, latency_offsets: dict[str, int] | None = None, execution_time: int | None = None)

Bases: AbstractOperation

Three-point Winograd DFT.

\[\begin{split}u & = -\frac{2 \pi}{3} \\ c_{30} & = \cos(u) - 1 \\ c_{31} & = j \sin(u) \\ s_0 & = x_1 + x_2 \\ s_1 & = x_1 - x_2 \\ s_2 & = s_0 + x_0 \\ m_0 & = c_{30} s_0 \\ m_1 & = c_{31} s_1 \\ s_3 & = s_2 + m_0 \\ s_4 & = s_3 + m_1 \\ s_5 & = s_3 - m_1 \\ y_0 & = s_2 \\ y_1 & = s_4 \\ y_2 & = s_5\end{split}\]
Parameters:
src0, src1, src2SignalSourceProvider, optional

The three signals to compute the 3-point DFT of.

nameName, optional

Operation name.

latencyint, optional

Operation latency (delay from input to output in time units).

latency_offsetsdict[str, int], optional

Used if inputs have different arrival times or if the inputs should arrive after the operator has stared. For example, {"in0": 0, "in1": 1, "in2": 0} which corresponds to src1 arriving one time unit later than the other inputs and one time unit later than the operator starts. If not provided and latency is provided, set to zero. Hence, the previous example can be written as {"in1": 1} only.

execution_timeint, optional

Operation execution time (time units before operator can be reused).

evaluate(a, b, c, data_type=None) int | float | complex | type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | APyFixed | APyCFixed | APyFloat | APyCFloat

Evaluate the operation and generate a list of output values.

Parameters:
*inputs

List of input values.

data_typeDataType, optional

Data type to use for quantization during evaluation.

is_linear = True
classmethod type_name() TypeName

Get the type name of this graph component.

class b_asic.fft_operations.R4Butterfly(src0: SignalSourceProvider | None = None, src1: SignalSourceProvider | None = None, src2: SignalSourceProvider | None = None, src3: SignalSourceProvider | None = None, name: str = '', latency: int | None = None, latency_offsets: dict[str, int] | None = None, execution_time: int | None = None)

Bases: AbstractOperation

Radix-4 butterfly operation for FFTs.

This corresponds to a 4-point DFT.

\[\begin{split}s0 & = x_0 + x_2\\ s1 & = x_1 + x_3\\ s2 & = x_0 - x_2\\ s3 & = -jx_1 + jx_3\\ y0 & = s0 + s1\\ y1 & = s2 + s3\\ y2 & = s0 - s1\\ y3 & = s2 - s3\end{split}\]
Parameters:
src0, src1, src2, src3SignalSourceProvider, optional

The four signals to compute the 4-point DFT of.

nameName, optional

Operation name.

latencyint, optional

Operation latency (delay from input to output in time units).

latency_offsetsdict[str, int], optional

Used if inputs have different arrival times or if the inputs should arrive after the operator has stared. For example, {"in0": 0, "in1": 1, "in2": 0, "in3": 0} which corresponds to src1 arriving one time unit later than the other inputs and one time unit later than the operator starts. If not provided and latency is provided, set to zero. Hence, the previous example can be written as {"in1": 1} only.

execution_timeint, optional

Operation execution time (time units before operator can be reused).

evaluate(a, b, c, d, data_type=None) int | float | complex | type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | APyFixed | APyCFixed | APyFloat | APyCFloat

Evaluate the operation and generate a list of output values.

Parameters:
*inputs

List of input values.

data_typeDataType, optional

Data type to use for quantization during evaluation.

is_linear = True
classmethod type_name() TypeName

Get the type name of this graph component.

class b_asic.fft_operations.R5Winograd(src0: SignalSourceProvider | None = None, src1: SignalSourceProvider | None = None, src2: SignalSourceProvider | None = None, src3: SignalSourceProvider | None = None, src4: SignalSourceProvider | None = None, name: str = '', latency: int | None = None, latency_offsets: dict[str, int] | None = None, execution_time: int | None = None)

Bases: AbstractOperation

Five-point Winograd DFT.

Parameters:
src0, src1, src2, src3, src4SignalSourceProvider, optional

The five signals to compute the 5-point DFT of.

nameName, optional

Operation name.

latencyint, optional

Operation latency (delay from input to output in time units).

latency_offsetsdict[str, int], optional

Used if inputs have different arrival times or if the inputs should arrive after the operator has stared. For example, {"in0": 0, "in1": 1, "in2": 0, "in3": 0, "in4": 0,} which corresponds to src1 arriving one time unit later than the other inputs and one time unit later than the operator starts. If not provided and latency is provided, set to zero. Hence, the previous example can be written as {"in1": 1} only.

execution_timeint, optional

Operation execution time (time units before operator can be reused).

evaluate(a, b, c, d, e, data_type=None) int | float | complex | type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | APyFixed | APyCFixed | APyFloat | APyCFloat

Evaluate the operation and generate a list of output values.

Parameters:
*inputs

List of input values.

data_typeDataType, optional

Data type to use for quantization during evaluation.

is_linear = True
classmethod type_name() TypeName

Get the type name of this graph component.

class b_asic.fft_operations.R7Winograd(src0: SignalSourceProvider | None = None, src1: SignalSourceProvider | None = None, src2: SignalSourceProvider | None = None, src3: SignalSourceProvider | None = None, src4: SignalSourceProvider | None = None, src5: SignalSourceProvider | None = None, src6: SignalSourceProvider | None = None, name: str = '', latency: int | None = None, latency_offsets: dict[str, int] | None = None, execution_time: int | None = None)

Bases: AbstractOperation

Seven-point Winograd DFT.

Parameters:
src0, src1, src2, src3, src4, src5, src6SignalSourceProvider, optional

The seven signals to compute the 7-point DFT of.

nameName, optional

Operation name.

latencyint, optional

Operation latency (delay from input to output in time units).

latency_offsetsdict[str, int], optional

Used if inputs have different arrival times or if the inputs should arrive after the operator has stared. For example, {"in0": 0, "in1": 1, "in2": 0, "in3": 0, "in4": 0, "in5": 0, "in6": 0,} which corresponds to src1 arriving one time unit later than the other inputs and one time unit later than the operator starts. If not provided and latency is provided, set to zero. Hence, the previous example can be written as {"in1": 1} only.

execution_timeint, optional

Operation execution time (time units before operator can be reused).

evaluate(a, b, c, d, e, f, g, data_type=None) int | float | complex | type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | APyFixed | APyCFixed | APyFloat | APyCFloat

Evaluate the operation and generate a list of output values.

Parameters:
*inputs

List of input values.

data_typeDataType, optional

Data type to use for quantization during evaluation.

is_linear = True
classmethod type_name() TypeName

Get the type name of this graph component.