Utils Package (ria_toolkit_oss.utils)

The Helpers module contains a bunch of helper functions, including array conversion utilities.

Array Conversion

IQ data represents the in-phase (I) and quadrature (Q) components of a signal. There are two ways to represent single-channel IQ signals:

  1. Complex 1xN Format: In the complex 1xN format, the IQ data is represented as a 2D array of complex numbers with shape 1xN. In this format, the real part of each complex number represents the in-phase component, while the imaginary part represents the quadrature component.

  2. Real 2xN Format: In the real 2xN format, the IQ data is represented as a 2D array of real numbers with shape 2xN. In this format, the first row contains the in-phase components, while the second row contains the quadrature components.

This submodule provides functions to verify and convert between these two formats.

ria_toolkit_oss.utils.array_conversion.convert_to_2xn(arr)[source]

Convert arr to the real 2xN format. If arr is already real 2xN, then you’ll get back a copy.

Parameters:

arr (array_like) – Array of IQ samples, in the complex 1XN format.

Returns:

The provided signal, in the real 2xN format.

Return type:

ndarray

ria_toolkit_oss.utils.array_conversion.convert_to_1xn(arr)[source]

Convert arr to the complex 1xN format. If arr is already complex 1xN, then you’ll get back a copy.

Parameters:

arr (ndarray) – Array of IQ samples, in the real 2xN format.

Returns:

The provided signal, in the complex 1xN format.

Return type:

ndarray

ria_toolkit_oss.utils.array_conversion.is_1xn(arr)[source]
Returns:

True is arr is complex 1xN, False otherwise.

Return type:

bool

ria_toolkit_oss.utils.array_conversion.is_2xn(arr)[source]
Returns:

True is arr is real 2xN, False otherwise.

Return type:

bool