qampy.helpers#

Convenient helper functions

Functions

cabssquared(x)

Calculate the absolute squared of a complex number

dB2lin(x)

Convert input from dB(m) units to linear units

dump_edges(E, N)

Remove N samples from the front and end of the input field.

find_pilot_idx([nframe, frame_len, os_rate, ...])

find pilot index for object with both pilot sequence (at the beginning) and phase pilot.

get_center_shift_fac(E)

Obtain shift factor (x_shift, y_shift) that is used to center the signal.

lin2dB(x)

Convert input from linear units to dB(m)

normalise_and_center(E)

Normalise and center the input field, by calculating the mean power for each polarisation separate and dividing by its square-root

normalise_and_center_pil(sig, idx_pil)

Normalise and center the input field only based on pilot symbols, by calculating the mean power for each polarisation separate and dividing by its square-root

rescale_signal(E[, swing])

Rescale the (1-pol) signal to (-swing, swing).

set_mid_and_resale(E[, mid_pos, swing])

Change (1-pol) signal mid-position to given value and rescale the real signal to (-swing, swing).

set_mid_point(E[, mid_pos])

Move the (1-pol) signal's mid-position to given value