# serdes.DFECDR

Decision feedback equalizer (DFE) with clock and data recovery (CDR)

## Description

The `serdes.DFECDR`

System object™ adaptively processes a sample-by-sample input signal or analytically processes
an impulse response vector input signal to remove distortions at post-cursor taps.

The DFE modifies baseband signals to minimize the intersymbol interference (ISI) at the clock sampling times. The DFE samples data at each clock sample time and adjusts the amplitude of the waveform by a correction voltage.

For impulse response processing, the hula-hoop algorithm is used to find the clock
sampling locations. The zero-forcing algorithm is then used to determine the
*N* correction factors necessary to have no ISI at the *N*
subsequent sampling locations, where *N* is the number of DFE taps.

For sample-by-sample processing, the clock recovery is accomplished by a first order phase
tracking model. The bang-bang phase detector utilizes the unequalized edge samples and
equalized data samples to determine the optimum sampling location. The DFE correction voltage
for the *N*-th tap is adaptively found by finding a voltage that compensates
for any correlation between two data samples spaced by *N* symbol times. This
requires a data pattern that is uncorrelated with the channel ISI for correct adaptive
behavior.

To equalize the input signal:

Create the

`serdes.DFECDR`

object and set its properties.Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

## Creation

### Description

returns a DFECDR
object that modifies an input waveform with the DFE and determines the clock sampling
times. The system object estimates the data symbol according to the Bang-Bang CDR
algorithm.`dfecdr`

= serdes.DFECDR

sets properties using one or more name-value pairs. Enclose each property name in quotes.
Unspecified properties have default values.`dfecdr`

= serdes.DFECDR(`Name`

,`Value`

)

**Example: **`dfecdr = serdes.DFECDR('Mode',1)`

returns a DFECDR object
that applies specified DFE tap weights to input waveform.

## Properties

Unless otherwise indicated, properties are *nontunable*, which means you cannot change their
values after calling the object. Objects lock when you call them, and the
`release`

function unlocks them.

If a property is *tunable*, you can change its value at
any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

### DFE Properties

`Mode`

— DFE operating mode

`2`

(default) | `0`

| `1`

DFE operating mode, specified as `0`

, `1`

, or
`2`

. The operating mode you select determines the DFE tap weights
values that the object applies to the input waveform.

Mode Value | DFE Mode | DFE Operation |
---|---|---|

`0` | Off | The object bypasses DFE and the input waveform remains unchanged. |

`1` | Fixed | The object applies the DFE tap weights specified in
`TapWeights` to the input waveform. |

`2` | Adapt | The object determines the optimum DFE tap weights and applies them to the input waveform. |

**Data Types: **`double`

`TapWeights`

— Initial DFE tap weights

`[0 0 0 0]`

(default) | row vector

Initial DFE tap weights, specified as a row vector in volts. The length of the vector determines the number of taps. The vector elements signify the tap weights or tap strength. Set the tap weight to zero to initialize the tap.

**Data Types: **`double`

`MinimumTap `

— Minimum value of adapted tap weights

`-1`

(default) | real scalar | real-valued row vector

Minimum value of the adapted tap weights, specified as a real scalar or a
real-valued row vector in volts. Specify as a scalar to apply to apply the same
minimum value to all the DFE taps, or specify as a vector that has the same length as
the `TapWeights`

.

**Data Types: **`double`

`MaximumTap`

— Maximum value of adapted tap weights

`1`

(default) | nonnegative real scalar | nonnegative real-valued row vector

Maximum value of the adapted tap weights, specified as a nonnegative real scalar
or a nonnegative real-valued row vector in volts. Specify as a scalar to apply the
same maximum value to all the DFE taps, or specify as a vector that has the same
length as the `TapWeights`

.

**Data Types: **`double`

`EqualizationGain`

— Controls for update rate of tap weights

`9.6e-5`

(default) | positive real scalar

Controls for update rate of tap weights, specified as a unitless nonnegative real scalar. Increase the value of this property for the DFE adaptation to converge faster at the expense of more noise in the DFE tap values.

**Data Types: **`double`

`EqualizationStep`

— DFE adaptive step resolution

`1e-6`

(default) | nonnegative real scalar | nonnegative real-valued row vector

DFE adaptive step resolution, specified as a nonnegative real scalar or a
nonnegative real-valued row vector in volts. Specify as a scalar to apply the same
value to all the DFE taps, or specify as a vector that has the same length as
`TapWeights`

.

`EqualizationStep`

specifies the minimum change in DFE taps
from one time step to the next to mimic hardware limitations. Setting
`EqualizationStep`

to zero yields DFE tap values without any
resolution limitation.

**Data Types: **`double`

`Taps2x`

— Multiply DFE tap weights by a factor of two

false (default) | true

Multiply DFE tap weights by a factor of two, specified as true or false. Set this property to true to multiply the DFE tap weights by a factor of two.

The output of the slicer in the `serdes.DFECDR`

System object from the SerDes Toolbox™ is [-0.5 0.5]. But some industry applications require the slicer output
to be [-1 1]. `Taps2x`

allows you to quickly double the DFE tap
weights to change the slicer reference.

### CDR Properties

`CDRMode`

— Determine CDR order

`1st order`

(default) | `2nd order`

Determine the CDR order to enable phase and frequency tracking.

`1st order`

— Only tracks the phase.`2nd order`

— Tracks both the phase and frequency.

`Count`

— Early or late CDR count threshold to trigger phase update

`16`

(default) | real positive integer greater than 4

Early or late CDR count threshold to trigger a phase update, specified as a
unitless real positive integer greater than 4. Increasing the value of
`Count`

provides a more stable output clock phase at the expense
of convergence speed. Because the bit decisions are made at the clock phase output, a
more stable clock phase has a better bit error rate (BER).

`Count`

also controls the bandwidth of the CDR which is
approximately calculated by using the equation:

$$\text{Bandwidth}=\frac{1}{\text{Symboltime}\xb7\text{Early/latethresholdcount}\xb7\text{Step}}$$

**Data Types: **`double`

`ClockStep`

— Clock phase resolution

`0.0078`

(default) | real scalar

Clock phase resolution, specified as a real scalar in fraction of symbol time.
`ClockStep`

is the inverse of the number of phase adjustments in
CDR.

**Data Types: **`double`

`PhaseOffset`

— Clock phase offset

`0`

(default) | real scalar in the range [−0.5, 0.5]

Clock phase offset, specified as a real scalar in the range [−0.5, 0.5] in
fraction of symbol time. `PhaseOffset`

is used to manually shift
the clock probability distribution function (PDF) for better BER.

**Data Types: **`double`

`ReferenceOffset`

— Reference clock offset impairment

`0`

(default) | real scalar in the range [−300, 300]

Reference clock offset impairment, specified as a real scalar in the range [−300,
300] in parts per million (ppm). `ReferenceOffset`

is the deviation
between transmitter oscillator frequency and receiver oscillator frequency.

**Data Types: **`double`

`Sensitivity`

— Sampling latch metastability voltage

`0`

(default) | real scalar

Sampling latch metastability voltage, specified as a real scalar in volts (V). If
the data sample voltage lies within the region (±`Sensitivity`

),
there is a 50% probability of bit error.

**Data Types: **`double`

`PhaseDetector`

— Clock phase detector option

`BangBang`

(default) | `BaudRateTypeA`

Clock phase detector option used in the clock data recovery. You can choose between bang-bang (Alexander) or baud-rate type-A (Mueller-Muller).

`FrequencyStep`

— Internal gain for frequency tracking

`1/2e11`

(default) | nonnegative real scalar

Internal gain for the frequency tracking loop, specified as a nonnegative real scalar.

**Data Types: **`double`

`FrequencyCount`

— Frequency tracking update

`16`

(default) | nonnegative integer scalar

Once every `FrequencyCount`

symbols, update the system phase
rotator clock with the frequency estimate.

**Data Types: **`double`

### Advanced Properties

`SymbolTime`

— Time of single symbol duration

`1e-10`

(default) | real scalar

Time of a single symbol duration, specified as a real scalar in seconds (s).

**Data Types: **`double`

`SampleInterval`

— Uniform time step of waveform

`6.25e-12`

(default) | real scalar

Uniform time step of the waveform, specified as a real scalar in seconds (s).

**Data Types: **`double`

`Modulation`

— Modulation scheme

`2`

(default) | `3`

| `4`

Modulation scheme, specified as `2`

, `3`

or
`4`

.

Modulation Value | Modulation Scheme |
---|---|

`2` | Non-return to zero (NRZ) |

`3` | Three-level pulse amplitude modulation (PAM3) |

`4` | Four-level pulse amplitude modulation (PAM4) |

**Note**

IBIS does not support a PAM3 modulation scheme, so you cannot export the System object to IBIS-AMI model if you set the modulation scheme to PAM3.

**Data Types: **`double`

`WaveType`

— Input waveform type

`'Sample'`

(default) | `'Impulse'`

Input waveform type, specified as one of these:

`'Sample'`

— A sample-by-sample input signal.`'Impulse'`

— An impulse-response input signal.

**Data Types: **`char`

## Usage

### Syntax

### Input Arguments

`x`

— Input baseband signal

scalar | vector

Input baseband signal, specified as a scalar or vector. If you set the
`WaveType`

property to `'Sample'`

, then the
input signal is a sample-by-sample signal specified as a scalar. If you set the
`WaveType`

property to `'Impulse'`

, the input
signal is an impulse-response vector signal.

### Output Arguments

`y`

— Estimated channel output

scalar | vector

Estimated channel output. If the input signal is a sample-by-sample signal specified as a scalar, then the output is also scalar. If the input signal is an impulse response vector signal, the output is also a vector.

`TapWeights`

— Estimated DFE tap weight values

vector

Estimated DFE tap weight values, returned as a vector.

`Phase`

— Relative recovered clock phase

units of `SymbolTime`

in the range [0,1]

Relative recovered clock phase, returned as a units of
`SymbolTime`

in the range [0,1].

`clkAMI`

— AMI clock bus

structure

AMI clock bus, returned as a structure.

Field | Description |
---|---|

`clockTime` | Time taken to sample the data signal. |

`clockValidOnRising` | Valid clock time value on the rising edge of a signal. |

`interior`

— Bus containing additional interior CDR signals

structure

Bus containing additional interior CDR signals, returned as a structure.

Field | Description |
---|---|

`clockPhase` | Relative clock phase in units of `SymbolTime` in the
range of [0,1]. |

`symbolRecovered` | Symbol recovered from data signal at
`ClockTime` . |

`voltageSample` | Voltage observed from the data signal at
`ClockTime` . |

`PAM4Threshold` | The estimated upper eye at PAM4 threshold. |

`CDRedgeVoltage` | The voltage observed from the data signal at `ClockTime` —
`SymbolTime` /`2` . |

`CDRCounter` | The bang-bang CDR internal counter used to trigger samples. |

`CDREarlyLateCount` | The bang-bang CDR accumulated (or filtered) signal used to trigger updated to the CDR phase. |

`PAMSymbolMiddleVoltage` | Estimated PAM4 symbol voltage of the inner eye outer envelope to estimate PAM threshold. |

`PAMSymbolOuterVoltage` | Estimated PAM4 outer envelope voltage to estimate PAM threshold. |

`EyeHeightAbsAve` | Estimates eye height. |

`PAMThreshold` | Array of PAM thresholds for each eye in the PAMn modulation. If the modulation scheme is PAMn, the first (n-1) eyes contain the valid thresholds. The rest of the entries are zero-padded. |

`PhaseError` | Phase detector error. |

`FreqEstimate` | Frequency estimate for the 2^{nd} order or
frequency tracking loop. |

## Object Functions

To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named `obj`

, use
this syntax:

release(obj)

## Examples

### Impulse Response Processing Using DFECDR

This example shows how to process impulse response of a channel using `serdes.DFECDR`

System object™.

Use a symbol time of `100`

ps. There are `16`

samples per symbol. The channel has `14`

dB loss.

SymbolTime = 100e-12; SamplesPerSymbol = 16; dbloss = 14; NumberOfDFETaps = 2;

Calculate the sample interval.

dt = SymbolTime/SamplesPerSymbol;

Create the DFECDR object. The object adaptively applies optimum DFE tap weights to input impulse response.

DFE1 = serdes.DFECDR('SymbolTime',SymbolTime,'SampleInterval',dt,... 'Mode',2,'WaveType','Impulse','TapWeights',zeros(NumberOfDFETaps,1));

Create the channel impulse response.

channel = serdes.ChannelLoss('Loss',dbloss,'dt',dt,... 'TargetFrequency',1/SymbolTime/2); impulseIn = channel.impulse;

Process the impulse response with DFE.

[impulseOut,TapWeights] = DFE1(impulseIn);

Convert the impulse response to a pulse, a waveform and an eye diagram for visualization.

ord = 6; dataPattern = prbs(ord,2^ord-1)-0.5; pulseIn = impulse2pulse(impulseIn,SamplesPerSymbol,dt); waveIn = pulse2wave(pulseIn,dataPattern,SamplesPerSymbol); eyeIn = reshape(waveIn,SamplesPerSymbol,[]); pulseOut = impulse2pulse(impulseOut,SamplesPerSymbol,dt); waveOut = pulse2wave(pulseOut,dataPattern,SamplesPerSymbol); eyeOut = reshape(waveOut,SamplesPerSymbol,[]);

Create the time vectors.

t = dt*(0:length(pulseOut)-1)/SymbolTime; teye = t(1:SamplesPerSymbol); t2 = dt*(0:length(waveOut)-1)/SymbolTime;

Plot the resulting waveforms.

figure plot(t,pulseIn,t,pulseOut) legend('Input','Output') title('Pulse Response Comparison') xlabel('SymbolTimes'),ylabel('Voltage') grid on axis([41 55 -0.1 0.4])

figure plot(t2,waveIn,t2,waveOut) legend('Input','Output') title('Waveform Comparison') xlabel('SymbolTimes'),ylabel('Voltage') grid on

figure subplot(211),plot(teye,eyeIn,'b') xlabel('SymbolTimes'),ylabel('Voltage') grid on title('Input Eye Diagram') subplot(212),plot(teye,eyeOut,'b') xlabel('SymbolTimes'),ylabel('Voltage') grid on title('Output Eye Diagram')

### Sample-by-Sample Processing Using DFECDR

This example shows how to process impulse response of a channel one sample at a time using `serdes.DFECDR`

System object™.

Use a symbol time of `100`

ps, with `8`

samples per symbol. The channel loss is `14`

dB. Select `12`

-th order pseudorandom binary sequence (PRBS), and simulate the first `20000`

symbols.

SymbolTime = 100e-12; SamplesPerSymbol = 8; dbloss = 14; NumberOfDFETaps = 2; prbsOrder = 12; M = 20000;

Calculate the sample interval.

dt = SymbolTime/SamplesPerSymbol;

Create the DFECDR System object. Process the channel one sample at a time by setting the input waveforms to `'sample'`

type. The object adaptively applies the optimum DFE tap weights to input waveform.

DFE2 = serdes.DFECDR('SymbolTime',SymbolTime,'SampleInterval',dt,... 'Mode',2,'WaveType','Sample','TapWeights',zeros(NumberOfDFETaps,1),... 'EqualizationStep',0,'EqualizationGain',1e-3);

Create the channel impulse response.

channel = serdes.ChannelLoss('Loss',dbloss,'dt',dt,... 'TargetFrequency',1/SymbolTime/2);

Initialize the PRBS generator.

[dataBit,prbsSeed]=prbs(prbsOrder,1);

Generate the sample-by-sample eye diagram.

%Loop through one symbol at a time. inSymbol = zeros(SamplesPerSymbol,1); outWave = zeros(SamplesPerSymbol*M,1); dfeTapWeightHistory = nan(M,NumberOfDFETaps); for ii = 1:M %Get new symbol [dataBit,prbsSeed]=prbs(prbsOrder,1,prbsSeed); inSymbol(1:SamplesPerSymbol) = dataBit-0.5; %Convolve input waveform with channel y = channel(inSymbol); %Process one sample at a time through the DFE for jj = 1:SamplesPerSymbol [outWave((ii-1)*SamplesPerSymbol+jj),TapWeights] = DFE2(y(jj)); end %Save DFE taps dfeTapWeightHistory(ii,:) = TapWeights; end

Plot the DFE adaptation history.

figure plot(dfeTapWeightHistory) grid on legend('TapWeights(1)','TapWeights(2)') xlabel('Symbols') ylabel('Voltage') title('DFE Taps')

You can observe from the plot that the DFE adaptation is approximately complete after the first `10000`

symbols, so these can be truncated from the array. Then plot the eye diagram by applying the reshape function to the array of symbols.

```
foldedEye = reshape(outWave(10000*SamplesPerSymbol+1:M*SamplesPerSymbol),SamplesPerSymbol,[]);
t = dt*(0:SamplesPerSymbol-1);
figure,plot(t,foldedEye,'b');
```

## More About

### Adapt Operating Mode

The Init subsystem calls to the `serdes.DFECDR`

. The
`serdes.DFECDR`

finds the optimum DFE tap values for the best eye height
opening for statistical analysis. During time domain simulation, DFE uses the adapted values
as the starting point and applies them to the input waveform. For more information about the
Init subsystem, see Statistical Analysis in SerDes Systems

### Choose Phase Detector Model in Clock Recovery

You can select which phase detector model the `serdes.DFECDR`

in clock
recovery: bang-bang or baud-rate type A. The default phase detector model used is
bang-bang.

You can use a DFECDR with baud-rate type-A phase detector model in the SerDes
Designer app and then export the model to Simulink^{®}. In this case, automatically adds the **Rx_Decision_Time**
parameter to define the clock position.

If you want to change the phase detector model in Simulink, you need to manually add the **Rx_Decision_Time**
parameter.

**Note**

You must click the **Refresh Init** button in the Rx Init subsystem
after modifying the **Rx_Decision_Time** parameter.

## Extended Capabilities

### C/C++ Code Generation

Generate C and C++ code using MATLAB® Coder™.

Usage notes and limitations:

IBIS-AMI codegen is not supported in MAC.

## Version History

**Introduced in R2019a**

## See Also

DFECDR | CTLE | CDR | `serdes.CTLE`

| `serdes.CDR`

## MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)