08-01-2013, 10:47 AM
Communications Toolbox
Communications.pdf (Size: 2.24 MB / Downloads: 48)
What the Example Does
The example creates a random digital signal consisting of integers between 0
and 8, and modulates it using two varieties of the 8-ary quadrature amplitude
shift keying (QASK) technique. This technique associates each integer in the
signal with some point in an eight-point signal constellation, and then uses the
associations to create a modulated signal.
There are 8!, that is, factorial(8), ways to associate eight symbols with eight
constellation points. One category of configurations implements what is called
Gray coding. In a Gray coded constellation, the symbol associated with a given
point and the symbol of any of the point’s nearest neighbors differ in exactly
one bit. Thus, the constellation point associated with the symbol 3 (= 011) can
have as a nearest neighbor the point associated with the symbol 1 (= 001), 2
(= 010), or 7 (= 111), but not any other number.
How the Example Works
This section displays and explains the example code, piece by piece.
Setting Up Parameters
The first part of the example defines variables that the rest of the example will
use. The symbol alphabet has M different symbols, namely, the integers
between 0 and M-1. The message will be a column vector having len entries,
each of which is chosen from the symbol alphabet.
The variables Fd and Fs refer to the relative sampling rates for the modulation
scheme. They would be more meaningful if the example were sampling a real
signal that had a natural notion of time. However, since this example uses a
random signal that does not have a built-in notion of time.
Modulating the Signal
This part of the example modulates the data in the column vector signal in two
different ways. The dmodce function performs both modulations and puts the
results into the two-column matrix modsignal.
The first call to dmodce, which creates the first column of modsignal, tells
dmodce to use QASK modulation on M symbols. The string 'qask' indicates the
QASK method as well as the default square constellation configuration. In this
case, the configuration implements Gray code.
The second call to dmodce, which creates the second column of modsignal, tells
dmodce to use QASK modulation with a signal constellation whose
configuration is represented in the vectors inphase and quad. The variables
inphase and quad are length-M vectors that list the in-phase and quadrature
components, respectively, of the points in the signal constellation. The points
are listed in sequence, to associate a message symbol of k with the (k+1)st
elements in inphase and quad. Whereas Gray code labels the constellation
points in a special way, this configuration lists points in a sequence that is
merely convenient for creating inphase and quad.
Demodulating the Signal
This part of the example demodulates the noisy modulated signal, noisy, in
two different ways. The ddemodce function performs both demodulations by
operating on each column of noisy separately. In each case, ddemodce puts the
results into the two-column matrix newsignal.
Random Signals and Error Analysis
Simulating a communication system often involves analyzing its response to
the noise inherent in real-world components. Such analysis aims to illustrate
the system’s response and possibly to help design a system appropriate for the
most likely kinds of noise.
Error Analysis Features of the Toolbox
Error analysis tasks supported in the Communications Toolbox include:
•Simulating noise or signal sources using random signals
•Computing the error rate or number of errors
•Plotting an eye diagram
•Generating a scatter plot
This section describes these toolbox functions that accomplish error-analysis
tasks: biterr, eyediagram, randerr, randint, randsrc, scatterplot, symerr,
and wgn. Since error analysis is often a component of communication system
simulation, other portions of this guide provide additional examples.
Random Signals
Random signals are useful for simulating noise, errors, or signal sources.
Besides built-in MATLAB functions like rand and randn, you can also use these
functions from this toolbox:
•wgn, for generating white Gaussian noise
•randsrc, for generating random symbols
•randint, for generating uniformly distributed random integers
•randerr, for generating random bit error patterns
While randsrc and randint are suitable for representing sources, randerr is
more appropriate for modeling channel errors.
White Gaussian Noise
The wgn function generates random matrices using a white Gaussian noise
distribution. You specify the power of the noise in either dB (decibels), dBm, or
linear units. You can generate either real or complex noise.