digital_pre_compensation#

Digital pre-distortion and compensation of transceiver impairments

qampy.core.digital_pre_compensation.cal_lut(tx_sig, rx_sig, ref_sym, mem_len=3, idx_data=None, real_ptrns=True)#

Calculate a lookup table for precompensation of pattern based errors. This can be considered a simplified Volterra filter. The function works on 1D signals only, if more dimenions (modes) are desired one has to loop.

Parameters:
  • tx_sig (array_like) – The transmitted signal, needs to be 1D

  • rx_sig (array_like) – The received signal, needs to be 1D

  • ref_sym (array_like) – The symbol alphabet as complex numbers

  • mem_len (int, optional) – Length of the pattern compensation

  • idx_data (array_like, optional) – index array if calculation on only a subset of symbols is desired. (Default is operate on full array). IMPORTANT: if operating on the full array, we will use the symbols from the end of the array for the beginning pattern. So like the first mem_len//2 symbols should be skipped

  • real_ptrns (bool, optional) – whether to operate on the complex patterns or on the in-phase and quadrature components. Operating on the complex patterns increases LUT size significantly (default: operate on in-phase and quadrature separately)

Returns:

  • ea (array_like) – average error LUT.

  • idx_I (array_like) – index map of symbol to pattern in LUT, in-phase component

  • idx_Q (array_like) – index map of symbol to pattern in LUT, quadrature component, if real_ptrns is False, this will be the same as idx_I

qampy.core.digital_pre_compensation.clipper(sig, clipping_level)#

Clip signal to the range (-clipping_level, clipping_level).

qampy.core.digital_pre_compensation.comp_dac_resp(dpe_fb, sim_len, rrc_beta, PAPR=9, prms_dac=(16000000000.0, 2, 'sos', 6), os=2)#

Compensate frequency response of a simulated digital-to-analog converter(DAC).

Parameters:
  • dpe_fb (int) – symbol rate to compensate for

  • sim_len (int) – length of the oversampled signal array

  • rrc_beta (float) – root-raised cosine roll-off factor of the simulated signal

  • PAPR (int (optional)) – peak to average power ratio of the signal

  • prms_dac (tuple(float, int, str, int)) – DAC filer parameters for calculating the filter response using scipy.signal

  • os (int (optional)) – oversampling factor of the signal

qampy.core.digital_pre_compensation.comp_mod_sin(sig, vpi=1.14)#

Use arcsin() function to compensate modulator nonlinear sin() response.

Parameters:
  • sig (array_like) – Complex input signal should be in range (-1,1)

  • vpi (complex or float, optional) – Vpi of the modulator if a float both Vpi of real and imaginary part are assumed to be the same

qampy.core.digital_pre_compensation.find_sym_patterns(sig, ref_sym, N, ret_ptrns=False)#

Find and index patterns elements of length N.

Parameters:
  • sig (array_like) – Array where to look for patterns

  • ref_sym (array_like) – Reference elements/symbols which we look for

  • N (int) – pattern length

  • ret_ptrns (bool, optional) – Also return the patterns of elements

Returns:

  • pattern_idx (array_like) – index array of patterns in the signal

  • if ret_ptrns

    sym_ptrnsarray_like

    Array of possible patterns