phaserec#
Phase and carrier offset estimation and correction
Functions for carrier offset and phase estimation and correction functions
- qampy.phaserec.bps(E, Mtestangles, N, **kwargs)#
Perform a blind phase search after _[1]
- Parameters:
E (SignalObject) – input signal
Mtestangles (int) – number of test angles to try
N (int) – block length to use for averaging
**kwargs – keyword arguments to be passed to the core function
- Returns:
Eout (SignalObject) – 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.phaserec.bps_twostage(E, Mtestangles, N, B=4, **kwargs)#
Perform a blind phase search phase recovery using two stages after _[1]
- Parameters:
E (SignalObject) – input signal
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
**kwargs – keyword arguments to be passed to the core function
- Returns:
Eout (SignalObject) – 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.phaserec.comp_freq_offset(sig, freq_offset)#
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
- Returns:
comp_signal – input signal with removed frequency offset
- Return type:
array with N modes
- qampy.phaserec.correct_pilot_const_phase(signal, phase_offsets)#
Corrects a constant phase offset between the decoded pilot symbols and the transmitted ones
- Parameters:
signal (array_like) – received signal
phase_offsets (array_like) – constant phase offsets (1 per mode)
- Returns:
signal_out – signal with corrected phases
- Return type:
array_like
- qampy.phaserec.find_freq_offset(sig, average_over_modes=False, fft_size=4096)#
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 (SignalObject) – signal array with N modes
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.phaserec.find_pilot_const_phase(rec_pilots, ref_pilots)#
Finds a constant phase offset between the decoded pilot symbols and the transmitted ones
- Parameters:
rec_pilots (array_like) – Complex received pilots (after FOE and alignment)
ref_pilots (array_like) – Corresponding transmitted pilot symbols (aligned!)
- Returns:
phase_corr – array of constant phase offsets per mode
- Return type:
array_like
- qampy.phaserec.pilot_cpe(signal, N=3, pilot_rat=1, max_blocks=None, nframes=1, use_seq=False)#
Pilot based Carrier Phase Estimation
- Parameters:
signal (PilotSignalObject) – the signal to perform phase estimation on
N (int (optional)) – length of the averaging filter for phase estimation
pilot_rat (int (optional)) – use every nth pilot
max_blocks (int (optional)) – maximum number of blocks to process
nframes (int (optional)) – how many frames to process, the output data will be truncated to min(signal.shape[-1], signal.frame_len*nframes)
use_seq (bool (optional)) – use the pilot sequence for CPE as well
- Returns:
signal (PilotSignalObject) – phase compensated signal
trace (array_like) – phase trace
- qampy.phaserec.viterbiviterbi(E, N)#
Viterbi-Viterbi blind phase recovery for an M-PSK signal
- Parameters:
E (array_like) – the electric field of the signal
N (int) – block length of samples to average over
- Returns:
Eout – Field with compensated phases
- Return type:
array_like