pychopmarg.optimize

Classes

class pychopmarg.optimize.NormMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Tap weight normalization mode.

P8023dj = 1

As per standard (i.e. - clip then renormalize for unit amplitude pulse response.)

Scaled = 2

Uniformly and minimally scaled to bring tap weights just within their limits.

Unaltered = 3

Use constrained optimization solution, unchanged.

UnitDcGain = 4

Tap weights are uniformly scaled, to yield unity gain at d.c.

Functions

pychopmarg.optimize.scale_taps(w: ndarray[Any, dtype[Real]], w_min: ndarray[Any, dtype[Real]] | None = None, w_max: ndarray[Any, dtype[Real]] | None = None) ndarray[Any, dtype[Real]][source]

Scale tap weights proportionally, to just fit inside the given min/max limits.

Parameters:

w – The tap weights to scale.

Keyword Arguments:
  • w_min – Minimum tap weights. Default: None (Use -ones(len(w)).)

  • w_max – Maximum tap weights. Default: None (Use ones(len(w)).)

Returns:

Tap weights, scaled proportionally to just fit inside min/max limits.

pychopmarg.optimize.clip_taps(w: ndarray[Any, dtype[Real]], curs_ix: int, w_min: ndarray[Any, dtype[Real]] | None = None, w_max: ndarray[Any, dtype[Real]] | None = None, obey_spec: bool = True) ndarray[Any, dtype[Real]][source]

Clip tap weights to the given min/max limits, as per (178A-26).

Parameters:
  • w – The tap weights to clip.

  • curs_ix – The index, in w, of the cursor tap.

Keyword Arguments:
  • w_min – Minimum tap weights. Default: None (Use -ones(len(w)).)

  • w_max – Maximum tap weights. Default: None (Use ones(len(w)).)

  • obey_spec – Allow cursor tap weight to grow w/o bound, as per D1.2, when True. Default: True

Returns:

Tap weights, clipped accordingly.

pychopmarg.optimize.przf(pulse_resp: ndarray[Any, dtype[Real]], nspui: int, nTaps: int, nPreTaps: int, nDFETaps: int, tap_mins: ndarray[Any, dtype[Real]], tap_maxs: ndarray[Any, dtype[Real]], b_min: ndarray[Any, dtype[Real]], b_max: ndarray[Any, dtype[Real]], norm_mode: NormMode = NormMode.P8023dj, unit_amp: bool = False) tuple[ndarray[Any, dtype[Real]], ndarray[Any, dtype[Real]], ndarray[Any, dtype[Real]]][source]

Optimize FFE tap weights, via Pulse Response Zero Forcing (PRZF).

Parameters:
  • pulse_resp – The pulse response to be filtered.

  • nspui – Number of samples per unit interval.

  • nTaps – The total number of FFE filter taps, including the cursor.

  • nPreTaps – The number of pre-cursor taps.

  • nDFETaps – Number of DFE taps.

  • tap_mins – Minimum allowed tap values.

  • tap_maxs – Maximum allowed tap values.

  • b_min – Minimum allowed DFE tap values.

  • b_max – Maximum allowed DFE tap values.

Keyword Arguments:
  • norm_mode – The tap weight normalization mode to use. Default: P8023dj

  • unit_amp – Enforce unit pulse response amplitude when True. (For comparing results to mmse().) Default: False

Returns:

A triple consisting of

  • The optimum FFE tap weights.

  • The optimum DFE tap weights.

  • The pulse response samples used in optimization.

Notes

  1. The algorithm implemented below is a slightly modified version of:

    Mellitz, R., Lusted, K., RX FFE Implementation Algorithm for COM 4.1, IEEE P802.3dj Task Force, August 31, 2023.

Todo

  1. Add sampling time as an input parameter?

pychopmarg.optimize.mmse(theNoiseCalc: NoiseCalc, Nw: int, dw: int, Nb: int, Rlm: float, L: int, b_min: ndarray[Any, dtype[Real]], b_max: ndarray[Any, dtype[Real]], w_min: ndarray[Any, dtype[Real]], w_max: ndarray[Any, dtype[Real]], ts_sweep: float = 0.5, norm_mode: NormMode = NormMode.P8023dj) dict[str, Any][source]

Optimize Rx FFE tap weights, via Minimum Mean Squared Error (MMSE).

Parameters:
  • theNoiseCalc – Initialized instance of NoiseCalc class.

  • Nw – Number of taps in Rx FFE.

  • dw – Number of pre-cursor taps in the Rx FFE.

  • Nb – Number of DFE taps.

  • Rlm – Relative level mismatch.

  • L – Number of modulation levels.

  • b_min – Minimum DFE tap weight values.

  • b_max – Maximum DFE tap weight values.

  • w_min – Minimum FFE tap weight values.

  • w_max – Maximum FFE tap weight values.

Keyword Arguments:
  • ts_sweep – The cursor sampling time “search radius” around the peak pulse response amplitude (UI). Default: 0.5 (i.e. - ts within [-UI/2, +UI/2] of peak location)

  • norm_mode – The tap weight normalization mode to use. Default: P8023dj

Returns:

A dictionary containing

  • the optimized FFE tap weights, in the “rx_taps” key,

  • the optimized DFE tap weights, in the “dfe_tap_weights” key, and

  • several other values of general utility for plotting/analysis/debugging.

Raises:

ValueError – If dw > Nw, or there is insufficient room at the beginning/end of the pulse response vector for ts sweeping.

Notes

  1. The optimization technique encoded here is taken from the following references

    [1] Healey, A., Hegde, R., Reference receiver framework for 200G/lane electrical interfaces and PHYs, IEEE P802.3dj Task Force, Jan. 2024

    [2] D1.2 of P802.3dj, IEEE P802.3dj Task Force, Aug. 2024