get_fixed_filter

qugradlab.pulses.filtering.get_fixed_filter(n_pieces_in_spline: int, piece_length: float, samples_per_piece: int, low_pass_time_constant: float, high_pass_time_constant: float, low_pass_order: float, spline_order: int, high_pass_order: float) Callable[[ndarray[complex128]], Any][source]

Generates a Callable that applies the defined filter to the input signal represented by a spline. The filter has a transfer function of the form

\[ T(\omega)=\frac{(i\omega\tau')^m}{(1+i\omega\tau)^n}. \]
where \(\tau'\) corresponds to high_pass_time_constant, \(m\) corresponds to high_pass_order, \(\tau\) corresponds to low_pass_time_constant, and \(n\) corresponds to low_pass_order.

Consider the spline

\[\begin{split} \begin{aligned} f\left(t\right)&\coloneqq\sum_{i=0}^L\sqcap_i\left(t\right)\sum_{j=0}^N f^-_{ij}\left(t-t_i\right)^j\quad\textrm{where }\sqcap_i\left(t\right) \coloneqq\begin{cases} 1&t_i\le t< t_{i+1},\\ 0&\textrm{otherwise}, \end{cases}\\ &\equiv\sum_{i=0}^L\sqcap_i\left(t\right)\sum_{j=0}^N f^+_{ij}\left(t-t_{i+1}\right)^j\quad \textrm{where }f^\pm_{ij}\equiv\sum_{k=j}^N {k\choose j}\left(\pm[t_{i+1}-t_i]\right)^{j-k}f^\mp_{ik} \end{aligned} \end{split}\]

where \(L\) correspodns to n_pieces_in_spline, \(N\) corresponds to spline_order, and \(t_{i+1}-t_i\) corresponds to piece_length.

If we apply the transfer function \(T(\omega)\) to the spline \(f(t)\) we find the filtered spline is given by

\[\begin{split} f'\left(t\right)=\tau^{-n}\tau'^{m}\sum_{i=0}^L\sum_{j=0}^N\Delta f_{ij} \Theta\left(t-t_i\right)\frac{\Gamma\left(j+1\right) \left(t-t_i\right)^{n-m+j}}{\Gamma\left(n-m+j+1\right)} {_1F_1}\left[\begin{matrix} n\\ n-m+j+1 \end{matrix}\:; -\left(t-t_i\right)\tau^{-1}\right] \end{split}\]
where \(\Delta f_{ij}\coloneqq f^-_{ij}-f^+_{\left(i-1\right)j}\), \(\Theta\) is the Heaviside step function, \(\Gamma\) is the Gamma function, and \({_1F_1}\) is the confluent hypergeometric function.

Parameters:
  • n_pieces_in_spline (int) – The number of pieces in the spline

  • piece_length (float) – The length of each piece in the spline

  • samples_per_piece (int) – The number of samples per piece in the spline

  • low_pass_time_constant (float) – The time constant of the low pass type filter. To apply a pure low pass filter set high_pass_order_constant = 0.

  • high_pass_time_constant (float) – The time constant of the high pass type filter. To apply a pure high pass filter high_pass_time_constant should equal low_pass_time_constant.

  • low_pass_order (float) – The order of the low pass type filter. To apply a pure low pass filter set high_pass_order = 0.

  • spline_orders (NDArray[Shape[n_orders], int]) – The orders of the spline. 0 corresponds to piecewise constant, 1 corresponds to piecewise linear, etc.

  • high_pass_order (float) – The order of the high pass type filter. To apply a pure high pass filter high_pass_time_constant should equal low_pass_time_constant and high_pass_order should equal low_pass_order.

Returns:

A callable that takes a spline and returns the filtered spline.

PARAMETERS:
  • time_spline_matrix (NDArray[np.complex128]) — This matrix defines the spline and corresponds to \(\Delta f_{ij}\).

RETURNS:

The filtered spline \(f'(t)\) evaluated at samples_per_piece equally spaced points per piece of the splice. The shape will be (..., samples_per_piece * n_peices_in_spline).

RETURN TYPE:

TensorFlow Tensor

Return type:

Callable[[NDArray[np.complex128]], Any]