.dfe - DFE Model
Behavioral model of a decision feedback equalizer (DFE).
Original Author: David Banas <capn.freako@gmail.com>
Original Date: 17 June 2014
This Python script provides a behavioral model of a decision feedback equalizer (DFE). The class defined, here, is intended for integration into the larger PyBERT framework.
Copyright (c) 2014 by David Banas; All rights reserved World wide.
- class pybert.models.dfe.DFE(n_taps: int, gain: float, delta_t: float, alpha: float, ui: float, n_spb: int, decision_scaler: float, mod_type: int = 0, bandwidth: float = 100000000000.0, n_ave: int = 10, n_lock_ave: int = 500, rel_lock_tol: float = 0.01, lock_sustain: int = 500, ideal: bool = True, limits: list[tuple[float, float]] | None = None, agc_n_ave: int = 100)[source]
Bases:
objectBehavioral model of a decision feedback equalizer (DFE).
- Parameters:
n_taps – # of taps in adaptive filter
gain – adaptive filter tap weight correction gain
delta_t – CDR proportional branch constant (ps)
alpha – CDR integral branch constant (normalized to delta_t)
ui – nominal unit interval (ps)
n_spb – # of samples per unit interval
decision_scaler – multiplicative constant applied to the result of the sign function, when making a “1 vs. 0” decision. Sets the target magnitude for the DFE.
- Keyword Arguments:
mod_type –
The modulation type
0: NRZ
1: Duo-binary
2: PAM-4
bandwidth – The bandwidth, at the summing node (Hz).
n_ave – The number of averages to take, before adapting. (Also, the number of CDR adjustments per DFE adaptation.)
n_lock_ave – The number of unit interval estimates to consider, when determining locked status.
rel_lock_tol – The relative tolerance for determining lock.
lock_sustain – Length of the histerysis vector used for lock flagging.
ideal – Boolean flag. When true, use an ideal summing node.
limits – List of pairs containing min/max values per tap.
agc_n_ave – Number of previous slicer sample to keep, for AGC operation.
- Raises:
RuntimeError – If the requested modulation type is unknown.
- decide(x: float) tuple[float, list[int]][source]
Make the bit decisions, according to modulation type.
- Parameters:
x – The signal value, at the decision time.
- Returns:
A pair containing
One of:
{-1, 1} (NRZ)
{-1, 0, +1} (Duo-binary)
{-1, -1/3, +1/3, +1} (PAM-4)
The list of bits recovered.
- Raises:
RuntimeError – If the requested modulation type is unknown.
- run_dfe(sample_times: numpy.typing.NDArray.~Real, signal: numpy.typing.NDArray.~Real, use_agc: bool = False, dbg_dict: dict[str, ~typing.Any] | None=None) tuple[numpy.typing.NDArray.~Real, list[list[float]], numpy.typing.NDArray.~Real, numpy.typing.NDArray.~Real, list[bool], numpy.typing.NDArray.~Real, list[int], numpy.typing.NDArray.~Real, numpy.typing.NDArray.~Real][source]
Run the DFE on the input signal.
- Parameters:
sample_times – Vector of signal sampling times.
signal – Vector of sampled signal values.
- Keyword Arguments:
use_agc – Perform continuous adjustment of decision_scaler when True. Default: False
dbg_dict – Optional dictionary, for stashing debugging information at runtime. Default: None
- Returns:
A tuuple containing the following
”dfe_out”: Samples of the summing node output, taken at the times given in sample_times.
”tap_weights”: List of list of tap weights showing how the DFE adapted over time.
”ui_ests”: List of unit interval estimates, showing how the CDR adapted.
- ”clocks”: List of mostly zeros with ones at the recovered clocking instants.
Useful for overlaying the clock times on signal waveforms, in plots.
”lockeds”: List of Booleans indicating state of CDR lock.
”clock_times”: List of clocking instants, as recovered by the CDR.
”bits”: List of recovered bits.
”sig_samps”: Samples of the summing node output, taken at the clocking instants.
”decisions”: Symbol decisions made based on voltages sampled at clocking instants.
- Raises:
RuntimeError – If the requested modulation type is unknown.
- step(decision: float, error: float, update: bool)[source]
Step the DFE, according to the new decision and error inputs.
- Parameters:
decision – Current slicer output.
error – Difference between summing node and slicer outputs.
update – If true, update tap weights.
- Returns:
New backward filter output value.
- Return type:
res
- class pybert.models.dfe.LfilterSS(b: numpy.typing.NDArray.numpy.float64, a: numpy.typing.NDArray.numpy.float64)[source]
Bases:
objectA single steppable version of
scipy.signal.lfilter().- Parameters:
b – Coefficients of the numerator of the rational transfer function.
a – Coefficients of the denominator of the rational transfer function.