# Real Time Predistortions#

The journey of a signal from the digital domain before the DACs to the Device Under Test (DUT) is inherently imperfect. Various components like the DAC, cables, amplifiers, wirebonds, etc., contribute to distortions that can collectively be represented by an impulse response (\(h\)). To address these distortions, the digital signal sent to the DAC can be preprocessed using a filter with an inverse response (\(h_{inv}\)) that counteracts these distortions. This predistortion ensures that the signal reaching the DUT aligns with the desired waveform.

Traditionally, achieving this predistortion involves storing and playing the predistorted waveform through an Arbitrary Waveform Generator (AWG). However, this method requires predistorting each waveform separately before uploading it to the device, leading to longer loading times. Additionally, playing consecutive waveforms pose challenges, as each waveform might have a “tail” due to the predistortion process, potentially reaching the memory limit of the AWG.

An alternative and more efficient approach is integrating a filter with the inverse impulse response into the output path of the AWG. With this configuration, the filter only needs programming once. Subsequently, all waveforms passing through the system undergo predistortion, ensuring that the quantum device consistently receives the intended waveform. Moreover, incorporating the “tail” of the predistorted waveform facilitates seamless playback of consecutive waveforms.

## Filters in Qblox QCM#

The Quantum Control Module (QCM) modules now feature support for five real-time predistortion filters per output, as depicted in the image above. The four exponential overshoot correction filters and one FIR filter are positioned just before the QCM outputs, and are each designed to address different categories of distortions. Note that each filter can be configured independently.

**Exponential overshoot/undershoot filter**:This filter adjusts the waveform to counteract exponential overshoot or undershoot distortions, effectively restoring the original waveform at the DUT. Configuration involves setting the time constant (tau) and relative amplitude (amp) of the distortion using the

`out{x}_exp{y}_coeffs([<tau (ns)>, <amp>])`

parameter. Here,`x`

represents the QCM output to which the filter is applied, and`y`

denotes the index of the exponential overshoot filter (0, 1, 2, or 3). The time constant must be between [6 ns, 2 ms], while a relative amplitude range of [-1, 1). Note that a positive relative amplitude corrects for exponential overshoot, while a negative relative amplitude corrects for exponential undershoot.**FIR filter**:The FIR filter enables arbitrary predistortion of the waveform using 32 coefficients, corresponding to a 32 ns filter window. This filter can be utilized to correct short timescale distortions or for other applications as needed. To set the 32 coefficients, use the

`out{x}_fir_coeffs([c1, c2, c3, ..., c32])`

parameter, where`x`

denotes the QCM output on which the filter is activated. Each coefficient within the range of [-2, 2).

## Bypasses and Delays#

In addition to configuring the coefficients of the filters, each filter has a `state`

parameter. The state of each filter can be queried and set using the `out{x}_exp{y}_state()`

parameter for the exponential overshoot filter state, or the `out{x}_fir_state()`

parameter, where `x`

is the index of the QCM output on which the filter activated on (0,1,2 or 3), and `y`

is the index of the exponential overshoot filter (also 0,1,2 or 3).

The state of each filter can be set to one of these values:

`'enabled'`

: This state activates the filter, enabling its effect on the signal. This is only available in QCM.`'bypassed'`

: Selecting this state disables the filter, allowing the signal to pass through without alteration. This is available on either QCM, QRM, QCM-RF, QRM-RF.`'delay_comp'`

: This state deactivates the filter but introduces a delay in the signal equivalent to the delay incurred if the signal had passed through the filter. This is available on either QCM, QRM, QCM-RF, QRM-RF.

The `'delay_comp'`

option state can be utilized when a filter is enabled on one output but disabled on another, ensuring synchronization of pulses from both outputs despite the differing filter configurations.

To get the delay of an output path, use `out{x}_output_latency()`

. Then you can align all other outputs and sequencers by activating `'delay_comp'`

so that signals arrive at the same time at the DUT. The following figure shows the delay caused by each filter. There is also a base delay unless the whole filter chain is bypassed.

Note

The additional latency in the output path can cause the time-of-flight to change accordingly. Be sure to change your sequence with acquisitions to ensure that the time-of-flight is correct.

## Markers and non-QCM outputs#

All the marker outputs and the Qblox QRM, QCM-RF and QRM-RF outputs do not have any filters, but might still need to be synchronized with the Qblox QCM outputs when filters are activated. So each marker and each QRM, QCM-RF and QRM-RF output can also be optionally delay compensated using the `marker{x}_exp{y}_state()`

, `marker{x}_fir_state()`

for marker outputs and `out{x}_exp{y}_state()`

, `out{x}_fir_state()`

for QRM, QCM-RF and QRM-RF outputs.

Since no filter is involved, there are only two possible values:

`'bypassed'`

: Disables any filtering, allowing the signal to pass through as quickly as possible.`'delay_comp'`

: Introduces a delay equivalent to the delay incurred if the signal had passed through a filter.*

## Simulation#

The filters mentioned above may be simulated using functions from `qblox_instruments.simulations.predistortions`

. The functions listed here allow you to predict the behaviour of the filters given the coefficients that are applied to them, and can be used to determine the correct coefficients. These functions only show the theoretical performance of the filters, as they are solely dependent on the coefficients. For a more accurate representation of hardware behavior, please use the function provided by Qblox. If you do not have access to these functions, please contact Qblox customer support.

This can be done by measuring the impulse response \(h\) of the path to the DUT perhaps using an oscilloscope, or a technique that is specific to your system (like the Cryoscope). The impulse response can then be inverted to get \(h_{inv}\). Then the simulation functions can be used to find the filter coefficient values that have the best match to the inverse impulse response.

`qblox_instruments.simulations.predistortions`

file provides the following functions:

`get_filter_delay`

: Returns the latency in the output line when certain filters are turned on.`exponential_overshoot_correction`

: Simulates the behaviour of the exponential overshoot filter.`fir_correction`

: Simulates the behaviour of the FIR filter.`get_impulse_response`

: Converts a set of output path coefficients to an FIR of desired length.