This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Construct pattern generator object


h = commsrc.pattern


h = commsrc.pattern constructs a pattern generator object, h. This syntax is equivalent to:

h = commsrc.pattern('SamplingFrequency', 10000, ...
                        'SamplesPerSymbol', 100, ...
                        'PulseType', 'NRZ', ...
                        'OutputLevels', [-1 1], ...
                        'RiseTime', 0, ...
                        'FallTime', 0, ...
                        'DataPattern', 'PRBS7', ...
                        'Jitter', commsrc.combinedjitter)

The pattern generator object produces modulated data patterns. This object can also inject jitter into the modulated signal.


A pattern generator object has the properties shown on the following table. You can edit all properties, except those explicitly noted otherwise.

TypeType of pattern generator object ('Pattern Generator'). This property is not writable.
SamplingFrequencySampling frequency of the input signal in hertz.
SymbolRateThe symbol rate of the input signal. This property depends upon the SamplingFequency and SamplesPerSymbol properties. This property is not writable.
SamplesPerSymbolThe number of samples representing a symbol. SamplesPerSymbol must be an integer. This property affects SymbolRate.
PulseTypeThe type of pulse the object generates. Pulse types available: return-to-zero (RZ) and nonreturn-to-zero (NRZ). The initial condition for an NRZ pulse is 0.
OutputLevelsAmplitude levels that correspond to the symbol indices. For an NRZ pulse, this is a 1-by-2 vector. The first element of the 1-by-2 vector corresponds to the 0th symbol (data bit value 0). The second element corresponds to the 1st symbol (data bit value 1). For an RZ pulse, this is a scalar and the value corresponds to the data bit value 1.
DutyCycleThe duty cycle of the pulse the object generates. Displays calculated duty cycle based on pulse parameters. This property is not writable.
RiseTimeSpecifies 10% to 90% rise time of the pulse in seconds.
PulseDurationPulse duration in seconds defined by IEEE STD 181 standard. (See the Return-to-Zero (RZ) Signal Conversion: Ideal Pulse to STD–181 figure in the Methods section.) Setting PulseType to return-to-zero enables this property.
FallTimeSpecifies 10% to 90% fall time of the pulse in seconds.
DataPatternThe bit sequence the object uses. The following patterns are available: PRBS5 to PRBS15, PRBS23, PRBS31, and User Defined.
UserDataPatternUser-defined bit pattern consisting of a vector of ones and zeroes. Setting data pattern to user defined enables this property.
JitterSpecifies jitter characteristics. Use this property to configure Random, Periodic and Dual Dirac Jitter.


A pattern generator object has five methods, as described in this section.


This method outputs a frame worth of modulated and interpolated symbols. It has one input argument, which is the number of symbols in a frame. Its output is a column vector. You can call this method using the following syntax

x = generate(h, N)
where h is the handle to the object, N is the number of output symbols, and x is a column vector whose length is N multiplied by h.SamplesPerSymbol.


This method resets the pattern generator to its default state. The property values do not reset unless they relate to the state of the object. This method has no input arguments.


This method converts the ideal pulse specifications to IEEE STD-181 specifications: 0% to 100% rise time (TR) and fall time (TF) convert to 10% to 90% rise and fall times with a 50% pulse width duration, as shown in the following figure. This method also sets the appropriate properties.

idealtostd181(tR, tF, PW)

IEEE STD-181 Return-to-Zero (RZ) Signal Parameters


This method converts the IEEE STD-181 pulse specifications, stored in the pattern generator, to ideal pulse specifications. This method converts the 10% to 90% rise and fall times to 0% to 100% rise and fall times (TR and TF). It also converts the 50% pulse duration to pulse width (as shown in the following figure). Use the property values for IEEE STD-181 specifications

[tr tf pw] = stdstd181toideal(h) 
where h is the pattern generator object handle and tR is 0 to 100% rise time.

Ideal Pulse Non-Return-to-Zero (NRZ) Signal Parameters


Computes the duty cycle distortion, DCD, of the pulse defined by the pattern generator object h.

DCD represents the ratio of the pulse on duration to the pulse off duration. For an NRZ pulse, on duration is the duration the pulse spends above the symbol boundary level. Off duration is the duration the pulse spends below zero.

dcd = computedcd(h)

The software calculates DCD given tR, tF, Tsym. This formula assumes that the symbol boundary level is zero.

Th = (Ah-Al) * tRAl + (Ah-Al) * tFAl + PW+

Tl = (Ah-Al) *tRAl + (Ah-Al) *tFAl + PW-

DCD = ThTl

Where Th is the duration of the high signal, Tl is the duration of the low signal, and DCD represents the ratio of the duration of the high signal to the low signal.

Introduced in R2008b

Was this topic helpful?