This is machine translation

Mouseover text to see original. Click the button below to return to the English verison of the page.

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

Translate This Page

MathWorks Machine Translation

The automated translation of this page is provided by a general purpose third party translator tool.

MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.

Sources and Sinks

Communications System Toolbox™ provides sinks and display devices
that facilitate analysis of communication system performance. You
can implement devices using either System objects, blocks, or functions.

Data sources

You can use blocks or functions to generate random data to simulate
a signal source. In addition, you can use Simulink blocks such as
the Random Number block as a data
source. You can open the Random Data Sources sublibrary by double-clicking
its icon (found in the Comm Sources library of the main Communications System Toolbox block
library).

Random Symbols

The randsrc function generates random matrices
whose entries are chosen independently from an alphabet that you specify,
with a distribution that you specify. A special case generates
bipolar matrices.

For example, the command below generates a 5-by-4 matrix whose
entries are independently chosen and uniformly distributed in the
set {1,3,5}. (Your results might vary because these are random numbers.)

a = randsrc(5,4,[1,3,5])
a =
3 5 1 5
1 5 3 3
1 3 3 1
1 1 3 5
3 1 1 3

If you want 1 to be twice as likely to occur as either 3 or
5, use the command below to prescribe the skewed distribution. The
third input argument has two rows, one of which indicates the possible
values of b and the other indicates the probability
of each value.

Random Integers

In MATLAB, the randi function generates
random integer matrices whose entries are in a range that you specify. A
special case generates random binary matrices.

For example, the command below generates a 5-by-4 matrix containing
random integers between 2 and 10.

c = randi([2,10],5,4)
c =
2 4 4 6
4 5 10 5
9 7 10 8
5 5 2 3
10 3 4 10

If your desired range is [0,10] instead of [2,10], you can use
either of the commands below. They produce different numerical results,
but use the same distribution.

d = randi([0,10],5,4);
e = randi([0 10],5,4);

In Simulink®, the Random Integer
Generator and Poisson Integer Generator blocks
both generate vectors containing random nonnegative integers. The
Random Integer Generator block uses a uniform distribution on a bounded
range that you specify in the block mask. The Poisson Integer Generator
block uses a Poisson distribution to determine its output. In particular,
the output can include any nonnegative integer.

Random Bit Error Patterns

In MATLAB®, the randerr function generates
matrices whose entries are either 0 or 1. However, its options are
different from those of randi, because randerr is
meant for testing error-control coding. For example, the command below
generates a 5-by-4 binary matrix, where each row contains exactly
one 1.

f = randerr(5,4)
f =
0 0 1 0
0 0 1 0
0 1 0 0
1 0 0 0
0 0 1 0

You might use such a command to perturb a binary code that consists
of five four-bit codewords. Adding the random matrix f to
your code matrix (modulo 2) introduces exactly one error into each
codeword.

On the other hand, to perturb each codeword by introducing one
error with probability 0.4 and two errors with probability 0.6, use
the command below instead.

Note:
The probability matrix that is the third argument of randerr affects
only the number of 1s in each row, not their
placement.

As another application, you can generate an equiprobable binary
100-element column vector using any of the commands below. The three
commands produce different numerical outputs, but use the same distribution.
The third input arguments vary according to each function's particular
way of specifying its behavior.

In Simulink, the Bernoulli Binary
Generator block generates random bits and is suitable for
representing sources. The block considers each element of the signal
to be an independent Bernoulli random variable. Also, different elements
need not be identically distributed.

Noise Sources

Random Noise Generators

You can construct random noise generators to simulate channel
noise by using the MATLAB Function block
with random number generating functions. Construct different types
of channel noise by using the following combinations.

Gaussian Noise Generator

In MATLAB, the wgn function generates
random matrices using a white Gaussian noise distribution. You specify
the power of the noise in either dBW (decibels relative to a watt),
dBm, or linear units. You can generate either real or complex noise.

For example, the command below generates a column vector of
length 50 containing real white Gaussian noise whose power is 2 dBW.
The function assumes that the load impedance is 1 ohm.

y1 = wgn(50,1,2);

To generate complex white Gaussian noise whose power is 2 watts,
across a load of 60 ohms, use either of the commands below.

To send a signal through an additive white Gaussian noise channel,
use the awgn function. See AWGN Channel for more
information.

Sequence Generators

You can use blocks in the Sequence Generators sublibrary of
the Communications Sources library to generate sequences for spreading
or synchronization in a communication system. You can open the Sequence
Generators sublibrary by double-clicking its icon in the main Communications System Toolbox block
library.

Pseudorandom Sequences

The following table lists the blocks that generate pseudorandom
or pseudonoise (PN) sequences. The applications of these sequences
range from multiple-access spread spectrum communication systems to
ranging, synchronization, and data scrambling.

All three blocks use shift registers to generate pseudorandom
sequences. The following is a schematic diagram of a typical shift
register.

All r registers in the generator update
their values at each time step according to the value of the incoming
arrow to the shift register. The adders perform addition modulo 2.
The shift register can be described by a binary polynomial in z,
grzr +
gr-1zr-1 +
... + g0. The coefficient gi is
1 if there is a connection from the ith shift register to the adder,
and 0 otherwise.

The Kasami Sequence Generator block and the PN Sequence Generator
block use this polynomial description for their Generator
polynomial parameter, while the Gold Sequence Generator
block uses it for the Preferred polynomial [1] and Preferred
polynomial [2] parameters.

The lower half of the preceding diagram shows how the output
sequence can be shifted by a positive integer d, by delaying the output
for d units of time. This is accomplished by a single connection along
the dth arrow in the lower half of the diagram.

Synchronization Codes

The Barker Code Generator block
generates Barker codes to perform synchronization. Barker codes are
subsets of PN sequences. They are short codes, with a length at most
13, which are low-correlation sidelobes. A correlation sidelobe is
the correlation of a codeword with a time-shifted version of itself.

Orthogonal Codes

Orthogonal codes are used for spreading to benefit from their
perfect correlation properties. When used in multi-user spread spectrum
systems, where the receiver is perfectly synchronized with the transmitter,
the despreading operation is ideal.

Eye Diagrams

An eye diagram is a simple and convenient tool for studying
the effects of intersymbol interference and other channel impairments
in digital transmission. When this software product constructs an
eye diagram, it plots the received signal against time on a fixed-interval
axis. At the end of the fixed interval, it wraps around to the beginning
of the time axis. As a result, the diagram consists of many overlapping
curves. One way to use
an eye diagram is to look for the place where the eye is most widely
opened, and use that point as the decision point when demapping a
demodulated signal to recover a digital message.

The Eye Diagram block produces
eye diagrams. This block processes discrete-time signals and periodically
draws a line to indicate a decision, according to a mask parameter.

Scatter Plots

A constellation diagram of a signal plots the signal's value
at its decision points. In the best case, the decision points should be at times
when the eye of the signal's eye diagram is the most widely open.

Signal Trajectories

A signal trajectory is a continuous plot of a signal over time.
A signal trajectory differs from a scatter plot in that the latter
displays points on the signal trajectory at discrete intervals of
time.

The Constellation Diagram block
produces signal trajectories. The Constellation Diagram block
produces signal trajectories when the ShowTrajectory property
is set to true. A signal trajectory connects all points of the input
signal, irrespective of the specified decimation factor (Samples
per symbol)

View a Sinusoid

The following model produces a constellation diagram and an
eye diagram from a complex sinusoidal signal. Because the decision
time interval is almost, but not exactly, an integer multiple of the
period of the sinusoid, the eye diagram exhibits drift over time.
More specifically, successive traces in the eye diagram and successive
points in the scatter diagram are near each other but do not overlap.

To open the model,
enter doc_eyediagram at the MATLAB command
line. To build the model, gather and configure these blocks:

Sine Wave, in the Sources
library of the DSP System Toolbox™ (not the
Sine Wave block in the Simulink Sources library)

On the Figure Properties panel,
set Scope position to figposition([42.5
55 35 35]);.

Connect the blocks as shown in the preceding figure. From the
model window's Simulation menu, choose Model
Configuration parameters. In the Configuration
Parameters dialog box, set Stop time to 250.
Running the model produces the following scatter diagram plot.

The points of the scatter plot lie on a circle of radius 1.
Note that the points fade as time passes. This is because the box
next to Color fading is checked under Rendering
Properties, which causes the scope to render points more
dimly the more time that passes after they are plotted. If you clear
this box, you see a full circle of points.

The Constellation Diagram block displays a circular trajectory.

In the eye diagram, the upper set of traces represents the real
part of the signal and the lower set of traces represents the imaginary
part of the signal.

View a Modulated Signal

This multipart example creates an eye diagram, scatter plot,
and signal trajector plot for a modulated signal. It examines the
plots one by one in these sections:

Set Symbols per trace to 3.
This specifies the number of symbols that are displayed in each trace
of the eye diagram. A trace is any one of the
individual lines in the eye diagram.

Set Traces displayed to 3.

Set New traces per display to 1.
This specifies the number of new traces that appear each time the
diagram is refreshed. The number of traces that remain in the diagram
from one refresh to the next is Traces displayed minus New
traces per display.

On the Rendering Properties panel,
set Markers to + to indicate
the points plotted at each sample. The default value of Markers is
empty, which indicates no marker.

On the Figure Properties panel,
set Eye diagram to display to In-phase
only.

When you run the model, the Eye Diagram displays the following
diagram. Your exact image varies depending on when you pause or stop
the simulation.

Three traces are displayed. Traces 2 and 3 are faded because Color
fading under Rendering Properties is
selected. This causes traces to be displayed less brightly the older
they are. In this picture, Trace 1 is the most recent and Trace 3
is the oldest. Because New traces per display is
set to 1, only Trace 1 is appearing for the first
time. Traces 2 and 3 also appear in the previous display.

Because Symbols per trace is set to 3,
each trace contains three symbols, and because Samples per
trace is set to 8, each symbol contains
eight samples. Note that trace 1 contains 24 points, which is the
product of Symbols per trace and Samples
per symbol. However, traces 2 and 3 contain 25 points each.
The last point in trace 2, at the right border of the scope, represents
the same sample as the first point in trace 1, at the left border
of the scope. Similarly, the last point in trace 3 represents the
same sample as the first point in trace 2. These duplicate points
indicate where the traces would meet if they were displayed side by
side, as illustrated in the following picture.

You can view a more realistic eye diagram by changing the value
of Traces displayed to 40 and
clearing the Markers field.

When the Offset parameter is set to 0,
the plotting starts at the center of the first symbol, so that the
open part of the eye diagram is in the middle of the plot for most
points.

Set Symbols displayed to 40.
This specifies the number of symbols displayed in the signal trajectory.
The total number of points displayed is the product of Samples
per symbol and Symbols displayed.

Set New symbols per display to 10.
This specifies the number of new symbols that appear each time the
diagram is refreshed. The number of symbols that remain in the diagram
from one refresh to the next is Symbols displayed minus New
symbols per display.

When you run the model, the Constellation Diagram displays
a trajectory like the one below.

The plot displays 40 symbols. Because Color fading under Rendering
Properties is selected, symbols are displayed less brightly
the older they are.

See Constellation Diagram of a Modulated Signal to compare the preceding
signal trajectory to the scatter plot of the same signal. The Constellation
Diagram block connects the points displayed by the Constellation
Diagram block to display the signal trajectory.

If you increase Symbols displayed to 100,
the model produces a signal trajectory like the one below. The total
number of points displayed at any instant is 800, which is the product
of the parameters Samples per symbol and Symbols
displayed.

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.

Was this topic helpful?

Select Your Country

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