serdes.Stimulus
Set a pseudorandom binary sequence (PRBS) pattern and number of symbols to simulate in SerDes model
Since R2021b
Description
The serdes.Stimulus
System object™ defines how to create the waveform and the number of symbols to simulate in a
SerDes Toolbox™ model. You can directly specify a PAMn symbol pattern or define a binary to PAMn
mapping scheme.
To create a multi-level pseudorandom binary sequence or custom data pattern:
Create the
serdes.Stimulus
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
stimulus
= serdes.StimulusStimulus
object that outputs multi-level pseudorandom binary sequence
or custom data pattern.
sets properties using one or more name-value arguments. Unspecified properties have
default values.stimulus
= serdes.Stimulus(Name=Value
)
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
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.
Main
Specification
— Waveform creation method
'Random Symbols'
(default) | 'Symbol Pattern'
| 'Serial PRBS'
| 'Binary Pattern'
| 'Symbol Voltage Pattern'
| 'Sampled Voltage'
| 'Parallel PRBS'
| 'PRBS'
| 'PAMn'
| 'Data Pattern'
Waveform creation method, specified as one of these values.
'Random Symbols'
— Randomly generate symbols directly from a uniform distribution.'Symbol Pattern'
— Directly define the symbol pattern as an integer from 0 to (Number of modulation levels – 1).'Serial PRBS'
— Define a binary sequence and map to a higher order modulation symbol. The mapping sequence depends on the modulation scheme defined in the Configuration block.'Binary Pattern'
— Directly define the binary pattern and map to a higher order modulation symbol. The mapping sequence depends on the modulation scheme defined in the Configuration block.'Symbol Voltage Pattern'
— Directly define the voltages of a symbol spaced pattern.'Sampled Voltage'
— Directly define a sample interval spaced waveform.'Parallel PRBS'
— Utilize multiple PRBS streams to form PAM4, PAM8 , PAM16, and PAM32 symbols. You can define up to 5 PRBS streams for PAM32. NRZ modulation scheme uses a single PRBS stream. Other modulation schemes use the random symbols waveform creation method.'PRBS'
— Generate a pseudorandom binary sequence (PRBS) based on theSeed
. Same as'Parallel PRBS'
.'PAMn'
— Generate a pulse amplitude modulated (PAM) signal based on thePAMn Seed
. Same as'Random Symbols'
.'Data Pattern'
— Specify a data pattern to modulate. Same as'Sampled Voltage'
.
Note
'PRBS'
. 'PAMn'
, and 'Data
Pattern'
options are being deprecated. Use 'Parallel
PRBS'
,
'Random Symbols'
, and 'Sampled Voltage'
instead, respectively.
Tunable: No
Data Types: char
Modulation
— Number of logic levels in signaling scheme
2
(default) | integer in the range of [2,32]
Modulation value that specifies the modulation scheme, the number of logic levels
in the encoded signal, specified as an integer in the range of
[2,32]
.
Note
According to IBIS BIRD (Buffer Issue Resolution Document) 213, IBIS-AMI models support any level of signaling from PAM2 (NRZ) to upwards, collectively known as PAMn. If your EDA tool supports it, you can export IBIS-AMI models supporting modulation schemes NRZ, PAM3, PAM4, PAM8, PAM16, or PAM32.
Note
This property is not enabled if Specification
is set to
'Symbol Voltage Pattern'
, 'Sampled Voltage'
,
or
'Data Pattern'
.
Tunable: No
Data Types: double
Delay
— Delay offset for stimulus waveform
0
(default) | nonnegative real scalar
Delay the stimulus waveform by modulo symbol time to slightly shift the eye diagram or recovered clock phase.
Tunable: No
Data Types: double
Order
— PRBS order
7
(default) | numeric scalar | numeric vector
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
Dependencies
To enable this property, set Specification
to
'Serial PRBS'
, 'Parallel PRBS'
, or
'PRBS'
.
Data Types: double
Seed
— PRBS seed
{[0 1 0 1 0 1 0]}
(default) | cell array of binary vectors
PRBS seed, specified as a cell array of cell array of binary vectors. The length
of each binary vector is the same length as the corresponding
Order
.
Tunable: No
Dependencies
To enable this property, set Specification
to
'Serial PRBS'
, 'Parallel PRBS'
, or
'PRBS'
.
Data Types: cell
MapToVoltage
— PRBS mapping from binary stream(s) to voltages
[-0.5 0.5]
(default) | numeric real vector
Map the binary data stream(s) to symbol 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
Dependencies
To enable this property, set Specification
to
'Random Symbols'
, 'Parallel PRBS'
, or
'PRBS'
.
Data Types: double
DataPattern
— Custom data pattern of symbol time spaced voltages
[-0.5000 0.5000 -0.5000 0.5000 0.5000 0.5000
-0.5000]
(default) | numeric vector
Data pattern of symbol voltages spaced at symbol time interval, specified as a numeric vector. This property is continually cycled through.
Tunable: No
Dependencies
To enable this property, set Specification
to
'Symbol Voltage Pattern'
.
Data Types: double
SymbolPattern
— Custom pattern of symbol voltages spaced at symbol time interval
[0 0 1 0 0 1 1 0 1 0 1 1 1 1 0]
(default) | numeric vector
Custom pattern of symbol voltages spaced at symbol time interval, specified as a numeric vector of zero based indices in the range of [0, Number of modulation levels -1].
Tunable: No
Dependencies
To enable this property, set Specification
to
'Symbol Pattern'
.
Data Types: double
BinaryPattern
— Custom pattern of 1s and 0s spaced at symbol interval
[0 0 0 1 0 0 1 0 1 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 1 1 0 1
0 1 0]
(default) | numeric vector
Custom pattern of 1s and 0s spaced at the symbol interval, specified as a numeric or logical vector.
Tunable: No
Dependencies
To enable this property, set Specification
to
'Binary Pattern'
.
Data Types: double
SampledVoltage
— Custom voltage pattern of sample interval spaced voltages
[0.5000 0.5000 0.5000 0.5000 -0.5000 -0.5000 -0.5000
-0.5000]
(default) | numeric vector | logical vector
Custom voltage pattern of sample interval spaced voltages, specified as a numeric vector.
Tunable: No
Dependencies
To enable this property, set Specification
to
'Sampled Voltage'
.
Data Types: double
PAMnSeed
— Seed for the PAMn pattern generator
1.4317e+09
(default) | nonnegative numeric scalar
Seed for the PAMn pattern generator, specified as a nonnegative number between
2
and 2^31 - 1
.
Tunable: No
Dependencies
To enable this property, set Specification
to
'Random Symbols'
.
Data Types: double
Jitter
Dj
— Deterministic jitter
0
(default) | nonnegative numeric scalar
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
DjUnit
— Deterministic jitter unit
'UI'
(default) | 'Seconds'
Deterministic jitter unit, specified as 'Seconds'
for seconds
or 'UI'
for unit interval.
Tunable: No
Data Types: char
Rj
— Random jitter
0
(default) | nonnegative numeric scalar
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
RjUnit
— Random jitter unit
'UI'
(default) | 'Seconds'
Random jitter unit, specified as 'Seconds'
for seconds or
'UI'
for unit interval.
Tunable: No
Data Types: char
DCD
— Duty cycle distortion
0
(default) | nonnegative numeric scalar
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
DCDUnit
— DCD unit
'UI'
(default) | 'Seconds'
DCD unit, specified as 'Seconds'
for seconds or
'UI'
for unit interval.
Tunable: No
Data Types: char
Sj
— Sinusoidal or periodic jitter
0
(default) | nonnegative numeric scalar
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
SjUnit
— Sinusoidal or periodic jitter unit
'UI'
(default) | 'Seconds'
Sinusoidal or periodic jitter unit, specified as 'Seconds'
for
seconds or 'UI'
for unit interval.
Data Types: char
SjFrequency
— Sinusoidal or periodic jitter frequency
0
(default) | nonnegative numeric scalar
Sinusoidal or periodic jitter frequency, specified as a nonnegative numeric scalar in Hz.
Tunable: No
Data Types: double
JitterSeed
— Random seed for jitter
0
(default) | nonnegative numeric scalar
Random seed for the Dj
and Rj
jitter
steams, specified as a nonnegative number.
Tunable: No
Data Types: double
Advanced
OutputJitter
— Enable optional jitter output
0
(default) | 1
To enable jitter output, set OutputJitter
to
1
. By default, this property is set to
0
.
Tunable: No
Data Types: logical
ReversePRBS
— Reverse PRBS sequence in time
0
(default) | 1
To revers the PRBS sequence in time, set ReversePRBS
to
1
. This reverses the tap positions in the characteristic
polynomial. By default, this property is set to 0
.
Tunable: No
Dependencies
To enable this property, set Specification
to
'Serial PRBS'
, 'Parallel PRBS'
, or
'PRBS'
.
Data Types: logical
InvertPRBS
— Invert PRBS sequence in voltage
0
(default) | 1
To invert the PRBS sequence in voltage, set InvertPRBS
to
1
. This flips the values of 0s and 1s. By default, this property
is set to 0
.
Tunable: No
Dependencies
To enable this property, set Specification
to
'Serial PRBS'
, 'Parallel PRBS'
, or
'PRBS'
.
Data Types: logical
BinaryToPAMnMapping
— Define mapping of binary payload to symbol voltage
'Default'
(default) | 'ETH_100BASE_T1'
| 'USB4V2'
| 'Uniform'
Define how to map the binary payload to a symbol voltage.
Note
If you set BinaryToPAMnMapping
to
'Uniform'
, you must define the properties
PayloadLength
and MessageLength
.
Tunable: No
Dependencies
To enable this property, set Specification
to
'Serial PRBS'
, 'Parallel PRBS'
, or
'PRBS'
.
Data Types: double
PayloadLength
— Length of binary payload
1
(default) | positive integer less than 50
Length of the binary payload, specified as a positive integer less than 50.
Tunable: No
Dependencies
To enable this property, set Specification
to
'Serial PRBS'
, 'Parallel PRBS'
, or
'PRBS'
and set BinaryToPAMnMapping
to
'Uniform'
.
Data Types: double
MessageLength
— Length of symbol message
1
(default) | positive integer
Length of the symbol message, specified as a positive integer less than or equal
to PayloadLength
Tunable: No
Dependencies
To enable this property, set BinaryToPAMnMapping
to
'Uniform'
.
Data Types: double
SymbolTime
— Time of single symbol duration
1e-10
(default) | positive real scalar
Time of a single symbol duration, specified as a real positive scalar.
Tunable: No
Data Types: double
SampleInterval
— Uniform time step of output waveform
6.25e-12
(default) | positive real scalar
Uniform time step of the output waveform, specified as a positive real scalar.
Tunable: No
Data Types: double
Usage
Syntax
Output Arguments
val
— Sample of the PRBS from stimulus
scalar
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)
Examples
Generate Custom Stimulus Pattern
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(... 'Specification','Parallel PRBS',... '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')
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
See Also
serdes.ChannelLoss
| Stimulus | Analog Channel | SerDes Designer
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)