<< Chapter < Page | Chapter >> Page > |
Then the pairs might be encoded as
to produce the symbol sequence
Of course, there are many ways that such a mapping between bits and symbols might be made, and [link] explores one simple alternative called the Gray code.The binary sequence may be grouped in many ways: into triplets for an 8-level signal, intoquadruplets for a 16-level scheme, into “in-phase” and “quadrature” parts for transmission through aquadrature system. The values assigned to the groups ( in (8.2)) are called the alphabet of the given system.
Text is commonly encoded using ASCII, and M
atlab automatically
represents any string file as a list of ASCII numbers.For instance, let
str='I am text'
be a text
string. This can be viewed in its internal form bytyping
real(str)
, which returns the vector
,
which is the (decimal) ASCII representation of this string.This can be viewed in binary using
dec2base(str,2,8)
,
which returns the binary (base 2) representation of thedecimal numbers, each with 8 digits.
The M
atlab function
letters2pam.m
,
provided on the website,changes a text string into the 4-level
alphabet
. Each letter is represented by
a sequence of 4 elements, for instance the letter
is
. The function is invoked with the
syntax
letters2pam(str)
. The inverse operation
is
pam2letters.m
. Thus
pam2letters(letters2pam(str))
returns the original string.
One complication in the decoding procedure is that the receiver must figure out when the groups begin in order to parse thedigits properly. For example, if the first element of the sequence in [link] was lost, then the message would be mistranslated as
Similar parsing problems occur whenever messages start or stop. For example, if the message consistsof pixel values for a television image, it is important that the decoder be able to determine precisely when the image scan begins. These kinds of synchronization issues are typically handledby sending a special “start of frame” sequence that is known to both the transmitter and the receiver.The decoder then searches for the start sequence, usually using some kind of correlation (pattern matching) technique.This is discussed in detail in "Correlation" .
There are many ways to translate data into binary equivalents.
Example
"Bits to Symbols" showed one way to convert text
into 4-PAM and then into binary. Another way exploits theM
atlab function
text2bin.m
and its inverse
bin2text.m
, which use the 7-bit version of the
ASCII code (rather than the 8-bit version). This representationis more efficient, since each pair of text letters can be
represented by 14 bits (or seven 4-PAM symbols) rather than16 bits (or eight 4-PAM symbols). On the other hand, the
7-bit version can encode only half as many charactersas the 8-bit version. Again, it is important
to be able to correctly identify the start of each letterwhen decoding.
The M
atlab code in
naivecode.m
, which is
on the website, implements the translation from binary to 4-PAM(and back again) suggested in
[link] .
Examine the resiliency of this translation to noiseby plotting the number of errors as a function of
the noise variance
v
. What is the largest variance
for which no errors occur? At what varianceare the errors near 50%?
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?