qat.experimental.waveforms.shapes.blackman module

Implements the sampling definitions for a Blackman-window waveform shape.

The Blackman waveform is a three-term cosine-sum window function. Mapping the standard discrete-window index variable onto \(x \in [-1, 1]\) yields

\[f(x) = A_0 - A_1 \cos(\pi(x + 1)) + A_2 \cos(2\pi(x + 1)),\]

where the “exact Blackman” coefficients are

\[A_0 = \frac{7938}{18608}, \quad A_1 = \frac{9240}{18608}, \quad A_2 = \frac{1430}{18608}.\]

The waveform is bell-shaped, rising from approximately zero at \(x = -1\), peaking at \(x = 0\), and returning to approximately zero at \(x = +1\).

class BlackmanWaveformShape

Bases: WaveformShape

Waveform-shape wrapper for Blackman sampling functions.

derivative(x, order=1)

Evaluates the derivative of the Blackman waveform shape.

Return type:

ndarray[tuple[int, ...], dtype[complexfloating]]

evaluate(x)

Evaluates the Blackman waveform shape at the sample points.

Return type:

ndarray[tuple[int, ...], dtype[complexfloating]]

sample_blackman_waveform(x)

Samples a Blackman waveform shape.

Parameters:

x (ndarray[tuple[int, ...], dtype[floating]] | list[float]) – The list of values in the range [-1, 1] to sample the waveform for.

Return type:

ndarray[tuple[int, ...], dtype[complexfloating]]

Returns:

The sampled Blackman waveform values as a complex array.

sample_blackman_waveform_derivative(x, order=1)

Samples the derivative of a Blackman waveform shape.

Parameters:
  • x (ndarray[tuple[int, ...], dtype[floating]] | list[float]) – The list of values in the range [-1, 1] to sample the waveform for.

  • order (int) – The order of the derivative to sample. Default is 1.

Return type:

ndarray[tuple[int, ...], dtype[complexfloating]]

Returns:

The sampled Blackman derivative values as a complex array.