Upload
starlink1
View
221
Download
0
Embed Size (px)
Citation preview
8/13/2019 1- Studying Components of a Communication System
1/19
Studying Components of a Communication System
Section Overview
Modulating a Random Signal
Plotting Signal Constellations
Pulse Shaping Using a Raised Cosine Filter
Using a Convolutional Code
Section Overview
Communications Toolbox software implements a variet of communications!related
tas"s# Man of the functions in the toolbox perform computations associated with aparticular component of a communication sstem$ such as a demodulator or e%uali&er#
Other functions are designed for visuali&ation or analsis#
'hile the later chapters of this document discuss various toolbox features in more depth$this section builds an example step b step to give ou a first loo" at the toolbox# This
section also shows how Communications Toolbox functionalities build upon the
computational and visuali&ation tools in the underling M(T)(* environment#
Modulating a Random Signal
This first example addresses the following problem+
Problem Process a binar data stream using a communication sstem that
consists of a baseband modulator$ channel$ and demodulator# Compute thesstem,s bit error rate -*.R/# (lso$ displa the transmitted and received signals in
a scatter plot#
The following table indicates the "e tas"s in solving the problem$ along with relevantCommunications Toolbox functions# The solution arbitraril chooses baseband 01!2(M
-%uadrature amplitude modulation/ as the modulation scheme and ('34 -additive white
3aussian noise/ as the channel model#
http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#brb2_18http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068231625http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068232834b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068239783b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068232859b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#brb2_18http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068231625http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068232834b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068239783b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068232859b18/13/2019 1- Studying Components of a Communication System
2/19
Task Function or Method
3enerate a random binar data stream randint
Modulate using 01!2(M modulatemethod on modem.qammodob5ect
(dd white 3aussian noise awgn
Create a scatter plot scatterplot
6emodulate using 01!2(M modulatemethod on modem.qamdemodob5ect
Compute the sstem,s *.R biterr
Solution of Problem
The discussion below describes each step in more detail$ introducing M!code along the
wa# To view all the code in one editor window$ enter the following in the M(T)(*
Command 'indow#
edit commdoc_mod
! "enerate a Random #inary $ata Stream! The conventional format for representing
a signal in M(T)(* is a vector or matrix# This example uses the randintfunction to
create a column vector that lists the successive values of a binar data stream# The length
of the binar data stream -that is$ the number of rows in the column vector/ is arbitrarilset to 78$888#
%ote The sampling times associated with the bits do not appear explicitl$ and
M(T)(* has no inherent notion of time# For the purpose of this example$
"nowing onl the values in the data stream is enough to solve the problem#
The code below also creates a stem plot of a portion of the data stream$ showing the
binar values# 9our plot might loo" different because the example uses random numbers#
4otice the use of the colon -:/ operator in M(T)(* to select a portion of the vector# Formore information about this sntax$ see The Colon Operatorin the M(T)(*
documentation set#
http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-84864.html#f1-85254http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-84864.html#f1-852548/13/2019 1- Studying Components of a Communication System
3/19
%% Setup% Define parameters.M = 16; % Sie of signal constellation
! = log"#M$; % umber of bits per s&mboln = 'e(; % umber of bits to processnsamp = 1; % )*ersampling rate+Mod = modem.qammod#M$; % ,reate a 16-/M modulator
%% Signal Source% ,reate a binar& data stream as a column *ector.0 = randint#n1$; % 2andom binar& data stream
% 3lot first (4 bits in a stem plot.stem#0#1:(4$5filled5$;title#52andom its5$;0label#5it 7nde05$; &label#5inar& 8alue5$;
8/13/2019 1- Studying Components of a Communication System
4/19
&! Prepare to Modulate! The modem.qammodob5ect implements an M!ar 2(M
modulator$ M being 01 in this example# :t is configured to receive integers between 8 and
0; rather than
of values from 0across a row of a matrix$ using the res+apefunction in M(T)(*$ and
then appl the bi"defunction to convert each
characters after the res+apecommand form the uncon5ugated arra transpose operator in
M(T)(*# For more information about this and the similar 5operator$ see Reshaping a
Matrixin the M(T)(* documentation set#/
%% it-to-S&mbol Mapping% ,on*ert t+e bits in 0 into !-bit s&mbols.0s&m = bi"de#res+ape#0!lengt+#0$9!$.55left-msb5$;
%% Stem 3lot of S&mbols% 3lot first 14 s&mbols in a stem plot.figure; % ,reate new figure window.stem#0s&m#1:14$$;title#52andom S&mbols5$;0label#5S&mbol 7nde05$; &label#57nteger 8alue5$;
http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-85766.html#f1-86004http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-85766.html#f1-86004http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-85766.html#f1-86004http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-85766.html#f1-860048/13/2019 1- Studying Components of a Communication System
5/19
'! Modulate (sing )*+,M! =aving defined 0s&mas a column vector containing
integers between 8 and 0;$ ou can use the modulatemethod of the modem.qammod
ob5ect to modulate 0s&musing the baseband representation# Recall that Mis 01$ the
alphabet si&e#
%% Modulation& = modulate#modem.qammod#M$0s&m$; % Modulate using 16-/M.
The result is a complex column vector whose values are in the 01!point 2(M signal
constellation# ( later step in this example will show what the constellation loo"s li"e#
To learn more about modulation functions$ see Modulation#(lso$ note that themodulate
method of the modem.qammodob5ect does not appl an pulse shaping# To extend this
example to use pulse shaping$ see Pulse Shaping Using a Raised Cosine Filter#For an
example that uses rectangular pulse shaping with PS> modulation$ see basicsimdemo#
-! ,dd .hite "aussian %oise! (ppling the awgnfunction to the modulated signal adds
white 3aussian noise to it# The ratio of bit energ to noise power spectral densit$ .b?48$
is arbitraril set at 08 d*#
The expression to convert this value to the corresponding signal!to!noise ratio -S4R/
involves !$ the number of bits per smbol -which is < for 01!2(M/$ and nsamp$ the
oversampling factor -which is 0 in this example/# The factor !is used to convert .b?48to
an e%uivalent .s?48$ which is the ratio of symbolenerg to noise power spectral densit#
The factor nsampis used to convert .s?48in the smbol rate bandwidth to an S4R in the
sampling bandwidth#
%ote The definitions of &t0and &r0and the nsampterm in the definition of snr
are not significant in this example so far$ but will ma"e it easier to extend the
example later to use pulse shaping#
%% ransmitted Signal&t0 = &;
%% ,+annel% Send signal o*er an / 14?log14#!$ - 14?log14#nsamp$;&nois& = awgn#&t0snr5measured5$;
%% 2ecei*ed Signal&r0 = &nois&;
To learn more about awgnand other channel functions$ see Channels#
http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp59183.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp59183.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068239783b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068239783b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/rmvd_matlablink__3.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/rmvd_matlablink__3.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1069370812.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp59183.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068239783b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/rmvd_matlablink__3.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1069370812.html8/13/2019 1- Studying Components of a Communication System
6/19
/! Create a Scatter Plot! (ppling the scatterplotfunction to the transmitted and
received signals shows what the signal constellation loo"s li"e and how the noise distorts
the signal# :n the plot$ the hori&ontal axis is the in!phase component of the signal and thevertical axis is the %uadrature component# The code below also uses the title$ legend$
and a0isfunctions in M(T)(* to customi&e the plot#
%% Scatter 3lot% ,reate scatter plot of nois& signal and transmitted% signal on t+e same a0es.+ = scatterplot#&r0#1:nsamp?@e'$nsamp45g.5$;+old on;scatterplot#&t0#1:@e'$145!?5+$;title#52ecei*ed Signal5$;legend#52ecei*ed Signal55Signal ,onstellation5$;a0is#A-@ @ -@ @B$; % Set a0is ranges.
+old off;
8/13/2019 1- Studying Components of a Communication System
7/19
To learn more about scatterplot$ see Scatter Plots#
http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp6296.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp6296.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp6296.html8/13/2019 1- Studying Components of a Communication System
8/19
)! $emodulate (sing )*+,M! (ppling the demodulatemethod of the
modem.qamdemodob5ect to the received signal demodulates it# The result is a column
vector containing integers between 8 and 0;#
%% Demodulation% Demodulate signal using 16-/M.s&m = demodulate#modem.qamdemod#M$&r0$;
0! Convert the 1nteger*2alued Signal to a #inary Signal! The previous step produced
s&m$ a vector of integers# To obtain an e%uivalent binar signal$ use the de"bifunction
to convert each integer to a corresponding binar
use the res+apefunction to arrange all the bits in a single column vector rather than a
four!column matrix#
%% S&mbol-to-it Mapping% Cndo t+e bit-to-s&mbol mapping performed earlier. = de"bi#s&m5left-msb5$; % ,on*ert integers to bits.% ,on*ert from a matri0 to a *ector. = res+ape#.5numel#$1$;
3! Compute the System4s #5R! (ppling the biterrfunction to the original binar
vector and to the binar vector from the demodulation step above ields the number of bit
errors and the bit error rate#
%% 2 ,omputation% ,ompare 0 and to obtain t+e number of errors and
% t+e bit error rate.Anumber_of_errorsbit_error_rateB = biterr#0$
The statistics appear in the M(T)(* Command 'indow# 9our results might var
because the example uses random numbers#
number_of_errors =
1
bit_error_rate =
4.44"(
To learn more about biterr$ see Performance Results via Simulation#
http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp6146.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp6146.html8/13/2019 1- Studying Components of a Communication System
9/19
Plotting Signal Constellations
The example in the previous section created a scatter plot from the modulated signal#
(lthough the plot showed the points in the 2(M constellation$ the plot did not indicatewhich integers between 8 and 0; the modulator mapped to a given constellation point#
This section addresses the following problem+
Problem Plot a 01!2(M signal constellation with annotations that indicate themapping from integers to constellation points#
The solution uses the scatterplotfunction to create the plot and the te0tfunction in
M(T)(* to create the annotations#
Solution of Problem
To view a completed M!file for this example$ enter edit commdoc_constin the
M(T)(* Command 'indow#
! Find ,ll Points in the )*+,M Signal Constellation! The ,onstellationpropert
of the modem.qammodob5ect contains all points in the 01!2(M signal constellation#
M = 16; % umber of points in constellation+=modem.qammod#M$; % Modulator obEectmapping=+.S&mbolMapping; % S&mbol mapping *ectorpt = +.,onstellation; % 8ector of all points in constellation
8/13/2019 1- Studying Components of a Communication System
10/19
&! Plot the Signal Constellation! The scatterplotfunction plots the points in pt#
% 3lot t+e constellation.scatterplot#pt$;
'! ,nnotate the Plot to 1ndicate the Mapping! To annotate the plot to show therelationship between mappingand pt$ use the te0tfunction to place a number in the plot
beside each constellation point# The coordinates of the annotation are near the real and
imaginar parts of the constellation point$ but slightl offset to avoid overlap# The text ofthe annotation comes from the binar representation of mapping# -The dec"binfunction
in M(T)(* produces a string of digit characters$ while the de"bifunction used in thelast section produces a vector of numbers#/
% 7nclude te0t annotations t+at number t+e points.te0t#real#pt$>4.1imag#pt$dec"bin#mapping$$;a0is#A-( ( -( (B$; % ,+ange a0is so all labels fit in plot.
8/13/2019 1- Studying Components of a Communication System
11/19
#inary*Coded )*+,M Signal Constellation
56amining the Plot
:n the plot above$ notice that 8880 and 8808 correspond to ad5acent constellation points
on the left side of the diagram# *ecause these binar representations differ b two bits$the ad5acenc indicates that the modem.qammodob5ect did notuse a 3ra!coded signal
constellation# -That is$ if it were a 3ra!coded signal constellation$ then the annotations
for each pair of ad5acent points would differ b one bit#/
* contrast$ the constellation below is one example of a 3ra!coded 01!2(M signalconstellation#
8/13/2019 1- Studying Components of a Communication System
12/19
"ray*Coded )*+,M Signal Constellation
The onl difference$ compared to the previous example$ is that ou configure
modem.qammodob5ect to use a 3ra!coded constellation#
%% Modified 3lot it+
8/13/2019 1- Studying Components of a Communication System
13/19
Pulse Shaping (sing a Raised Cosine Filter
This section further extends the example b addressing the following problem+
Problem Modif the 3ra!coded modulation example so that it uses a pair of
s%uare root raised cosine filters to perform pulse shaping and matched filtering atthe transmitter and receiver$ respectivel#
The solution uses the rcosinefunction to design the s%uare root raised cosine filter and
the rcosfltfunction to filter the signals# (lternativel$ ou can use the rcosflt
function to perform both tas"s in one command@ see Filtering with Raised Cosine Filters
or the rcosdemodemonstration for more details#
Solution of Problem
This solution modifies the code from commdoc_gra&.m# To view the original code in an
editor window$ enter the following command in the M(T)(* Command 'indow#
edit commdoc_gra&
To view a completed M!file for this example$ enter edit commdoc_rrcin the M(T)(*
Command 'indow#
! $efine Filter*Related Parameters! :n the Setupsection of the example$ replace the
definition of the oversampling rate$ nsamp$ with the following#
nsamp = (; % )*ersampling rate
(lso$ define other "e parameters related to the filter b inserting the following after the
Modulationsection of the example and before the ransmitted signalsection#
%% Filter Definition% Define filter-related parameters.filtorder = (4; % Filter order
dela& = filtorder9#nsamp?"$; %
8/13/2019 1- Studying Components of a Communication System
14/19
&! Create a S7uare Root Raised Cosine Filter! To design the filter and plot its impulse
response$ insert the following commands after the commands ou added in the previous
step#
% ,reate a square root raised cosine filter.rrcfilter = rcosine#1nsamp5fir9sqrt5rolloffdela&$;
% 3lot impulse response.figure; imp#rrcfilter1$;
'! Filter the Modulated Signal! To filter the modulated signal$ replace the
ransmitted Signalsection with following#
%% ransmitted Signal% Cpsample and appl& square root raised cosine filter.
&t0 = rcosflt#&1nsamp5filter5rrcfilter$;
% ,reate e&e diagram for part of filtered signal.e&ediagram#&t0#1:"444$nsamp?"$;
The rcosfltcommand internall upsamples the modulated signal$ &$ b a factor of
nsamp$ pads the upsampled signal with &eros at the end to flush the filter at the end of the
filtering operation$ and then applies the filter#
8/13/2019 1- Studying Components of a Communication System
15/19
The e&ediagramcommand creates an ee diagram for part of the filtered noiseless
signal# This diagram illustrates the effect of the pulse shaping# 4ote that the signal shows
significant intersmbol interference -:S:/ because the filter is a s%uare root raised cosinefilter$ not a full raised cosine filter#
To learn more about e&ediagram$ see .e 6iagrams#
-! Filter the Received Signal! To filter the received signal$ replace the 2ecei*ed
Signalsection with the following#
%% 2ecei*ed Signal% Filter recei*ed signal using square root raised cosine filter.&r0 = rcosflt#&nois&1nsamp5Fs9filter5rrcfilter$;&r0 = downsample#&r0nsamp$; % Downsample.&r0 = &r0#"?dela&>1:end-"?dela&$; % /ccount for dela&.
These commands appl the same s%uare root raised cosine filter that the transmitter usedearlier$ and then downsample the result b a factor of nsamp#
http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp6197.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp6197.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp6197.html8/13/2019 1- Studying Components of a Communication System
16/19
The last command removes the first "?dela&smbols and the last "?dela&smbols in
the downsampled signal because the represent the cumulative dela of the two filtering
operations# 4ow &r0$ which is the input to the demodulator$ and &$ which is the output
from the modulator$ have the same vector si&e# :n the part of the example that computes
the bit error rate$ it is important to compare two vectors that have the same si&e#
/! ,d8ust the Scatter Plot! For variet in this example$ ma"e the scatter plot show thereceived signal before and after the filtering operation# To do this$ replace the Scatter
3lotsection of the example with the following#
%% Scatter 3lot% ,reate scatter plot of recei*ed signal before and% after filtering.+ = scatterplot#sqrt#nsamp$?&nois:nsamp?@e'$nsamp45g.5$;+old on;scatterplot#&r0#1:@e'$145!05+$;title#52ecei*ed Signal efore and /fter Filtering5$;legend#5efore Filtering55/fter Filtering5$;
a0is#A-@ @ -@ @B$; % Set a0is ranges.
4otice that the first scatterplotcommand scales &nois&b sqrt#nsamp$when
plotting# This is because the filtering operation changes the signal,s power#
8/13/2019 1- Studying Components of a Communication System
17/19
(sing a Convolutional Code
This section further extends the example b addressing the following problem+
Problem Modif the previous example so that it includes convolutional codingand decoding$ given the constraint lengths and generator polnomials of the
convolutional code#
The solution uses the con*encand *itdecfunctions to perform encoding and decoding$
respectivel# :t also uses the pol&"trellisfunction to define a trellis that represents a
convolutional encoder# To learn more about these functions$ see Convolutional Coding#
See also *itsimdemofor an example of convolutional coding and decoding#
Solution of Problem
This solution modifies the code from Pulse Shaping Using a Raised Cosine Filter# To
view the original code in an editor window$ enter the following command in the
M(T)(* Command 'indow#
edit commdoc_rrc
To view a completed M!file for this example$ enter edit commdoc_codein the
M(T)(* Command 'indow#
! 1ncrease the %umber of Symbols! Convolutional coding at this value of bo
reduces the *.R mar"edl# (s a result$ accumulating enough errors to compute a reliable*.R re%uires ou to process more smbols# :n the Setupsection$ replace the definition
of the number of bits$ n$ with the following#
n = @e@; % umber of bits to process
%ote The larger number of bits in this example causes it to ta"e a noticeabllonger time to run compared to the examples in previous sections#
&! 5ncode the #inary $ata! To encode the binar data before mapping it to integers for
modulation$ insert the following after the Signal Sourcesection of the example and
before the it-to-S&mbol Mappingsection#
%% ncoder
http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp7405.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp7405.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/rmvd_matlablink__5.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068239783b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp7405.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/rmvd_matlablink__5.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1068239783b18/13/2019 1- Studying Components of a Communication System
18/19
% Define a con*olutional coding trellis and use it% to encode t+e binar& data.t = pol&"trellis#A@ (BA"' '@ 4; 4 @ 1'B$; % relliscode = con*enc#0t$; % ncode.coderate = "9';
The pol&"trelliscommand defines the trellis that represents the convolutional codethat con*encuses for encoding the binar vector$ 0# The two input arguments in the
pol&"trelliscommand indicate the constraint length and generator polnomials$
respectivel$ of the code# ( diagram showing this encoder is in.xample+ ( Rate!A?7
Feedforward .ncoder#
'! ,pply the #it*to*Symbol Mapping to the 5ncoded Signal! The bit!to!smbol
mapping must appl to the encoded signal$ code$ not the original uncoded data# Replace
the first definition of 0s&m-within the it-to-S&mbol Mappingsection/ with the
following#
% . Do ordinar& binar&-to-decimal mapping.0s&m = bi"de#res+ape#code!lengt+#code$9!$.55left-msb5$;
Recall that !is 14?log14#!?coderate$-14?log14#nsamp$;
/! $ecode the Convolutional Code! To decode the convolutional code before
computing the error rate$ insert the following after the entire S&mbol-to-it Mapping
section and 5ust before the 2 ,omputationsection#
%% Decoder% Decode t+e con*olutional code.tb = 16; % racebac! lengt+ for decoding
= *itdec#ttb5cont55+ard5$; % Decode.
The sntax for the *itdecfunction instructs it to use hard decisions# The 5cont5
argument instructs it to use a mode designed for maintaining continuit when ou invo"ethe function repeatedl -as in a loop/# (lthough this example does not use a loop$ the
5cont5mode is used for the purpose of illustrating how to compensate for the dela in
this decoding operation# The dela is discussed further in More (bout 6elas#
http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp7405.html#fp7855http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp7405.html#fp7855http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp7405.html#fp7855http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp7405.html#fp7855http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1069096205b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp7405.html#fp7855http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp7405.html#fp7855http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1067963807.html#a1069096205b18/13/2019 1- Studying Components of a Communication System
19/19
)! ,ccount for $elay .hen Computing #5R! The continuous operation mode of the
iterbi decoder incurs a dela whose duration in bits e%uals the tracebac" length$ tb$
times the number of input streams to the encoder# For this rate A?7 code$ the encoder hastwo input streams$ so the dela is "?tbbits#
(s a result$ the first "?tbbits in the decoded vector$ $ are 5ust &eros# 'hen computing
the bit error rate$ ou should ignore the first "?tbbits in and the last "?tbbits in the
original vector$ 0# :f ou do not compensate for the dela$ then the *.R computation is
meaningless because it compares two vectors that do not trul correspond to each other#
Therefore$ replace the 2 ,omputationsection with the following#
%% 2 ,omputation% ,ompare 0 and to obtain t+e number of errors and% t+e bit error rate. a!e t+e decoding dela& into account.decdela& = "?tb; % Decoder dela& in bitsAnumber_of_errorsbit_error_rateB = ... biterr#0#1:end-decdela&$#decdela&>1:end$$
More ,bout $elays
The decoding operation in this example incurs a dela$ which means that the output of thedecoder lags the input# Timing information does not appear explicitl in the example$ and
the duration of the dela depends on the specific operations being performed# 6elas
occur in various communications!related operations$ including convolutional decoding$
convolutional interleaving?deinterleaving$ e%uali&ation$ and filtering# To find out theduration of the dela caused b specific functions or operations$ refer to the specific
documentation for those functions or operations# For example+
The *itdecreference page
6elas of Convolutional :nterleavers
6elas from .%uali&ation
.xample+ Compensating for 3roup 6elas in 6ata (nalsis
Fading Channels
The .ffect of 6elas on Recover of Convolutionall :nterleaved 6atadiscussion also
includes two tpical was to compensate for delas#
http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ref/vitdec.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1038936599b1.html#a1038936890b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1049735604b1.html#a1057933283b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp59529.html#fp61083http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1069449399.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1038936599b1.html#a1050431453http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ref/vitdec.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1038936599b1.html#a1038936890b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1049735604b1.html#a1057933283b1http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/fp59529.html#fp61083http://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1069449399.htmlhttp://www.mathworks.com/access/helpdesk/help/toolbox/comm/ug/a1038936599b1.html#a1050431453