phaserecovery#

Functions for carrier offset and phase estimation and correction functions

qampy.core.phaserecovery.bps(E, Mtestangles, symbols, N, method='pyt', **kwargs)#

Perform a blind phase search after _[1]

Parameters:
  • E (array_like) – input signal (single polarisation)

  • Mtestangles (int) – number of test angles to try

  • symbols (array_like) – the symbols of the modulation format

  • N (int) – block length to use for averaging

  • method (string, optional) – implementation method to use has to be “af” for arrayfire (uses OpenCL) or “pyx” for a cython-OpenMP based parallel search or “py” for slow python search

  • **kwargs – arguments to be passed to the search function

Returns:

  • Eout (array_like) – signal with compensated phase

  • ph (array_like) – unwrapped angle from phase recovery

References

..[1] Timo Pfau et al, Hardware-Efficient Coherent Digital Receiver Concept With Feedforward Carrier Recovery for M-QAM Constellations, Journal of Lightwave Technology 27, pp 989-999 (2009)

qampy.core.phaserecovery.bps_af(E, testangles, symbols, N, **kwargs)#

Arrayfire based blind phase search. See bps for parameters

qampy.core.phaserecovery.bps_pyx(E, testangles, symbols, N, **kwargs)#

Cython based blind phase search. See bps for parameters

qampy.core.phaserecovery.bps_twostage(E, Mtestangles, symbols, N, B=4, method='pyt', **kwargs)#

Perform a blind phase search phase recovery using two stages after _[1]

Parameters:
  • E (array_like) – input signal (single polarisation)

  • Mtestangles (int) – number of initial test angles to try

  • symbols (array_like) – the symbols of the modulation format

  • N (int) – block length to use for averaging

  • B (int, optional) – number of second stage test angles

  • method (string, optional) – implementation method to use has to be “af” for arrayfire (uses OpenCL) or “pyx” for a Cython-OpenMP based parallel search, “pyt” for pythran or “py” for a slower python based search

  • **kwargs – arguments to be passed to the search function

Returns:

  • Eout (array_like) – phase compensated field

  • ph (array_like) – unwrapped angle from phase recovery

References

..[1] Qunbi Zhuge and Chen Chen and David V. Plant, Low Computation Complexity Two-Stage Feedforward Carrier Recovery Algorithm for M-QAM, Optical Fiber Communication Conference (OFC, 2011)

qampy.core.phaserecovery.comp_freq_offset(sig, freq_offset, os=1)#

Compensate for frequency offset in signal

Parameters:
  • sig (array_line) – signal array with N modes

  • freq_offset (array_like) – frequency offset to compensate for if 1D apply to all modes

  • os (int) – oversampling ratio (Samples per symbols in sig)

Returns:

comp_signal – input signal with removed frequency offset

Return type:

array with N modes

qampy.core.phaserecovery.find_freq_offset(sig, os=1, average_over_modes=True, fft_size=65536)#

Find the frequency offset by searching in the spectrum of the signal raised to 4. Doing so eliminates the modulation for QPSK but the method also works for higher order M-QAM.

Parameters:
  • sig (array_line) – signal array with N modes

  • os (int) – oversampling ratio (Samples per symbols in sig)

  • average_over_modes (bool) – Using the field in all modes for estimation

  • fft_size (array) – Size of FFT used to estimate. Should be power of 2, otherwise the next higher power of 2 will be used.

Returns:

freq_offset – found frequency offset

Return type:

int

qampy.core.phaserecovery.partition_16qam(E)#

Partition a 16-QAM signal into the inner and outer circles.

Separates a 16-QAM signal into the inner and outer rings, which have different phase orientations. Detailed in _[1].

Parameters:

E (array_like) – electric field of the signal

Returns:

  • class1_mask (array_like) – A mask designating the class 1 symbols which are the smallest and largest rings.

  • class2_mask (array_like) – A mask designating the class 2 symbols which lie on the middle ring

References

qampy.core.phaserecovery.phase_partition_16qam(E, Nblock)#

16-QAM blind phase recovery using QPSK partitioning.

A blind phase estimator for 16-QAM signals based on partitioning the signal into 3 rings, which are then phase estimated using traditional V-V phase estimation after Fatadin et al _[1].

Parameters:
  • E (array_like) – electric field of the signal

  • Nblock (int) – number of samples in an averaging block

Returns:

  • E_rec (array_like) – electric field of the signal with recovered phase.

  • phase (array_like) – recovered phase array

References

qampy.core.phaserecovery.viterbiviterbi(E, N, M)#

Viterbi-Viterbi blind phase recovery for an M-PSK signal

Parameters:
  • E (array_like) – the electric field of the signal

  • N (int) – number of samples to average over

  • M (int) – order of the M-PSK

Returns:

Eout – Field with compensated phases

Return type:

array_like