mokka.synchronizers.phase.torch

Module implementing phase synchronizers in PyTorch.

Submodule implementing methods for the blind phase search.

class mokka.synchronizers.phase.torch.bps.BPS(Mtestangles, symbols, N, diff, temperature_per_epoch, no_sectors, avg_filter_type='tri', trainable=False)

Bases: Module

The blind phase search algorithm (BPS).

This class implements the differentiable and non-differentiable versions of the BPS.

__init__(Mtestangles, symbols, N, diff, temperature_per_epoch, no_sectors, avg_filter_type='tri', trainable=False)

Construct the BPS class.

bps_torch(x)

Perform a blind phase search according to [1].

Parameters

xarray_like

input signal (single polarisation)

Returns

Eoutarray_like

signal with compensated phase

pharray_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)

forward(x, *args)

Perform blind phase search.

Parameters:

x – received complex symbols

Returns:

property normalized_filter

Return normalized filter.

Returns:

normalized filter taps

select_angles_torch(angles, idx)

Perform selection on angles.

Parameters:
  • angles – vector of angles

  • idx – vector of indices

Returns:

selected angles

set_constellation(constellation)

Set constellation points in blind phase equalizer.

Parameters:

constellation – array of (complex) constellation points

property temperature_per_epoch

Get temperature setting for differentiable BPS.

Returns:

temperature value.

train(mode)

Enable training.

Parameters:

mode – if true enable training and differentiable mode.

Returns:

the BPS in trainable mode

Module containing methods for cycle slip compensation.

class mokka.synchronizers.phase.torch.cycleslip_comp.GenieCycleSlipComp(num_sectors=4, median_len=10)

Bases: Module

Genie-aided cycle slip compensation with median filtering.

This class performs genie-aided cycle slip compensation while applying median filtering on the result. This allows to compensate cycle slips while leaving the white noise undisturbed.

Otherwise one might end up overcorrecting white noise and outpeform the Shannon limit.

__init__(num_sectors=4, median_len=10)

Initialize the genie-aided cycle slip compensation.

Parameters:
  • num_sectors – Number of sectors where cycle slip can occur

  • median_len – Length of the median filter to apply on the measure

forward(rx_symbols, tx_symbols, measure_fcn)

Perform the cycle slip compensation.

Parameters:
  • rx_symbols – Received symbols with cycle slips

  • tx_symbols – Sent symbols without noise and cycle slips

  • measure_fcn – Function handle which takes received symbols and sent symbols and returns a loss.

Returns:

Compensated symbols

mokka.synchronizers.phase.torch.cycleslip_comp.calculate_squared_distance_symbols(rx_symbols, tx_symbols)

Calculate the squared distance between complex symbols.

This module contains implementations of the Viterbi & Viterbi phase synchronizers.

class mokka.synchronizers.phase.torch.vandv.ViterbiViterbi(window_length=50, symmetry=4, partition=0, partition_window=50, partition_activation='ReLU', partition_max_amp=1.5)

Bases: Module

Implements the classical Viterbi & Viterbi phase sync.

If partition is set to a positive integer the algorithm is applied with partitioning based on the amplitudes.

__init__(window_length=50, symmetry=4, partition=0, partition_window=50, partition_activation='ReLU', partition_max_amp=1.5)

Initialize Viterbi & Viterbi synchronizer.

Parameters:
  • window_length – length of the window for averaging

  • symmetry – rotational symmetry of the constellation

  • partition – if partitioning should be used

  • partition_window – length of the window for partitioning

  • partition_activation – activation function for partitioning

  • partition_max_amp – maximum amplitude for partitioning

calc_partition(y)

Calculate partitioning for a given input sequence of symbols.

Parameters:

y – Input sequence

forward(x)

Perform phase synchronization on complex input sequence.

Parameters:

x – complex input sequence

Returns:

synchronized symbols sequence