Main Content

serdes.Stimulus

Set a pseudorandom binary sequence (PRBS) pattern and number of symbols to simulate in SerDes model

Description

The serdes.Stimulus System object™ sets the PRBS pattern and the number of symbols to simulate in a SerDes Toolbox™ model.

To set the PRBS pattern and the number of symbols:

  1. Create the serdes.Stimulus object and set its properties.

  2. 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

example

stimulus = serdes.Stimulus returns a Stimulus object that outputs the PRBS or custom data pattern waveform.

stimulus = serdes.Stimulus(Name,Value) sets properties using one or more name-value arguments. Enclose each property name in quotes. Unspecified properties have default values.

Example: stimulus = serdes.Stimulus('Modulation',4,'Delay',10e-12) returns a Stimulus object that uses a four-level pulse amplitude modulation (PAM4) modulation scheme and has a delay of 10e-12 seconds.

Properties

expand all

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.

Time of a single symbol duration, specified as a real positive scalar.

Tunable: No

Data Types: double

Uniform time step of the waveform, specified as a positive real scalar.

Tunable: No

Data Types: double

Waveform creation method, specified as one of these values.

  • 'PRBS' — generate a pseudorandom binary sequence (PRBS) based on the Seed

  • 'Data Pattern' — specify a data pattern to modulate

  • 'Sampled Voltage' — specify a sampled voltage sequence to modulate

  • 'PAMn' — generate a pulse amplitude modulated (PAM) signal based on the PAMn Seed

Tunable: No

Data Types: char

Modulation value that specifies the modulation scheme, the number of logic levels in the encoded signal, specified as an integer in the range [2, 16].

Modulation ValueModulation Scheme
2Non-return to zero (NRZ)
3Three-level pulse amplitude modulation (PAM3)
4Four-level pulse amplitude modulation (PAM4)

Note

IBIS does not support the PAM3 modulation scheme. You cannot export to an IBIS-AMI model if the modulation scheme is PAM3.

Tunable: No

Data Types: double

Delay offset of the data pattern, specified as a real nonnegative scalar. The applied offset is the modulus of the SymbolTime.

Tunable: No

Data Types: double

PRBS order, specified as a numeric scalar or a numeric vector of positive integers less than 100. Specify Order as a numeric vector when the value of Modulation is greater than 2. For higher order modulation, the first Order entry defines a PRBS stream for the least significant bit (LSB) and the last Order entry defines a PRBS stream for the most significant bit (MSB).

Tunable: No

Data Types: double

PRBS seed, specified as a cell array of cell array of numeric binary vectors that are not all zero. The length of each binary vector is the same length as the corresponding Order.

Tunable: No

Data Types: cell

PRBS mapping from binary stream(s) to voltages, specified as a vector. The length of MapToVoltage needs to be the same as the number of logic levels defined by the Modulation property. The LSB PRBS stream, p1, and the MSB PRBS stream, pn, index MapToVoltage as follows: Index = p1 + 2^1*p2 + 2^2*p3 + ... + 2^(n-1)*pn.

Tunable: No

Data Types: double

Custom data pattern of symbol time spaced voltages, specified as a real finite numeric vector. The DataPattern will be continually cycled through.

Tunable: No

Data Types: double

Custom voltage pattern of sample interval spaced voltages, specified as a numeric or logical vector.

Tunable: No

Data Types: double

Seed for the PAMn pattern generator, specified as a nonnegative number between 2 and 2^31 - 1.

Tunable: No

Data Types: double

Deterministic jitter, or uncorrelated bounded uniform jitter, specified as a nonnegative number. The value of Dj indicates half of the peak to peak variation of the deterministic jitter.

Tunable: No

Data Types: double

Deterministic jitter unit, specified as 'Seconds' for seconds or 'UI' for unit interval.

Tunable: No

Data Types: char

Random jitter, specified as a nonnegative number. Random jitter is defined as the standard deviation of the white Gaussian Phase noise process.

Tunable: No

Data Types: double

Random jitter unit, specified as 'Seconds' for seconds or 'UI' for unit interval.

Tunable: No

Data Types: char

Duty cycle distortion, specified as a nonnegative number. The value of DCD indicates half of the peak-to-peak DCD, where DCD is defined as half of the difference in symbol duration between one symbol and the next.

Tunable: No

Data Types: double

DCD unit, specified as 'Seconds' for seconds or 'UI' for unit interval.

Tunable: No

Data Types: char

Sinusoidal or periodic jitter, specified as a number. The value of Sj indicates half of the peak to peak amplitude of sinusoidal or periodic jitter.

Tunable: No

Data Types: double

Sinusoidal or periodic jitter unit, specified as 'Seconds' for seconds or 'UI' for unit interval.

Data Types: char

Sinusoidal or periodic jitter frequency, specified as a nonnegative numeric scalar in Hz.

Tunable: No

Data Types: double

Random seed for the Dj and Rj jitter steams, specified as a nonnegative number.

Tunable: No

Data Types: double

Usage

Description

val = stimulus()

Output Arguments

expand all

A single output sample of the PRBS each time stimulus is called. Equivalent to calling step(stimulus).

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)

expand all

stepRun System object algorithm
cloneCreate duplicate System object
stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

This example shows how to use the serdes.Stimulus object to generate a pseudorandom binary sequence (PRBS) and also modulate custom samples.

First, define the parameters of the sequences. Use a symbol time of 80 ps with 8 samples per symbol. Send 15 symbols, and use 0.1 as the deterministic jitter.

SymbolTime = 80e-12;
SamplesPerSymbol = 8;
NumberOfSymbols = 15;
Dj = 0.1;

Calculate the sample interval.

dt = SymbolTime/SamplesPerSymbol;

Create a default Stimulus object that generates a PRBS and uses a NRZ modulation scheme.

stimulus1 = serdes.Stimulus(...
    'SampleInterval',dt,...
    'SymbolTime',SymbolTime,...
    'Dj',Dj);

Create a Stimulus object that generates a PRBS with an order of 8.

stimulus2 = serdes.Stimulus(...
    'SampleInterval',dt,...
    'SymbolTime',SymbolTime,...
    'Delay',dt*4,...
    'Specification','PRBS',...
    'Order',8,...
    'Seed',{[0 1 0 0 0 0 0 0]},...
    'Dj',Dj);

Create a Stimulus object that generates a PRBS and uses a PAM4 modulation scheme.

stimulus3 = serdes.Stimulus(...
    'SampleInterval',dt,...
    'SymbolTime',SymbolTime,...
    'Modulation',4,...
    'Delay',dt*4,...
    'Order',[6 8],...
    'MapToVoltage',2*[-1/2, 1/6, -1/6, 1/2],...
    'Dj',Dj);

Create a Stimulus object that modulates a custom data pattern.

stimulus4 = serdes.Stimulus(...
    'SampleInterval',dt,...
    'SymbolTime',SymbolTime,...
    'Specification','Data Pattern',...
    'DataPattern',(-2:2)/2,...
    'Dj',Dj);

Create a Stimulus object that modulates a sampled voltage.

stimulus5 = serdes.Stimulus(...
    'SampleInterval',dt,...
    'SymbolTime',SymbolTime,...
    'Specification','Sampled Voltage',...
    'SampledVoltage',[-1.5:0.25:1.5,1.25:-0.25:-1.25]);

Initialize the variables for plotting, where N is the number of samples, waveOut contains all of the samples, and t is the vector with the time associated with each sample.

N = SamplesPerSymbol*NumberOfSymbols;
waveOut = zeros(N,5);
t = (0:N-1)*dt;

Then, use the step of each Stimulus object to sample the generated signals.

for ii = 1:N
    waveOut(ii,1) = step(stimulus1);
    waveOut(ii,2) = step(stimulus2);
    waveOut(ii,3) = step(stimulus3);
    waveOut(ii,4) = step(stimulus4);
    waveOut(ii,5) = step(stimulus5);
end

Finally, plot waveOut with a legend and labels on the axes.

figure
plot(t,waveOut)
xlabel('time [s]')
ylabel('V')
grid on
legend('Default Stimulus','PRBS 8 Stimulus','PAM4 Stimulus',...
    'Custom Stimulus','Sampled Voltage')

Figure contains an axes object. The axes object contains 5 objects of type line. These objects represent Default Stimulus, PRBS 8 Stimulus, PAM4 Stimulus, Custom Stimulus, Sampled Voltage.

Tips

  • If the PRBS waveform specification definition is incomplete, then extended defaults will be applied. For instance, if Modulation is 4 but Seed is incomplete or incorrect, a valid Seed value will be found and used.

  • The PAMn waveform specification creates pulse amplitude modulation (PAM) signals for 2 to 16 levels. This random integer generator selects 16 bits from a PRBS31 data stream to form an integer between 0 and 2^16-1. This integer is then linearly mapped to the range of [0.501, N + 0.499] which is then rounded to an integer in the range of 1 to N, where N is the desired number of PAM levels. This uniform integer then selects the appropriate symbol voltage from the MapToVoltage property.

  • The injected jitter is accumulated as follows:

    DJ: jitter = 2*Dj*(rand(1)-0.5);

    Rj: jitter = Rj*randn(1);

    DCD: jitter = DCD/2*(-1.0)^N, where N is the symbol index

    Sj: jitter = pSj*sin(N*T*2*pi*SjFrequency), where N is the symbol index, T is the symbol time.

    Jitter is injected in the symbol to waveform conversion and therefore jitter cannot be injected when the Specification is 'Sampled Voltage'.

Version History

Introduced in R2021b