This action might not be possible to undo. Are you sure you want to continue?

Demodulator

(64-QAM)

for

Cable Modem

EE297

MSEE Project

San Jose State

University

DEPT OF ELECTRICAL ENGINEERING

for Dr. Jack Kurzweil

by Rajat Sewal

Fall 1998

2

Table of Contents

Chapter 1 QAM Demodulator_____________________________________________ 6

Section 1.1 INTRODUCTION – DIGITAL COMMUNICATION SYSTEM ____________ 6

Chapter 2 DISCUSSION OF INFORMATION THEORY________________________ 9

Section 2.1 LOGARITHMIC MEASURE OF INFORMATION______________________ 9

Section 2.2 SOURCE ENCODING ____________________________________________ 13

Section 2.3 CHANNEL ENCODING __________________________________________ 18

Chapter 3 ERROR CORRECTION ________________________________________ 21

Section 3.1 Block Codes ____________________________________________________ 21

Section 3.2 Convolutional Codes______________________________________________ 22

Section 3.3 Block Codes in Detail _____________________________________________ 23

Chapter 4 DATA MODULATION & DEMODULATION_______________________ 26

Section 4.1 Discrete Data Transmission ________________________________________ 26

Section 4.2 Introduction to Linear Modulation Methods____________________________ 27

Section 4.3 QAM Schematic _________________________________________________ 34

Section 4.4 Probability of Error in QAM ______________________________________ 36

Chapter 5 Cable Modem Introduction _____________________________________ 39

Section 5.1 Definition of Cable Modem ________________________________________ 39

Section 5.2 Structure of Cable systems _________________________________________ 39

Section 5.3 Cable Specifications ______________________________________________ 45

Section 5.4 Baud, Bit-rate, Modem Speed_______________________________________ 50

Section 5.5 Digital TV Standards______________________________________________ 51

Section 5.6 Overview of transport subsystem ____________________________________ 52

Section 5.7 MPEG-TS Transport Stream________________________________________ 54

Section 5.8 Set-Top Boxes ___________________________________________________ 55

Glossary of terms __________________________________________________________ 57

Chapter 6 Modem Design _______________________________________________ 59

Section 6.1 Basic Modulator _________________________________________________ 59

Section 6.2 Modem Specification _____________________________________________ 63

Section 6.3 IEEE802.14 Specification__________________________________________ 66

Chapter 7 Matlab Simulation ____________________________________________ 67

Section 7.1 Communication Tool Box__________________________________________ 67

Section 7.2 Matlab Code ____________________________________________________ 68

Section 7.3 Discussion of Matlab Code _________________________________________ 73

3

Section 7.4 Discussion of Simulation Results ____________________________________ 80

Section 7.5 Summary of Simulation Results_____________________________________ 90

Chapter 8 Set-top Box ASIC Design _______________________________________ 91

4

List of Figures

FIGURE 1.1 DIGITAL COMMUNICATION SYSTEM MODEL _______________________________________ 6

FIGURE 2.1 ENTROPY OF SOURCE _______________________________________________________ 12

FIGURE 2.2 DIGITAL COMMUNICATION SYSTEM ____________________________________________ 13

FIGURE 2.3 PCM ____________________________________________________________________ 15

FIGURE 2.4 DPCM ENCODER _________________________________________________________ 16

FIGURE 2.5 DELTA MODULATION________________________________________________________ 17

FIGURE 2.6 SIMPLE CHANNEL CODING____________________________________________________ 18

FIGURE 3.1 SYSTEMATIC BLOCK ENCODER ________________________________________________ 21

FIGURE 3.2 ANATOMY OF A CODEWORD __________________________________________________ 21

FIGURE 3.3 CLASS OF CHANNEL CODES ___________________________________________________ 22

FIGURE 4.1 VECTOR MODEL OF COMMUNICATION SYSTEM_________________________________ 26

FIGURE 4.2 PAM SIGNAL, FSK, & PSK __________________________________________________ 28

FIGURE 4.3 PAM CONSTELLATION_______________________________________________________ 29

FIGURE 4.4 BASE BAND PAM __________________________________________________________ 30

FIGURE 4.5 PASS BAND PAM __________________________________________________________ 31

FIGURE 4.6 PSK ____________________________________________________________________ 31

FIGURE 4.7 QPSK WAVEFORM________________________________________________________ 31

FIGURE 4.8 QAM CONSTELLATIONS _____________________________________________________ 33

FIGURE 4.9 MODULATED WAVEFORMS__________________________________________________ 33

FIGURE 4.10 RECTANGULAR QAM_______________________________________________________ 34

FIGURE 4.11 QAM MODULATOR ________________________________________________________ 34

FIGURE 4.12 QAM DEMODULATOR_______________________________________________________ 35

FIGURE 4.13 64-QAM BIT ASSIGNMENT__________________________________________________ 36

FIGURE 4.14 P

M

VS SNR FOR QAM & PSK________________________________________________ 38

FIGURE 4.15 NOISY SIGNAL CONSTELLATION ______________________________________________ 38

FIGURE 5.1 CABLE NETWORK___________________________________________________________ 40

FIGURE 5.2 HYBRID FIBER/COAX NETWORK ________________________________________________ 41

FIGURE 5.3 HFC NETWORK ____________________________________________________________ 42

FIGURE 5.4 COAXIAL CABLE____________________________________________________________ 43

FIGURE 5.5 FCC FREQUENCY ALLOCATION ________________________________________________ 43

FIGURE 5.6 DROP CABLE FREQUENCY RESPONSE ___________________________________________ 44

FIGURE 5.7 TRUNK CABLE FREQUENCY RESPONSE __________________________________________ 44

FIGURE 5.8 TRUNK COAX CONSTRUCTION _________________________________________________ 45

FIGURE 5.9 FCC FREQUENCY DETAIL ____________________________________________________ 49

FIGURE 5.10 TRANSPORT PACKET FORMAT ______________________________________________ 53

FIGURE 5.11 TRANSMITTER-RECEIVER FOR DIGITAL TELEVISION _______________________________ 53

FIGURE 5.12 MPEG-2 FRAME __________________________________________________________ 54

FIGURE 5.13 DIGITAL VIDEO STANDARDS _________________________________________________ 56

FIGURE 6.1 BASIC MODULATOR _________________________________________________________ 59

FIGURE 6.2 LOW PASS FILTER __________________________________________________________ 60

FIGURE 6.3 RAISED COSINE PULSE 13 . 0 α ____________________________________________ 61

FIGURE 6.4 RAISED COSINE PULSE 0 α (IDEAL LOW PASS) _________________________________ 62

FIGURE 6.5 RAISED COSINE PULSE 5 . 0 α ______________________________________________ 62

FIGURE 6.6 FULL RAISED COSINE PULSE 1 α __________________________________________ 62

FIGURE 6.7 QAM ARCHITECTURE _____________________________________________________ 63

FIGURE 6.8 NATIONAL SEMICONDUCTOR-QAM SCHEMATIC ________________________________ 65

FIGURE 6.9 TYPE C PHY ______________________________________________________________ 66

FIGURE 7.1 QAM -MATLAB SYSTEM ___________________________________________________ 72

FIGURE 7.2 NO ERROR CORRECTION _____________________________________________________ 80

FIGURE 7.3 ERROR CORRECTION N=7____________________________________________________ 81

FIGURE 7.4 ERROR CORRECTION N=15___________________________________________________ 82

FIGURE 7.5 ERROR CORRECTION N=31___________________________________________________ 83

5

FIGURE 7.6 MAPPED DATA____________________________________________________________ 85

FIGURE 7.7 XMIT FILTERED DATA ______________________________________________________ 86

FIGURE 7.8 RF DATA _________________________________________________________________ 87

FIGURE 7.9 FFT OF RCVR FILTER OUTPUT ________________________________________________ 88

FIGURE 7.10 QASK CONSTELLATION_____________________________________________________ 89

6

Chapter 1 QAM Demodulator

Section 1.1 INTRODUCTION – DIGITAL COMMUNICATION

SYSTEM

A Demodulator for a Quadrature Amplitude Modulated signal with 64 symbol

constellations for Cable Modem is designed. Before getting into the specific

design aspects of a QAM demodulator we need to define terms and go over

some basic concepts in Digital Communications.

A general communication system is shown in Figure 1.1. Each block is defined

below.

Figure 1.1 Digital Communication System Model

The following is a very brief synopsis of the above model and a more detailed

discussion is to be found later on in Chapter 2,Chapter 3, and Chapter 4.

1. Data Source: Set of Symbols generated by a person or system to be

sent over a transmission medium to a user.

Examples

• Speech/Audio

• Image/Video

• Telemetry

• Computer Data

2. Source Encoder: Messages from users are highly redundant. So we

perform compression of redundancy in a systematic manner and that is called

source encoding. Since we are looking to represent the source output with as

few binary digits as possible this is also called compression.

7

Examples

• CELP coding for speech/audio signals

• JPEG coding for still images

• Lempel-Ziv universal lossless coding for test compression, also called

LZ compression

3. Channel Encoder: any coding for improved transmission over a physical

medium. There are two classes of Channel encoders (a) Block Codes (b)

Convolutional codes. See Figure 3.3. The main difference between Block codes

and Convolutional codes is the existence of memory in Convolutional codes.

Examples

• Block Codes: BCH

• Trellis codes: Convolutional & Coset

In many cases the two (Source Encoder & Channel Encoder) are combined into

one function called "Vector Encoder”. Refer to Figure 4.1 for another

perspective of a Discrete Data Transmission system with vector representation.

4. Digital Modulator: This is one of many modulation schemes possible.

Here binary data is mapped into symbols and modulated with a carrier. The

modulator accepts a discrete time information sequence at its input and puts out

a set of corresponding waveforms.

• PSK

• QPSK

• QAM

5. Channel: This is any physical medium over which the Transmitted signal

must pass to get to the Receiver.

Examples

• Air/Deep space Radio Frequency

• Telephone twisted pair (POTS - Plain Old Telephone System)

• Ethernet

• Fiber-optic Link (using a pulsed laser light)

• CD Rom

• Magnetic Disk

6. Distortion & Noise: When analog signals are digitized and compressed

there is always a cost associated with the process. In digitization of band-limited

signals, we employ Nyquist Theorem to guarantee exact reconstruction.

However, any other source compression is realized at a cost of varying degree of

imperfect representation. This is called distortion and it is NOT recoverable. In

addition, signals in the communication link are faced with a number of ills. They

are loosely called noise.

8

The presence of noise on a signal changes its shape and characteristics and it

limits the ability of the intended receiver to make correct symbol decisions, and

thereby affects the rate of reliable communication.

Examples:

• Additive Gaussian White Noise

• Device noise

• Atmospheric noise in the microwave channels

• Intersymbol interference in data communication systems

• Interspeaker interference in voice communications

• Near-end and Far-end crosstalk

• Echoes in Link and chamber

• Friendly and unfriendly jammers, etc.

7. Digital Demodulator: This operation is the exact mirror operation of the

modulator. Here the carrier is removed from the signal stream and the in-phase

and quadrature components (in the case of QAM) separated into two paths.

8. Channel Decoder: Perform inverse operations of Channel Coder

9. Source Decoder: Perform inverse operations of Source Coder. The two

functions Channel Decoder and Source Decoder are often lumped as Vector

Detector as shown in Figure 4.1.

10. User: The final destination of the message. At this point the message is

in its original format but may not be identical. This is referred to as the

recovered message mˆ .

Return to Table of Contents TOC

9

Chapter 2 DISCUSSION OF INFORMATION THEORY

Rare events carry more information than common events

Information is directly linked with probability, more so than we realize at first. If I

told you that the sun was shining brightly in San Francisco there would not be as

much information conveyed as if I told you that there was a magnitude 7 earth

quake in San Francisco this morning and there was great destruction to lives

and property. Now that’s information! The nature of information defined

scientifically is explored next.

It was a great scientist named Claude Shannon in 1948 who based on

probabilistic models presented two papers that gave birth to Information Theory.

He discussed the basic problem of reliable transmission of information in

statistical terms. He adopted a logarithmic measure for the information content

of a source and established basic limits on the maximum rate that digital

information can be transmitted reliably over a noisy communication channel. It is

worthwhile to appreciate that Shannon’s work on DIGITAL communication was

done at a time when communication was primarily analog and there was little

demand for systems that used digital communication because of the large

complexity and hence cost of digital hardware required to achieve the high

efficiency and the high reliability predicted by Shannon’s theory.

Section 2.1 LOGARITHMIC MEASURE OF INFORMATION

Say we have two discrete random variables X and Y which can take on values

from

X ∈ {x

1

,x

2

,x

3

,…,x

n

} and Y ∈ {y

1

,y

2

,y

3

,…,y

m

}

We can have two situations either X depends on Y or X is independent of Y. Of

course when I say X depends on Y, I mean it may depend on Y to a small

degree or a large degree and that relation is defined loosely right now as Mutual

Information. We shall see how this works. Some knowledge of probability will

be assumed otherwise this discussion will go north exponentially. Given a

discrete random variable is exactly like giving a dice (actually die) and predicting

the outcome of an event (what number shows up) when a trial is conducted.

There are only six possible outcomes so this is a discrete random event. If we

had another die and began to throw it and started to predict its outcome based

on the outcome of the first die we are trying to relate the two events. It is this

sort of thing we are doing with the random variables X and Y. It is very

important to realize that if the occurrence of the first event x

2

tells us something

about the event y

3

then we have some knowledge or information about Y from X.

But when the events x

2

and y

3

are so tightly related such as in the following

example then no information is conveyed. Say we have a blue card with the

letters A, B, and C written on the face, and a yellow card with letters D, E, and F

10

on it. Now we draw a card (face-up) and given that we pull the yellow card, what

is the probability that it also shows the letter E? Well this is of course

P(E/yellow) = 1 . So if I told you that I pulled a yellow card (given) and I have also

pulled the letter E, I have told you nothing.

We know this so well that it seems absurd to even discuss it! So THERE IS NO

INFORMATION given when the outcome is certain (probability = 1). Similarly

there is no information when P=0. This is like saying “you know what?

Astronauts are going to land on the surface of the Sun"; we know that it is

impossible to do this. Again non-sense, or no information. When do we have

information? When there is some probability of event y

3

occurring when x

3

has

occurred.

We can start putting this is mathematical terms. When X and Y are statistically

independent, the occurrence of Y = y

j

provides no information about the

occurrence of the event X = x

i

. On the other hand, when X and Y are fully

dependent such that the occurrence of Y = y

j

determines the occurrence of X=

x

i

the information content is simply that provided by the event X = x

i

. A suitable

measure that satisfies these conditions is the logarithm of the ratio of the

conditional probability. Here is a basic review of probability:

) ( ) ( i i x P x X P ≡ is read probability of the random variable X taking on the value xi

) / ( ) / ( j i j i y x P y Y x X P ≡ is read conditional probability of X taking on the value xi

given that Y has occurred and is yi.

Now for the definition of mutual information. The information content provided by

the occurrence of the event Y = y

j

about the event X = x

i

is defined as

) (

) / (

log ) ; (

i

j i

j i

x P

y x P

y x I eqn 2.1

) ; ( j i y x I is called the mutual information between x

i

and y

j

. The units of ) ; ( j i y x I

are determined by the base of the logarithm which is usually selected as 2 but

can be the natural base e . When the base of the logarithm is 2 the units of

) ; ( j i y x I are bits and when the base is e then the units of ) ; ( j i y x I are called nats

(natural units). Note: when working with log

2

() it is easier to calculate the log to

base 10, written log() then divide by the log of 2 to base 10:

A

B

C

D

E

F

11

0.301

) log(

) 2 ( log

) ( log

) ( log

10

10

2

a a

a

When the random variables X and Y are statistically independent

) ( ) / ( ) / ( i j i j i x P y Y x X P y x P because the probability of X is not affected by

what happens to Y. So equation 2.1 becomes,

0 ) 1 log(

) (

) (

log ) ; (

i

i

j i

x P

x P

y x I , the mutual information is zero.

However when the occurrence of Y = y

j

uniquely determines the occurrence of X

= x

i

ie fully-dependent, the conditional probability in the numerator of eq 2.1 is 1

and so

) ( log )

) (

1

log(

) (

) / (

log ) ; ( i

i i

j i

j i x P

x P x P

y x P

y x I − Which is just the information of the

event X = x

i

and for this reason is called the self information of the event X = x

i

and is denoted as

) ( log ) ( i i x P x I −

What is even more important than the self-information is the average self

information of the source ) ( X H . This is defined as

∑

n

i

i i x I x P X H

1

) ( ) ( ) (

but ) ( log ) ( i i x P x I − so that

∑

−

n

i

i i x P x P X H

1

) ( log ) ( ) ( eqn 2.2

where X represents the alphabet of possible output letters from a source and

) ( X H represents the average self-information per source letter and is also

called the entropy of the source.

In the special case when letters from the source are equally probable

n

x P i

1

) (

for all i eqn 2.2 becomes

∑

−

n

i

n

n n

X H

1

log

1

log

1

) (

When a general problem is considered where a source emits a sequence of

statistically independent letters, where each output letter is either 0 with

probability q, or is 1 with probability (1-q). The entropy of such a source is

calculated using eqn 2.2.

∑ ∑

− − − − − −

2

1 1

) 1 log( ) 1 ( log ) ( log ) ( ) ( log ) ( ) (

i

i i

n

i

i i q q q q x P x P x P x P X H

Note: log in above eqn is in base 2. To plot the graph we use log to base 10, so use the following eqn:

12

301 . 0

) 1 log(

) 1 (

301 . 0

log

) (

q

q

q

q q H

−

− − −

Note from the graph in Figure 2.1 that the maximum value of the entropy occurs

at

2

1

q where 1 ) (

2

1

H . Thus the entropy of a discrete source is a

maximum when the output letters are equally probable.

Figure 2.1 Entropy of Source

Also note that when X is the output of a discrete source, the entropy ) ( X H of

the source represents the average amount information emitted by the

source.

H q ( )

q

0 0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

Probability

E

n

t

r

o

p

y

i

n

b

i

t

s

/

l

e

t

t

e

r

13

Section 2.2 SOURCE ENCODING

Please refer to Figure 2.2 for this discussion. Having discussed the measure for

information. We now examine the process of encoding the output of a source

called source encoding. Why we do source encoding or sometimes called simply

source coding is to remove redundancy in the input data. There is more

fundamental reasoning behind source coding when considering analog sources.

This is important to discuss now.

Figure 2.2 Digital Communication System

SOURCE CODING IN ANALOG SOURCES

In contrast to a discrete time source whose output is a discrete random variable

X , a continuous time source (analog source) has an output ) (t X that is

characterized by a stochastic process. In the encoding of such a signal the first

step involves in sampling the source periodically. This converts the continuous

time source into an equivalent discrete time source. If the source output is

bandlimited and the sampling is performed at Nyquist rate or higher we get no

loss of information. However, the amplitudes of the samples are continuous

random variables and so each sample cannot be represented by a finite

sequence of binary digits. So each sample is quantized in amplitude to a finite

number of levels. The analog source is therefore reduced to a discrete-time

source having a finite number of levels or finite alphabet. Thus the quantization

process introduces some distortion depending on the method used. Since an

exact representation of an analog output requires an infinite number of bits

quantization results in data compression. Data compression is achieved at the

cost of some distortion. The objective of source coding is to minimize the source

bit rate while keeping the distortion tolerable.

Source

Source Encoder

(analog to digital)

Channel

Encoder

Digital

Modulator

Channel

Distortion

&

Noise

User

Source

Decoder

Channel

Decoder

Digital

DeModulator

14

When each sample is quantized separately the process is called scalar

quantization. When a block of samples is quantized jointly as a single vector the

process is called vector quantization or block quantization.

When source coding is performed on a block of outputs the efficiency of the

encoding method improves as the block size is increased.

A measure of the efficiency of a source encoding method can be obtained by

comparing the average number of binary digits per output letter from the source

to the entropy ) ( X H .

It is always more efficient to encode blocks of symbols instead of encoding each

symbol separately. By making the block size sufficiently large the average

number of binary digits per output letter can be made arbitrarily close to the

entropy of the source.

When the source is memoryless (ie each symbol is independent of the previous

one) the encoding is done separately and the system is called a discrete

memoryless system (DMS).

There are several source coding techniques used for analog sources and

they are listed below.

• PCM – Pulse Code Modulation

• DPCM – Differential Pulse Code Modulation

• DM – Delta Modulation

• LPC – Linear Predictive Coding – is a very different method of

encoding

PCM – Pulse Code Modulation

In PCM each sample of the analog signal is quantized to one of

R

2 amplitude

levels where R is the number of binary digits used to represent each sample.

If R = 3 and we use a uniform quantizer then we get an input/output relationship

as shown in Figure 2.3.

15

Figure 2.3 PCM

The unit delta should be replaced with ∆ in Figure 2.3 and then the step size of

the quantizer is defined as

R −

∆ 2 . So for our example 125 . 0 2

3

∆

−

This leads to a mean square quantization error of 0013 . 0

12

2

12

2 2

∆

− R

E

Measured in db the mean square quantization error is:

db db R E

R

8 . 28 8 . 10 6

12

2

log 10

12

log 10

2 2

− − −

∆

−

for a 3-bit quantizer.

What this tells us is that for one added bit in the quantizer we reduce the error by

6db. So for a 7 bit quantizer error = -52.8 db

Many signals such as speech waveforms have the characteristic that small signal

amplitudes occur more frequently than large amplitudes. For such signals we

use non-linear (non-uniform) quantizers that have more closely spaced levels for

small amplitudes and widely spaced levels at large signal amplitudes.

Telephone central office uses PCM codes with non-uniform quantizers (A-Law,

µ Law).

DPCM – Pulse Code Modulation

In sources that show significant correlation from one sample to the next a better

approach that leads to smaller bit rates is to code the differences between

samples instead of coding each sample independently. DPCM exploits the

redundancy in the samples to achieve a lower bit rate for the source output.

16

DPCM also achieves higher dynamic range and improved resolution as the

encoder “looks at” tiny variations (resolution) and can follow large signals

(dynamic range). Practical DPCM systems use an algorithm for predicting the

current sample based on the weighted linear combination of the previous p

samples, see eqn 2.3

∑

−

p

i

i n i n x a x

1

ˆ eqn 2.3

where n xˆ is the weighted linear combination of the past p samples and i a are

the predictor coefficients. The prediction algorithm used is Levinson and

Durbin’s.

Figure 2.4 DPCM ENCODER

The input to the predictor is denoted as n x

~

which is the signal sample n x modified

by the quantization process.

Also,

∑

−

p

i

i n i n x a x

1

~

ˆ

~

and n n n x x e

ˆ

~

− . Each value of the quantized prediction

error n e

~

is encoded into a sequence of binary digits and transmitted over the

channel to the destination. At the destination the same predictor that was used

in the transmitter is synthesized and its output n x

ˆ ~

is added to n e

~

to yield n x

~

.

Sampler Quantizer

Predictor

x(t)

e(n)

_

+

n e

~

n x

ˆ

~

n x

ˆ

~

value predicted _

n x

~

n x

17

DM – DELTA Modulation

Delta modulation can be viewed as a special case of DPCM in which a two level

(1-bit) quantizer is used in conjunction with a fixed first order predictor

z

1 −

.

Figure 2.5 Delta Modulation

In effect the DM encoder approximates a waveform ) (t x by a linear staircase

function. In order for the approximation to be relatively good the waveform

) (t x must change slowly relative to the sampling rate. This requirement implies

that the sampling rate must be several (at least 5 ) times the Nyquist rate.

Linear Predictive Coding LPC

This is a completely different approach to the problem of source encoding from

what we have seen so far ie waveform encoding. Instead of transmitting the

samples of the source waveform to the receiver, the parameters of a linear

system are transmitted along with the proper excitation signal.

To do this the source is modeled as a linear system (filter) which when excited

by an appropriate input results in the observed output.

SOURCE CODING IN DIGITAL SOURCES

There has been some confusion regarding source coding for digital sources and

what we shall see later called Channel Encoding. Discrete time sources whose

output is a discrete random variable have to be encoded in a different way and

for a different purpose than analog sources. The purpose here is not to bring a

signal into the digital domain (obviously since it is already digital) rather to

combat the effects of noisy channels. To put it neatly, the term source coding

when applied to analog sources implies some scheme to quantize the signal and

when the source is digital the source coder and channel coder are used

Sampler Quantizer

Unit Delay

z

1 −

x(t)

e(n)

_

+

1

~

± n e

n x

ˆ

~

n x

ˆ

~

value predicted _

n x

~

n x

18

synonymously. So in the case of digital signals we can go directly to the channel

encoding methods. The Communication model in Figure 2.2 emphasizes the

analog to digital nature of source coding.

Channel Encoding is discussed in the next section and in more detail under Error

Correction.

Section 2.3 CHANNEL ENCODING

In order to overcome noise and interference and to increase the reliability of the

data through the channel it is necessary to introduce some redundancy to the

data stream in a controlled manner. The redundancy introduced at the

transmitter aids the receiver in decoding the desired information bearing

sequence. One can conceive of a transmission model that employs no Channel

coding at all but practical systems do use some sort of channel coding or error

correction. Systems that use channel coding are said to employ coded

waveform signaling. One way to reduce the bit error rate ( e P ) is to add more

orthogonal signals (by introducing more symbols M ) but this increases the

bandwidth required proportional to M . Coding results in a lower probability of

error at the price of increasing the bandwidth and the complexity of the system.

However, the increase in bandwidth required to transmit a coded waveform is not

as much as would be needed if we simply increased M the number of symbols,

to lower e P . Higher bandwidth increases the noise introduced in the channel and

if we simply increased M we would increase noise proportionally. With coding

the gain in lower e P comes at a lower cost of noise than with increasing M . So

coding is a more bandwidth efficient way to improve the bit-error rate.

A SIMPLE EXAMPLE OF CHANNEL CODING

Here is a simple example to illustrate how redundancy can be introduced. We

can repeat the binary digit m times where m is say 3. So the possible source

coder outputs are as shown in Figure 2.6 below.

0 000

1 111

Figure 2.6 Simple Channel Coding

A more sophisticated method is to take k bits (message) at a time and mapping

this sequence to another n bit sequence called a code word see Figure 3.1,

Encoder

001

010

100

011

101

110

19

where k n > . The amount of redundancy introduced by this is measured by the

ratio k / n and is called the code rate c R .

The process of channel coding produces modulator input symbols that are

interrelated in either a block by block or sliding-window fashion, introducing a

memory (in the case of sliding-window) and redundancy into the signaling

process.

There are two major classes of codes 1. Block Codes and 2. Convolutional or

Trellis Codes. Some textbooks classify them as 1. Block Codes and 2. Sliding

Block codes but I prefer the former identification. Please refer to Figure 3.3 for

clarification and a quick synopsis of this. Under block codes we have Fixed-

length codes (Linear Codes) and Variable length codes (Non-linear codes).

Fixed length codes will be discussed in more detail but first let me get the Non-

linear codes out of the way.

VARIABLE LENGTH CODES (NON-LINEAR BLOCK CODES)

When the source symbols are not equally probable an efficient encoding method

is to use variable-length code words. An example of such encoding is the Morse

code from the 1800s. In the Morse code the letters that occur more frequently

are assigned short code words and those that occur less frequently are assigned

long code words. So in short, the probabilities of occurrence of the source letters

are used in assigning the code words. This type of encoding is called entropy

coding. A modern day example of this coding is the Huffman code (1952).

There is an underlying concern with Variable Length coding that the received

sequence must be uniquely and instantaneously decodable. There is too much

detail to go into here and we must move on to fixed length coding.

FIXED LENGTH CODES (LINEAR BLOCK CODES)

Say we have M possible symbols that we would like to transmit using binary

digits. Since there are M possible symbols the number of binary digits per

symbol required for unique encoding when M is a power of 2 is k given as:

M k 2 log where M

k

2

and when M is not a power of 2 it is 1 log 2 + M k

Fixed length codes is the subject of Chapter 3 and this is discussed in more

detail there.

HAMMING DISTANCE

The number of bit positions by which two codewords for a particular code are

different is called the Hamming distance

H

d .

Example: Given two code words c

1

= 101001 and c

2

= 101110, what is their

Hamming distance?

20

1 0 1 0 0 1

1 0 1 1 1 0

same same same Different different different

3 bit positions are different so

H

d = 3

MINIMUM HAMMING DISTANCE

The minimum number of bit positions in a set in which any two codewords for a

particular code are different is called the Minimum Hamming distance min

H

d .

Return to Table of Contents TOC

21

Chapter 3 ERROR CORRECTION

Data is source coded in order to enable the receiver to perform error correction

and the general classification of codes is shown in Figure 3.3. In this project I

shall discuss only Linear and Cyclic codes while the Convolutional codes will

only be mentioned in passing.

Section 3.1 Block Codes

Block channel encoders are implemented by combinatorial circuits. An inverse

circuit is used in the decoder. Each codeword results from a unique message.

An (n,k) block encoder over the field with N elements, transforms each

information block u into the codeword v by a static time invariant digital system

G(u). Refer to Figure 3.1. A key point in block codes (as opposed to

convolutional codes) is that each codeword is formed independently from other

codewords.

Figure 3.1 Systematic Block Encoder

In a block code the input information sequence u is divided into blocks of length

k and each block is mapped into coded vectors v of length n. This mapping is

independent from previous blocks (there exists no memory from one block to

another).

If a code is transmitted without being altered (ie parity bits are tacked on) it is

called systematic encoding shown in Figure 3.2. This simple coder appends

parity check digits so that the message appears unaltered in the codeword

occupying the last k bits. The job of the encoder is to choose the n-k digits

called parity check digits. The decoder simply picks the last k digits to recover

the message. Most block codes are systematic.

Figure 3.2 Anatomy of a Codeword

k message bits n code bits

22

Section 3.2 Convolutional Codes

Convolutional channel encoders are encoders with memory. Convolutional

codes differ from block codes in that there are no independent codewords. The

encoding process can be envisioned as a sliding window M symbols wide, which

moves over the sequence of information symbols in steps of K symbols. M is

called the constraint length of the code and K is usually equal to 1. With each

step of the sliding window, the encoding process generates N symbols based on

the M symbols visible in the window. The code rate is always n k / . Most

Convolutional codes are nonsystematic.

Figure 3.3 Class of Channel Codes

There are two methods of decoding (a) algebraic and (b) probabilistic. The

method by which convolutional codes are decoded is probabilistic and most often

done using the Viterbi Algorithm. The decoding of block codes is done using

algebraic methods based on a special branch of linear algerbra called Galois

BCH, Reed Solomon,

Cyclic Hamming,

Cyclic Golay

Hamming codes,

Hadamard codes,

Golay codes

23

(pronounced "Galua") finite fields. The general form of a Galois Field is GF(p

M

)

where there are p

M

elements, and p is a prime number. Galois Field is needed

only for non-binary codes (in fact the binary codes are a special case of GF with

M=2).

Section 3.3 Block Codes in Detail

In general block codes break the data stream up into bit k − blocks and

) ( k n − check bits are added to these blocks. This is referred to as a ) , ( k n bock

code. An encoder outputs a unique n-bit code for each of the

k

2 possible input

bit k − blocks . For example, a (15,11) code has 15 bit codewords, 4 bits of

which (15-11) are parity bits and the remaining 11 bits are data.

If we know the Hamming distance of a code, min

H

d then the number of errors

that can be corrected is 2 / ) 1 ( min− ≤

H

d t and the number of errors that can be

detected is min

H

d ≤ .

The idea of coding should be envisioned as creating an n dimensional

hypercube in n dimensional space with

n

2 vertices. We then choose

k

M 2 of

these vertices as codewords. Note:

n k

2 2 < since n k < . A linear block code is a

k -dimensional linear subspace of the n -dimensional space. The vertices of the

codewords should be chosen to be as far apart as possible to minimize the error

probability. This is done by making the minimum Hamming distance min

H

d as

large as possible.

The goal is to choose parity bits to correct as many errors as possible getting as

close to the theoretical limit of 2 / ) 1 ( min− ≤

H

d t while keeping the communication

efficiency as high as possible (don’t use too much bandwidth). It is true that

adding more parity bits will enable the system to correct more errors but this

requires more bandwidth (adding more noise) and the complexity of the

hardware needed to decode longer codes increases enormously. Examples of

Block codes are Hamming codes, Hadamard codes, and Golay codes.

Hamming Codes: A good example of Block codes with the special property

given below are the Hamming codes.

Block length 1 2 −

m

n

Number of message bits 1 2 − − m k

m

Hamming distance min

H

d = 3

For some integer 3 ≥ m

24

Some valid Hamming codes are:

N 7 15 31 63 127 255 511 1023 2047 4095 8191 16383 32767

K 4 11 26 57 120 247 502 1013 2036 4083 8178 16369 32752

M 3 4 5 6 7 8 9 10 11 12 13 14 15

Consider the example of a (7,4) Hamming code. Since ) 4 , 7 ( ) , ( k n the last

condition of 2 ≥ m is satisfied 1 2 7 −

m

n so 3 m

4 1 2 − − m k

m

Code rate 7 / 4 / n k Rc

Example of (7,4) Hamming Code Correcting an error

Here is a listing of Code words for a (n,k) = (7,4) Hamming code.

Message Word Code Word

0000 0000000

0001 1010001

0010 1110010

0011 0100011

0100 0110100

0101 1100101

0110 1000110

0111 0010111

1000 1101000

1001 0111001

1010 0011010

1011 1001011

1100 1011100

1101 0001101

1110 0101110

1111 1111111

Table 3.1 Code Words for (7,4)

Syndrome Error Pattern Error in bit

position

000 0000000 No errors

100 1000000 1

010 0100000 2

001 0010000 3

110 0001000 4

011 0000100 5

111 0000010 6

101 0000001 7

Table 3.2 Decoding Table

25

Now say we transmit a [1110010] and receive r [1100010] instead. We

realize by inspection that bit 3 is wrong. The error correction circuit needs to do

this via the algorithm as follows.

The syndrome vector s is calculated from

T

rH s

In the syndrome table Table 3.2 above the matrix

H

T

Is known and so [ ] ] 001 [

101

111

011

110

001

010

100

1100010

]

]

]

]

]

]

]

]

]

]

]

,

,

,

,

,

,

,

,

,

¸

,

s , so we look for the error pattern for the

syndrome [001] in Table 3.2 and it is [0010000] which tells us that bit 3 is in

error. To correct the error we add the received vector to the error pattern and

get the corrected vector.

Received vector: 1100010

Error Pattern: 0010000

Corrected vector 1110010 (which is the same as the

original transmitted vector).

Since we can correct only 2 / ) 1 ( min− ≤

H

d t errors, for Hamming codes min

H

d = 3

so 1 2 / ) 1 3 ( 2 / ) 1 ( min − −

H

d we can only correct 1 bit error.

26

Chapter 4 DATA MODULATION & DEMODULATION

Section 4.1 Discrete Data Transmission

A Discrete data transmission system involves transmission of one of a finite set

of messages over a communication channel. The message source generates

messages m

i

which are binary bits, and wants to communicate with the message

sink at the receiver. Refer to Figure 4.1. The source must select which of the

allowed messages in a finite set that the transmitter sends over the

communication channel. The receiver must determine the message sent

(estimate m ) and provide it to the message sink.

Figure 4.1 Vector Model of Communication System

Encoding is the process of converting the messages from their raw form as bits

into vectors of real numbers that represent the messages. A vector encoder

converts each message m

i

into a symbol x

i

, which is a real vector (in signal

space).

Message

Source

Vector

Encoder

Modulator

Channel

Message

Sink

Vector

Detector

DeModulator

m

i

mˆ

x

i

(t)

xi

Symbol

y(t)

y

Transmitter

Receiver

27

Modulation is a procedure for converting the encoder output vectors into analog

waveforms for transmission over a physical channel. The modulator converts

the symbol vector x that represents the selected message into a continuous time

(analog) waveform that the transmitter outputs into the channel. There is a set of

possible M signal waveforms x

i

(t) that is in direct one-to-one correspondence

with the set of M messages. In general the conversion of a discrete data

signal into a continuous time analog signal is called digital modulation.

The Demodulator converts continuous time channel output signals back into a

channel output vector y, from which the detector estimates x and thus also the

message sent. This estimate from the detector is m .

In the transmission of digital information over a communication channel, the

modulator is the interface device that maps the digital information into analog

waveforms that match the characteristics of the channel. The mapping is

performed by taking blocks of M k 2 log binary digits at a time from the

information sequence } { n a and selecting one of M waveforms for transmission

over the channel.

When the mapping from the digital sequence } { n a to waveforms is performed

under the constraint that a waveform transmitted in any time interval depends on

one or more previously transmitted waveforms the modulator is said to have

memory otherwise if the mapping is symbol by symbol then it is called memory-

less.

Section 4.2 Introduction to Linear Modulation Methods

In analog modulation the information bearing signal is impressed onto a carrier

frequency by modulating either the carrier amplitude (amplitude modulation –

AM) or the carrier phase (Phase modulation – PM), or the carrier frequency

(frequency modulation – FM).

In digital modulation the modulator maps the sequence of binary digits into a

corresponding set of discrete amplitudes (PAM), or a set of discrete phases

(PSK), or a set of discrete frequencies (FSK). See Figure 4.2 for an example of a

binary PAM message signal, its FSK version and then its PSK signal.

The output of the carrier modulator is a passband signal that can be represented

as follows:

} ) ( Re{ ) (

2 t f j c

e t v t s

π

eqn 4.1

Where c f is the carrier frequency and ) (t v is the baseband information-bearing

signal. The term passband and bandpass are used interchangeably but I prefer

the consistency in using passband for carrier modulated and baseband for

signals that include 0 hz.

28

The signal waveform ) (t v depends on the method by which the binary information

sequence is mapped into either the set of discrete amplitudes or discrete phases

or discrete frequencies.

Figure 4.2 PAM Signal, FSK, & PSK

29

PAM

If the modulator maps the binary information sequence into discrete amplitudes

then the method is called digital pulse amplitude modulation (PAM) or amplitude

shift keying (ASK).

The signal waveform is then,

} ) ( Re{ ) (

2 t f j

m m

c

e t u A t s

π

M m ,..., 2 , 1 eqn 4.2

Where } ,..., 2 , 1 , { M m Am are the M possible signal amplitudes corresponding to

the

k

M 2 possible k bit blocks or symbols. ) (t u is a real valued signal pulse

whose shape constitutes a signal design problem when there is a band limited

channel.

Suppose the bit rate is R bits/sec then the symbol rate is k R/ . The symbol rate

is the rate at which changes occur in the amplitude of the carrier to reflect the

transmission of new information. The signal space diagram of PAM is shown in

Figure 4.3 for M =2, 4 and 8. Note that this is a one-dimensional modulation

scheme.

Figure 4.3 PAM Constellation

30

Digital PAM can also be used for transmission over a channel that does not

require carrier modulation. In this case the signal waveform is simply

) ( ) ( t u A t A m m M m ,..., 2 , 1 eqn 4.3

Since there is no carrier this is called a baseband signal. Figure 4.4 illustrates

the concept graphically and shows a baseband PAM and the carrier modulated

version of the same signal as a passband PAM signal is shown in Figure 4.5

The PAM carrier modulated signal (eqn 4.2) } ) ( Re{ ) (

2 t f j

m m

c

e t u A t s

π

is a double

sideband (DSB) signal and requires twice the channel bandwidth of the

equivalent lowpass signal for transmission. There is a single sideband (SSB)

PAM that is given by

} )] ( ˆ ) ( [ Re{ ) (

2 t f j

m m

c

e t u j t u A t s

π

± M m ,..., 2 , 1

And uses half the bandwidth of the DSB version. ) ( ˆ t u denotes the Hilbert

transform of ) (t u .

Figure 4.4 Base Band PAM

31

Figure 4.5 Pass Band PAM

PSK

When you modulate the phase of a carrier the modulation scheme is known as

Phase Shift Key (PSK) and this was shown in Figure 4.2 for M=2. Because the

range of the carrier phase is π θ 2 0 ≤ ≤ , the phase of each of the M symbols is

M k k / 2π θ where 1 ,..., 1 , 0 − M k . This is shown in Figure 4.6 for M 2, 4, and

8. When 4 M the phase difference works out to 90 and this is called QPSK.

PSK is a 2 dimensional modulation scheme.

Figure 4.6 PSK

Figure 4.7 QPSK Waveform

32

The QPSK waveform is shown in Figure 4.7 where T is the symbol period.

Abrupt changes in phase may seem like mathematical absurdities but these

phase changes are actually continuos but very rapid. They are always shown as

abrupt in textbooks.

QAM

QAM modulates the phase and the amplitude of the carrier. The bandwidth

efficiency of PAM/SSB can also be obtained by simultaneously impressing two

separate k bit symbols from the sequence } { n a on two quadrature carriers

t fc π 2 cos and t fc π 2 sin . The resulting modulation technique is called quadrature

PAM or QAM (quadrature amplitude modulation). The signal waveforms are

} ) ( ) Re{( ) (

2 t f j

ms mc m

c

e t u jA A t s

π

+

t f t u A t f t u A c ms c mc π π 2 sin ) ( 2 cos ) ( − M m ,..., 2 , 1 eqn 4.4

where mc A is the signal amplitude modulated by the cosine carrier and ms A is the

signal amplitude modulated by the sine carrier. To see why eqn 4.4 is a phase

and amplitude modulation scheme we can re-write eqn 4.4 as

) 2 cos( ) ( } ) ( Re{ ) (

2

m c m

t f j j

m m t f t u V e t u e V t s

c m

θ π

π θ

+ eqn 4.5

where

2 2

ms mc A A Vm + and

mc

ms

m

A

A

1

tan

−

θ

From eqn 4.5 it is apparent that QAM signal waveforms are a form of combined

amplitude and phase modulation. QAM is a 2 dimensional modulation scheme.

Figure 4.8 shows various QAM constellations and how many bits are needed to

modulate the data. In Figure 4.10 several different signal space diagrams for

QAM are shown for M = 4, 8, 16, 32 and 64. The phase angle m θ for each

constellation (M) can be calculated from

M

m

m

) 1 (

2

−

π θ M m ,..., 2 , 1 eqn 4.6

where M is the total number of signal points in two dimensional space. So in the

case of 64 QAM, 6 bits are used to map into the 64 possible symbols. In other

words, 1 symbol takes 6 bits to represent. Furthermore, 2 of these six bits are

used to decode the quadrant (1

st

, 2

nd

, 3

rd

, 4

th

). As shown in Figure 4.13 the first

two bits (bits 5,4) in the six bit symbol are used to decode the quadrant and the

next four bits (bits 3,2,1,0) are used to find which symbol within that quadrant

was transmitted.

33

“Constellations”

Figure 4.8 QAM Constellations

Figure 4.9 Modulated Waveforms

QPSK (=4-QAM)

1 symbol ➛ 2

bits

2

16-QAM

1 symbol ➛ 4

bits

4

256-QAM

1 symbol ➛ 8

bits

8

6

64-QAM

1 symbol ➛ 6

bits

6

6

34

Figure 4.10 Rectangular QAM

Section 4.3 QAM Schematic

The schematic of a QAM modulator is shown in Figure 4.11 and the

Demodulator is shown in Figure 4.12.

Figure 4.11 Qam Modulator

35

Figure 4.12 Qam Demodulator

36

Figure 4.13 64-QAM Bit Assignment

Section 4.4 Probability of Error in QAM

Noise in the channel causes the received signal to be distorted and can lead to

erroneous decoding in the demodulator. The signal constellation in a noisy QAM

system is depicted in Figure 4.15. The calculation of probability of a symbol

error is based on a PAM system which extends easily into the rectangular

constellation based on quadrature carriers. If the constellation is not

rectangular you cannot use the following equations. For rectangular

constellations in which

k

M 2 where k is even the QAM signal constellation is

equivalent to two PAM signals on quadrature carriers each having

2 /

2

k

M

signal points.

The starting point of this discussion is the probability of error in a PAM system

given by

) (

1

3

)

1

1 ( 2

o

av

N

E

M

Q

M

P M

−

− eqn 4.7

and the above is related to the probability of correct decision in a M-ary QAM,

c P as follows:

37

2

) 1 ( M P Pc − eqn 4.8

where M P is the probability of a symbol error in ary M PAM with

2

1

the

average power in each quadrature signal of the equivalent QAM system. Since

the probability of making a wrong decision is 1 – probability of making the correct

decision,

2

) 1 ( 1 1 M P Pc PM − − − eqn 4.9

Substituting eqn 4.7 into eqn 4.9

2

] [ ) (

1

3

)

1

1 ( 2 1 1

o

av

M

N

E

M

Q

M

P

−

− − − eqn 4.10

where

M P probability of symbol error in QAM M-ary

M # of symbols

o

av

N

E

SNR, signal energy/noise energy

) ( Q erf function which can be calculated using a table or solved in

MathCad using Q(x) = 1 – pnorm(x,0,1).

This is the exact form of the probability of error in a QAM system.

Now eqn 4.10 is exact for even k but if odd k in

k

M 2 we have no

equivalent ary M PAM system. So for odd k we calculate an upper bound on

M P .

2

)] ( [

1

3

2 1 1

o

av

M

N

E

M

Q P

−

− − ≤ with the simplification 1 )

1

1 ( ≈ −

M

, this has

the effect of overestimating M P so it is okay to do so,

)] ( 4 ) ( [

1

3

1

3

4 1 1

2

o

av

o

av

M

N

E

M

Q

N

E

M

Q P

− −

− − ≤ +

) ( 4 ) (

1

3

1

3

4

2

o

av

o

av

M

N

E

M

Q

N

E

M

Q P

− −

≤ −

Further simplification ) ( ) ( 4 ) (

1

3

4

1

3

1

3

4

2

o

av

o

av

o

av

N

E

M

Q

N

E

M

Q

N

E

M

Q

− − −

≈ −

gives

) (

1

3

4

o

av

M

N

E

M

Q P

−

≤ for odd k eqn 4.11

38

Figure 4.14 P

M

vs SNR for QAM & PSK

Figure 4.15 Noisy Signal Constellation

The probability of error for various modulation schemes is shown in Figure 4.14

Return to Table of Contents TOC

39

Chapter 5 Cable Modem Introduction

Section 5.1 Definition of Cable Modem

Cable Modem

A cable modem is a high-speed device for digital transmission of bits over a

coaxial cable. A simple-minded view is as a modulator (at the transmitting end)

and a demodulator (at the receiving end). Actual implementation involves many

other blocks and will be covered in detail later.

A cable modem as the term applies today is a very high-speed modem for

Internet access over a cable CATV present in a lot of homes in the USA today.

Contrasted with the kind of modem we are used to talking about in the context of

telephone line modems which are very slow indeed, called POTS modem for

Plain Old Telephone Modem. The term Cable modem has since the initial

writing of this project changed its meaning and it was intended to refer to a high-

speed video modem. Perhaps I should have chosen the title "Video Modem

design". However in this project the term Cable modem refers to modems

used in digital cable-TV set-top boxes whose FEC (Forward Error Correction)

is compliant with the IEEE802.14 (not released yet). Other standards that may

apply are the European DVB-C standards (Digital Video broadcasting) and the

DAVIC standard (Digital Audio-Visual Council) which is also a European

standard. Due to the availability of the IEEE802.14 in draft form this design

concerns mostly with this standard. It is hoped that this standard will be adopted

and companies can begin competing in the video modem arena.

Section 5.2 Structure of Cable systems

The basic structure of a cable system is a simple one (see Figure 5.1).

There are five major parts to a cable system:

1.the headend,

2.the trunk cable,

3.the distribution (or feeder) cable in the neighborhood,

4.the drop cable to the home and in-house wiring, and

5.the set-top box equipment (consumer electronics).

The head end is the source in a central facility that broadcasts signals onto the

cable network. The head end gathers signals from various sources such as

satellite dishes and high-gain antenna.

40

Figure 5.1 Cable Network

The trunk network is made of a larger coax and in fact today an optical fiber is

used for this. This combination is called a hybrid fiber coax (HFC) shown in

Figure 5.2 and in a broader context of networks in Figure 5.3. When a coax is

used in the trunk the signal needs to be amplified every two thousand feet

because of loss (especially at high frequencies). This trunk amplifier in the case

of an analog signal adds noise. Optical transmission of digital data (fiber) can go

much longer before requiring re-amplification. This simplifies the trunk

architecture and reduces the noise that is introduced. For the same length of

coax cable and fiber, coax can have 500 times more attenuation than the fiber.

The distribution network is coax and is bridged off the trunk. The distribution

network is the “neighborhood network” and amplifiers here are called line

extenders. The subscriber drop line is taken from the distribution network by

tapping the line and is no more than 150-200ft. This tap is at the curb usually

inside an underground service box. Here is the surprising part. Where does the

power for the amplifiers come from? Answer: from the cable itself! A 60V, 60Hz

ac current is sent over the trunk cable (of course this is not possible if the trunk is

fiber) and is taken to the trunk amplifiers. Power is not carried beyond the

distribution networks into the subscriber drop. At times the power is taken from a

telephone pole transformer and fed into the cable midway and this is why cable

41

service may be interrupted during a power failure in a certain neighborhood even

when the Cable Company has emergency generators.

Figure 5.2 Hybrid fiber/coax network

42

Figure 5.3 HFC Network

43

CATV stands for Community antenna television. It was first built in 1948 by Ed

Parson of Astoria, Oregon. It consists of a copper-clad steel center conductor

inside an insulating foam dielectric material surrounded by a braided wire and/or

metal foil. Finally a plastic sheath protects the contents from damage, see Figure

5.4 and Figure 5.8. The characteristic impedance of this cable is 75Ω. Cable

does have a high loss and it depends on the frequency of interest. The logarithm

of the attenuation of cable (db) varies with the square root of the frequency. So

the attenuation at 216Mhz (channel 13) is twice that of 54Mhz (channel 2) since

the frequency is four times as great. If channel 2 is attenuated 10db in 1000ft

then channel 13 will be attenuated 20db (see Figure 5.5). For the frequency

response of a drop cable see Figure 5.6 and for that of a trunk cable see Figure

5.7. It can be seen that the trunk cable has a higher performance than the drop

cable. The graphs show the attenuation for a 100ft-length cable over various

frequencies.

Figure 5.4 Coaxial Cable

Figure 5.5 FCC Frequency Allocation

44

Figure 5.6 Drop Cable Frequency Response

Figure 5.7 Trunk Cable Frequency Response

1 10 100 1 10

3

0.1

1

10

Drop Cable

Frequency (Mhz)

A

t

t

e

n

u

a

t

i

o

n

(

d

b

/

1

0

0

f

t

)

1 10 100 1 10

3

0.1

1

10

Trunk Cable

Frequency (Mhz)

A

t

t

e

n

u

a

t

i

o

n

(

d

b

/

1

0

0

f

t

)

45

Section 5.3 Cable Specifications

TRUNK CABLE SPECIFICATIONS courtesy of CommScope

©

.

Figure 5.8 Trunk Coax Construction

46

47

DROP CABLE SPECIFICATIONS

Cable type Characteristic Impedance Used In

RG-58/U 53.5 Ω Ethernet (but not

recommended due to

improper shielding)

RG-58A/U or RG-

58C/U

50 Ω 10 Base2 CSMA/CD (Thin

wire Ethernet)

RG-59/U 75 Ω CATV (cable TV)

RG-62/U 93 Ω IBM 3270 terminals,

ARCnet

RG stands for radio guide as the cable guides radio frequency signals. The /U

means general utility.

48

49

Figure 5.9 FCC Frequency Detail

50

Section 5.4 Baud, Bit-rate, Modem Speed

The units can be confusing to a new comer so here is a quick summary. Data

rate refers to the rate at which bits are transmitted over the physical medium.

The unit of data rate or bit rate is bits/sec. Modulation rate refers to the rate at

which the symbols are transmitted over the physical medium. The unit of

modulation rate (also called signaling rate) is baud or symbols/sec.

A symbol is a unique state of the communication channel, distinguishable by the

receiver from all other possible states. For example, it may be one of two voltage

levels on a wire for a direct digital connection or it might be the phase or

frequency of a carrier or a unique combination of phase and amplitude (QAM).

The term "baud" was originally a unit of telegraph signaling speed, set at one

Morse code dot per second. Or, more generally, the reciprocal of the duration of

the shortest signaling element. It was proposed at the International Telegraph

Conference of 1927, and named after J.M.E. Baudot (1845-1903), the French

engineer who constructed the first successful teleprinter.

Comparison of speed of transferring a 10-Megabyte file over different modems:

MODEM SPEED / TYPE

TRANSFER TIME

9.6-Kbps Telephone Modem 2.3 hours

14.4-Kbps Telephone Modem 1.5 hours

28.8-Kbps Telephone Modem 46 minutes

56-Kbps Telephone Modem 24 minutes

128-Kbps ISDN Modem 10 minutes

1.54-Mbps T-1 Connection 52 seconds

4-Mbps Cable Modem 20 seconds

10-Mbps Cable Modem 8 seconds

30-Mbps Cable Modem 2.7 seconds

POTS modems are modems used for modulating digital data inside a computer

onto an analog phone line. The symbol rate (called Baud or loosely Baud rate) is

about 3000 Baud. The relationship between Baud and bits-per-sec depends on

the number of bits used to make up a symbol.

In 64 QAM which is one of the modulation schemes in the downstream Digital

Video DVB-C standard and IEEE802.14, it takes 6 bits to make up a symbol. So

the relationship between bits per sec (bps) and Baud (symbols/sec) is

Baud bits

bps

Baud

/ 6

For 64 QAM

Example: If we are using a 64 QAM modulation scheme and we have 27 Mbps

then it translates into MBaud

Baud bits

Mbps

5 . 4

/ 6

27

, or 4.5x10

6

Baud

51

A Digital TV channel bandwidth is 6Mhz (based on the current analog NTSC

allocation). This 6Mhz bandwidth can accommodate 36 Mbps under the adopted ATSC

standard for digital TV. Audiovisual signals with standard resolution can be compressed

using MPEG-2 to sustainable rates of around 6 Mbps, so around 4 digital TV channels

can be safely supported in a single channel without congestion. This is great news for the

FCC as they can sell more channels in the same space.

Section 5.5 Digital TV Standards

HDTV

Current TV sets display 480 lines of information with the 240 odd-numbered lines

being scanned from top to bottom first and then the 240 even-numbered lines

are scanned next. This gives the present TV its flicker and is called the

interlaced format. Each set of odd and then even lines is scanned 30 times a

sec. The aspect ratio of today's TV sets is 4:3. Computer monitors on the other

hand use 480 lines and display all 480 lines from top to bottom without

interlacing. This is called progressive format. This is why computer monitor

pictures appear sharper. Also, the minimum frames per sec are 60fps or up to

85fps in some high-end monitors. High definition TV changes all that. HDTV

uses 1080 interlaced lines or 720 progressively scanned lines on a 16:9 aspect

ratio screen. HDTV will contain seven times more information than what today's

format allows.

The FCC has allocated the 6 Mhz band into several channels and "lent" each

station an additional channel so that they may transmit both NTSC and digital

signals until the year 2006 at which time they must "return" the analog channel

bandwidth to FCC. Most stations in the Bay area are going to transmit some

digital channel by Nov 1999.

SDTV

This is HDTV in a standard resolution comparable to the existing standard but of

course digital i.e. 480 lines progressive scanning. SDTV stands for Standard

Definition Television.

MPEG-2

Compression standard for moving images conceived by the Motion Pictures

Expert Group, an international group of industry experts set up to standardize

compressed moving pictures and audio. This removes redundancy in the

digitized picture matrix by using Discrete Cosine transforms. The analog

bandwidth from a HDTV camera consists of something like 30Mhz each of red,

blue, and green colors. That’s nearly 100Mhz of analog signal and would require

more than a gigabit (10

9

bits) per second of straight digital transmission if no

compression was used. With compression these bit rates can be in the 27x10

6

bits/s range.

A little history is in order. In 1988 the process of creating a universal audio and

video compression standard was started by the Motion Pictures Expert Group. In

52

1990 the MPEG-1 standard was derived. This standard is already being used in

the VideoCD and CD-I products. The MPEG-2 is a more advanced standard

supporting higher picture resolutions for HDTV and DVD (Digital Video Disk).

Other competing standards are Indeo, Quicktime and Cinepack. To ensure the

support of many different equipment and chip vendors, the standard does not

define a standard encoder or decoder, but only the coded bit-stream. The MPEG

standard also has a major drawback. Because of the many available bit-rates,

frame-rates and resolutions in the MPEG standard, the MPEG hardware vendors

choose to support only a few of those different bit-rates, frame-rates and

resolutions necessary for specific applications. These different solutions are not

interoperable, so in order to create one standard for many different applications,

many different standards are created with one common name: MPEG.

Modulation Methods

Two main competitors are Quadrature amplitude modulation (QAM) and Vestigial

sideband (VSB) modulation. A 16-VSB system tested by ATTC (Advanced

Television Test Center) delivered 38.5 Mbps. Cable companies are deploying

64-QAM (with 27 Mbps) because it maps one 27 Mhz satellite transponder

capacity in one 6 Mhz channel (allocated by FCC). Everyone must work within

the 6 Mhz bandwidth allocated.

Section 5.6 Overview of transport subsystem

There are several transport methods. One way is to use the ATM network and is

supported in the IEEE802.14. The MPEG-2 compressed signal rides on a mass

transit-like system already developed for ATM networks. This is called the

Packet Transport. It is illustrated in Figure 5.10. The organization of a digital

television transmitter-receiver pair and the location of the transport subsystem in

the overall system is shown in Figure 5.11. The transport resides between the

application (e.g., audio or video) encoding/decoding function and the

transmission subsystem. At its lowest layer, the encoder transport subsystem is

responsible for formatting the encoded bits and multiplexing the different

components of the program for transmission. At the receiver, it is responsible for

recovering the bit streams for the individual application decoders and for the

corresponding error signaling.

The data transport mechanism is based on the use of fixed-length packets that

are identified by headers. Each header identifies a particular application bit

stream (also called an elementary bit stream), which forms the payload of the

packet. Applications supported include video, audio, data, program and system

53

control information, etc. The elementary bit streams for video and audio are

themselves wrapped in a variable-length packet structure called the packetized

elementary stream (PES) before transport processing. The PES layer provides

functionality for identification, and synchronization of decoding and presentation

of the individual application.

Figure 5.10 Transport packet format

Figure 5.11 Transmitter-Receiver for Digital Television

54

Section 5.7 MPEG-TS Transport Stream

The preferred method for video is to use the MPEG2-TS framing structure and

not use the ATM format. The TS stands for transport stream. The IEEE802.14

supports both formats. The MPEG2-TS framing is shown in Figure 5.12. The

first octet (byte=8bits) is the SYNC field used to recognize the beginning of the

transport stream. The next field is 1 bit TEI and shows the mpeg decoder if the

entire packet has an error. The next bit is PUSI (payload unit start indicator) and

is reserved for future use. The next bit is TP (transport priority) and can be used

in giving some packets higher priority. The next 13 bits are the program id (PID)

and is set to 0x1FFD. The next 2 bits are TSC (transport scrambling control)

which is 00 for now (reserved). The next two bits are AFC (adaptation field

control) which is not discussed at all in the IEEE802.14 spec. The next four bits

are CC (continuity counter) which keeps the packet identified with the program

id. This too is poorly understood and not described in the spec. Finally the

payload! The next 184 octets (1472 bits) are used to deliver the payload (video

data). So a total of 1504 bits are used to make up an MPEG2-TS packet.

Figure 5.12 MPEG-2 Frame

55

Section 5.8 Set-Top Boxes

Basic Analog Boxes

Today set-top boxes in homes are analog and the RF signal coming in is

demodulated to recover the analog signal. Key components in a basic analog

set-top box include an RF tuner, mixed-signal demodulator for intermediate-

frequency (IF) processing, and a descrambler chip. There are audio/video

amplifiers and a standard UHF channel modulator to communicate with the

NTSC television set. Most boxes also have 8-bit controllers and associated

memory for internal and remote control functions.

Analog-Addressable Interactive Boxes

A great deal of development activity is currently focused on analog-addressable

interactive set-top boxes. These set-top boxes have a return channel to the

CATV head-end station. This return channel enables subscribers to obtain a

variety of services at their fingertips, including pay-per-view programs, online

program guides, bulletin boards, and other online services such as stock quotes,

sports scores, weather and home shopping. The return channel uses

Quadrature Phase Shift Keying (QPSK) or Frequency Shift Keying (FSK)

demodulation techniques.

Low-End Interactive Digital Boxes

At the present time it seems that most digital set-top (ST) boxes will be used for

satellite transmission. However there are companies developing Digital ST

boxes for CATV. These ST boxes will utilize MPEG-II decompression

technology to increase the number of channels possible. Digital audio will range

from CD-quality in the low-end box to Dolby surround sound quality in the high-

end boxes. In the satellite ST box demodulation will be done with QPSK and in

CATV boxes it will be QAM or Vestigial Sideband (VSB). VSB is a proprietary

standard backed by Zenith. QAM is still an open standard for the cable industry

promoted by a number of set-top box manufacturers such as General

Instruments.

The decompressed (MPEGII) video and audio signal has to be up converted to

NTSC (or PAL, SECAM) for today's television, as the true digital television

receiver has not yet arrived. The return channel is similar to the analog

addressable ST box, except in the case of satellite ST box which uses a

conventional telephone modem. The CATV return channel will be about 100K

bps.

56

High-End Interactive Digital Boxes

High-end interactive digital boxes are strictly for CATV at the moment. They will

be capable of displaying 3-D graphics. A RISC or CISC microprocessor with

16Mbytes of RAM will be common. The return channel will be similar to the Low-

end interactive digital boxes, i.e. using QPSK or FSK (in some cases), but with

transmission rates of 1.5 Mbps. These boxes will have flexible and upgradeable

features since they have microprocessors and software in them.

Figure 5.13 Digital Video Standards

57

Glossary of terms

ATSC ATSC: Advanced Television Systems Committee. Formed to establish

technical standards for advanced television systems, including digital

high definition television (HDTV). Internet: http://www.atsc.org/

AC3 Dolby Digital (formally Dolby AC-3, now also Dolby D): The approved 5.1

channel (surround-sound) audio standard for ATSC digital television,

using approximately 13:1 compression. Six discreet audio channels are

used: Left, Center, Right, Left Rear (or side) Surround, Right Rear (or

side) Surround, and a subwoofer. The bit rate can range from 56 Kbps to

640 Kbps.

When moving from analog recording to a digital recording medium, one

finds that the digital audio coding used yields an amount of data too

immense to store or transmit economically, especially when multiple

channels are required. As a result, new forms of digital audio coding-

often known as "perceptual coding"-have been developed to allow the

use of lower data rates with a minimum of perceived degradation of

sound quality.

Dolby's third generation audio coding algorithm (originally called AC-3) is

such a coder. This coder has been designed to take maximum

advantage of human auditory masking in that it divides the audio

spectrum of each channel into narrow frequency bands of different sizes,

optimized with respect to the frequency selectivity of human hearing.

This makes it possible to sharply filter coding noise so that it is forced to

stay very close in frequency to the frequency components of the audio

signal being coded. Reducing or eliminating coding noise wherever there

are no audio signals to mask it can subjectively preserve the sound

quality of the original signal. In this key respect, a coding system like

Dolby Digital is essentially a form of very selective and

Powerful noise reduction.

CATV Community antenna television.

DAVIC Digital Audio-Visual Council

DCT Discrete Cosine Transform. A widely used method of data compression

of digital video pictures basically by resolving blocks of the picture

(usually 8 x 8 pixels) into frequencies, amplitudes, and colors. JPEG and

DV depend on DCT.

DSS Digital satellite system. An alternative to cable and analog satellite

reception initially utilizing a fixed 18-inch dish focused on one or more

geostationary satellites. DSS units are able to receive multiple channels

of multiplexed video and audio signals as well as programming

information, Email, and related data. DSS typically uses MPEG-2

encoding.

DVB Digital Video broadcasting (European)

DVB-C Digital Video broadcasting for Cable

58

HDTV High definition television. Typically 1,125-, 1,080- and 1,035-line

interlace and 1,080-line progressive formats in a 16:9 aspect ratio.

Officially a format is high definition if it has at least twice the horizontal

and vertical resolution of the standard signal being used. There is a

debate as to whether 720-line progressive is also high definition.

JPEG Joint Photographic Experts Group. ISO/ITU-T. JPEG is a standard for

the data compression of still pictures (intrafield). In particular its work has

been involved with pictures coded to the ITU-R 601 standard. JPEG

uses DCT and offers data compression of between two and 100 times

and three levels of processing are defined: the baseline, extended and

"loss less" encoding.

MPEG Compression standards for moving images conceived by the Motion

Pictures Expert Group, an international group of industry experts set up

to standardize compressed moving pictures and audio. Four MPEG

standards were originally planned but the accommodation of HDTV

within MPEG-2 has meant that MPEG-3 is now redundant. . The main

interest for the television industry is in MPEG-1 and MPEG-2.

MPEG-1 MPEG-1: A group of picture blocks, usually four, which are analyzed

during MPEG coding to give an estimate of the movement between

frames. This generates the motion vectors that are then used to place

the macroblocks in decoded pictures. This was designed to work

at 1.2 Mbits/sec, the data rate of CD-ROM, so that video could be played

from CDs. However the quality is not sufficient for TV broadcast.

MPEG-2 MPEG-2 is the basis for ATSC digital television transmission.

Its work follows on from that of JPEG to add interfield compression, the

extra compression potentially available through similarities between

successive frames of moving pictures.

MPEG4 MPEG-4 is intended for unrelated applications, however can be used to

display ATSC formats on a PC

NTSC National Television Standards Committee

QAM Quadrature Amplitude Modulation

QPSK Quadrature Phase Shift Key

SMPTE Society of Motion Picture and Television Engineers. A professional

organization that sets standards for American television.

http://www.smpte.org

Return to Table of Contents TOC

59

Chapter 6 Modem Design

Section 6.1 Basic Modulator

To understand the demodulator one must first understand the modulator basics.

The modulator described here will accept a data stream (bit stream) with a

symbol rate equal to B (standing for baud) and will output a modulated QAM

signal centered at an IF (intermediate frequency) equal to the symbol rate or

twice the symbol rate (B or 2B). A typical application would be a 5 MBaud (5

million symbols per second) 64 QAM modulator for a digital television

transmitter. The modulator will Nyquist filter (pulse shape) the QAM signal, mix it

up to be centered at either 5 MHz or 10 MHz (digital sine/cosine generator), D/A

convert it and output an analog signal ready to be mixed up to a final radio

carrier frequency of several hundred megahertz.

Figure 6.1 Basic Modulator

The basic functions of a QAM modulator are shown in Figure 6.1: The bit stream

is formatted into symbols consisting of In-phase (I) and Quadrature (Q) words. A

64-QAM symbol uses 6 input bits per symbol, 3 bits for the I and 3 bits for the Q.

The I and Q values for 64 QAM are ±1, ±3, ±5 and ±7. The symbols are zero

padded to generate a data stream at the desired sample rate for the final digital

to analog converter (DAC). The desired sample rate is a function of the IF signal

frequency and its bandwidth. If the excess bandwidth of the Nyquist filter is α ,

and the IF signal’s center frequency is F, then the DAC frequency must be at

least twice (F + (1+α )B/2). This means that the DAC frequency must be

greater than (2F + (1+α )B). If the IF is centered at the symbol rate B, then a

DAC frequency of 4B is adequate. If the IF center frequency is 2B, then a DAC

frequency of 8B is needed. If the DAC frequency is chosen as 4B, then the zero

pad circuit must insert 3 zeroes between each symbol. If the DAC frequency is

8B, then 7 zeroes must be inserted between each symbol. The pulse shape filter

is typically the raised cosine pulse defined in eqn 6.1 below.

FORMAT

INTO

SYMBOLS

ZERO PAD

ZERO PAD PULSE SHAPE

FILTER

PULSE SHAPE

FILTER

DIGITAL

SIN/COS OSC

D/A

BIT

STREAM

IN

IF

SIGNAL

OUT

I

Q

(IF=5

Mhz)

CLOCK

SYNTHESIZER

30

Mbps

30 Mhz

=(6bitsx5Mhz)

FDAC=20 Mhz =(4 x 5Mhz)

Mixer

20

Mhz

20

Mhz

60

(

(

(

(

(

,

\

,

,

,

,

,

(

j

(

,

\

,

(

j

−

(

,

\

,

(

j

(

(

(

(

,

\

,

,

,

,

(

j

(

,

\

,

(

j

2

2

1

cos sin

) (

s

s

s

s

T

t

T

t

T

t

T

t

t p

α

απ

π

π

eqn 6.1

Where α sets the excess bandwidth of the pulse and T

s

is the symbol time

spacing and baud rate B = 1/T. If the DAC frequency is 4B, then the pulse filter

will use the impulse response h(k) = p(kT/4) for k = -N to +N. The length of the

filter is 2N+1. The value of N, and hence the length of the filter, is set so that the

value of p(t) in eqn 2.1 is sufficiently close to zero for k > N. If the DAC frequency

is 8B, then h(k) = p(kT/8). Typically N is less than 30 for a DAC frequency of 4B

and is less than 60 for a DAC frequency of 8B. The I/Q signal coming from the

pulse shape filters is mixed up to the desired IF center frequency as shown in

Figure 6.1. The real part of the mixer output is retained and sent to the DAC. A

lowpass filter smoothes the DAC output. The lowpass filter’s passband extends

from 0 to (F + (1+α )B/2) and its stop band starts at F

DAC

- (F + (1+α )B/2)

Figure 6.2 Low Pass Filter

DAC frequency F

DAC

is calculated on the next page for our case.

F+(1+α )B/2 FDAC – F-(1+α )B/2

61

If the DAC frequency is 4B and the IF is B, or if the DAC frequency is 8B and the

IF is 2B, then the mixer frequency is

n j

e

4

π

which is simply the sequence (1, j, -1, -

j,...). This means that the mixer only needs to make sign changes and to

multiplex between the I and Q filter outputs.

Three different raised cosine pulses are shown in Figure 6.4 , Figure 6.5, and

Figure 6.6 for 0 α , 0.5, and 1. The case of 0 α (0 excess bandwidth) is ideal

low pass, sin(x)/x response, the case of 5 . 0 α (50% excess bandwidth) is a

realistic filter with some trade-off between excess bandwidth and pulse rate. The

case of 1 α is called full cosine roll-off and the excess bandwidth is 100%. A

cable system uses typically 13 . 0 α (please see Figure 6.3 and Table 6.1).

Figure 6.3 Raised Cosine Pulse 13 . 0 α

p t ( )

10 5 0 5 10

0.5

0

0.5

1

DAC Frequency Rajat Sewal DAC_freq.mcd

α 0.13 F 5

IF center frequency (Mhz)

B 5

Baud rate (Mhz)

Dac_freq 2 F

.

1 α ( ) B

.

( ) Dac_freq 15.65 Mhz

so we can use 20 Mhz ie F

DAC

= 4B = 20 Mhz. Also

note that F=B

Low Pass Filter

Pass Band from 0 to (B+(1+α αα α)B/2 Stop Band starting at 3B-(1+α αα α)B/2

Pass_band B 1 α ( )

B

2

.

Pass_band 7.825 Mhz

Stop_band 3 B

.

1 α ( )

B

2

.

Stop_band 12.175 Mhz

62

Figure 6.4 Raised Cosine Pulse 0 α (ideal low pass)

Figure 6.5 Raised Cosine Pulse 5 . 0 α

Figure 6.6 Full Raised Cosine Pulse 1 α

p(t)

t

10 5 0 5 10

0.5

0

0.5

1

p t ( )

t

10 5 0 5 10

0.5

0

0.5

1

t

p t ( )

10 5 0 5 10

0.5

0

0.5

1

63

Section 6.2 Modem Specification

A video modem processing an MPEG2-TS stream has to be fast because it is

not only processing high-speed video data but also the overhead bits used in

synchronizing and other housekeeping tasks. This adds more demands on the

modem design. The symbol rate has to be in accordance with the IEEE802.14

standard (in development) and is 5.05Mbaud for 64 QAM. The architecture of a

64 QAM modem is shown in Figure 6.7. Because of its high bandwidth efficiency

quadrature amplitude modulation has become the established modulation

scheme for digital high-capacity modems.

Figure 6.7 QAM Architecture

The RF input (88Mhz to 860Mhz in USA) has several 6Mhz bandwidth channels

and is the cable input to the subscriber and carries digital RF modulated signals

which are down-converted (carrier is stripped off) and filtered by a SAW (surface

acoustic wave) filter in the tuner. A SAW filter is simply an analog version of a

FIR filter but is made from a piezoelectric material on a ceramic substrate. The

SAW filter performs a very sharp cut-off, low-pass filtering operation without

adding any noise. The only drawback is that it has some insertion loss, as it is a

passive device. It is kept away from any hot components to keep its Johnson

noise to a minimum. The output is then fed into an AGC circuit whose gain is

controlled by the output of the ADC (analog to digital converter). This allows the

ADC to have a good dynamic range as the input signal amplitude may vary

considerably. The ADC is a 10 bit fast sampling device and considerable design

effort goes into this component. One difficult part of the ADC design is that the

sampling FET introduces noise current as charge is rapidly pulled in and out of

its gate. The charge couples into the drain/source circuitry and results in errors

in the storage element. The FET has to be large to be able to switch quickly but

a large FET area means more gate to source/drain coupling. This conflicting

requirement has been a real challenge for design engineers and some clever

64

ways have been developed to try and reduce this effect. Another area of the

design that has been a challenge is controlling the phase jitter of the PLL driver

to the ADC sampling circuit. If the clock driving the PLL has jitter or the PLL

itself introduces jitter noise then the ADC sampling is in real trouble and the

accuracy of the ADC is effected directly. The sampling frequency of the ADC

depends on whether the IF frequency (Intermediate frequency) is centered at the

symbol rate B or twice the symbol rate, 2B. If the IF is centered around symbol

rate B then the ADC sampling is done at 4B, if the IF is at 2B then ADC sampling

is done at 8B.

The output of the ADC now contains the in-phase and quadrature components of

the baseband QAM modulated signal. These are demodulated by a cosine and a

sine wave signal generated by the symbol timing recovery circuits.

For high performance transmission equalization is necessary after the

demodulation to compensate for the dispersive fading of the transmission

channel (cable exhibits loss at high frequencies). The amount of computation

necessary in the tap coefficient updates (multiply and accumulate) far exceeds

the capabilities of programmable DSP chips (such as TI 320 series, Motorola

56000, Analog Devices 2600 series and Intel i860). These DSP chips

(processors) are good for up to 100K Baud. Above 100K Baud one must design

custom chips (ASICS) that are fully optimized for high computation rates to

support rates as high as 35 M Baud. The multiplier time using pipelined

multipliers that I have seen are 10ns. This level of performance requires

pipelining and large multipliers.

Recall that in the case of 64 QAM, 6 bits are used to map into the 64 possible

symbols. In other words, 1 symbol takes 6 bits to represent. Furthermore, 2 of

these six bits are used to decode the quadrant (1

st

, 2

nd

, 3

rd

, 4

th

). As shown in

Figure 4.13 the first two bits (bits 5,4) in the six bit symbol are used to decode

the quadrant and the next four bits (bits 3,2,1,0) are used to find which symbol

within that quadrant was transmitted.

The probability of error for a rectangular constellation is repeated here:

2

] [ ) (

1

3

)

1

1 ( 2 1 1

o

av

M

N

E

M

Q

M

P

−

− − − eqn 6.2

where

M P probability of symbol error in QAM M-ary

M # of symbols

o

av

N

E

SNR, signal energy/noise energy

) ( Q erf function which can be calculated using a table

The block diagram of a 64-QAM from National Semiconductor is shown in Figure

6.8 and it shows a more practical view down to the external input/output pins.

65

The demodulator is controllable from an external microprocessor via a serial

interface.

Figure 6.8 National Semiconductor-QAM Schematic

66

Section 6.3 IEEE802.14 Specification

The IEEE802.14 supports three physical layer (PHY) formats A, B and C as

shown in the table below.

PHY Type A PHY Type B PHY Type C (USA)

64QAM & 256 QAM 64QAM & 256 QAM 64QAM & 256 QAM

8 Mhz Channel BW 6 Mhz Channel BW 6 Mhz Channel BW

FEC is Reed Solomon FEC is RS for outer and

Trellis (TCM) for inner

symbols ie concatenated

FEC is Reed Solomon

Spectral roll-off 15 . 0 α Spectral roll-off

64QAM: 18 . 0 α

256QAM: 12 . 0 α

Spectral roll-off 13 . 0 α

Modulation rate:

6~6.952 Mbaud

64QAM: 5.05 Mbaud

256QAM: 5.19, 5.36

Mbaud

Modulation rate:

5.0 ~ 5.31 Mbaud

Table 6.1 PHY Formats

Figure 6.9 Type C PHY

Return to Table of Contents TOC

67

Chapter 7 Matlab Simulation

Section 7.1 Communication Tool Box

The modem is simulated using the Communication ToolBox of Matlab. The

communication toolbox from Matlab allows one to design a high level system

without having to design every single lower level function. A higher level of

abstraction gives the designer mobility in choosing various system parameters

and try out different scenarios in a shorter time. There is another toolbox called

DSP Blocksets which has larger blocks built in, such as equalizers and carrier

recovery blocks. I did not have access to the DSP Blocksets toolbox

unfortunately. The version of Matlab I used is listed here:

MATLAB Toolbox Version 5.2 18-Dec-1997

Communications Toolbox Version 1.3 01-Dec-1997

Signal Processing Toolbox Version 4.1 21-Nov-1997

Simulink Version 2.2 21-Nov-1997

68

Section 7.2 Matlab Code

The matlab code is shown in the next few pages and to understand the code you

need to refer to Figure 7.1, the system block diagram.

% EE297 Project Rajat Sewal

% File Name : qam64.m

%

% This program simulates a 64 QAM Modem

%

% Date Revision History

% ------- -------- ----------------------------

% 7/11/98 1.0 Started writing code

% 10/24/98 2.0 Added channel impairment

% 10/26/98 3.0 Display Ber vs Eb_No curve

% 10/27/98 4.0 Added RS Error correction with prompt

% 10/27/98 5.0 Fixed some errors in data lengths

% 10/28/98 6.0 Prompt for extra graphs and zoom in Eb_No curve

% 10/29/98 7.0 Prompt for code word length N & log start/stop time

%

% Initialization

fprintf('Clearing all variables...\n')

clear all

%symbol rate, digital transfer frequency Fd

Fd=1;

%assign Carrier Frequency

Fc=10;

%Sample Rate or sample freq Fs. This is the rate Matlab samples the analog

signals because after all the computer cannot sample infinitely fast to simulate

an analog signal. This frequency has more to do with the computer than the

modem itself.

Fs=100; N=7;

%

%Error-control coding

use_reed_solomon=input('Do you want Reed Solomon error

correction?[1=Yes,0=No]: ');

if use_reed_solomon==1

N=input('Enter code word length {N=2^M-1}, say 7,15,31: ');

end

fprintf('Do you want extra graphs of Mapped Data, XMIT Filtered output\n');

extra_graphs=input('RF Data, FFT of RCVR Filt,& QASk

Constellation?[1=Yes,0=No]: ');

K=6;

% N=(2^M)-1; Check bits = N-K

%

start_time=clock;

69

%QAM bits/symbol Specification

bits_per_symbol=6; % note: 2^6=64 QAM

Data_length=[10 10 10 10 10 10 10]*N*bits_per_symbol*K;

%

for i=1:length(Data_length)

% the message source

bits = randint(Data_length(i),1,2);

% Reed Solomon Encoding

%

if use_reed_solomon==1

coded_data = encode(bits,N,K,'rs'); % encode data

else

coded_data = bits; % don't encode data

end

% Generate symbols (0 to 63) from binary bits (0,1,1,0,1,0...)

symbols=bi2de(vec2mat(coded_data,bits_per_symbol));

% Digital to analog signal mapping

mapped_data = modmap(symbols,Fd,Fs,'qask',64);

%%%%%%%%%% Transmit Raised Cosine shaping %%%%%%%%%%

filtered_data=rcosflt(mapped_data,Fd,Fs/50,'fir/sqrt',0.13);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%% QAM MODULATION & %%%%%%%%%%%%

%%%%%%% Analog Upconversion to communication channel

transmit_rf = amod(filtered_data,Fc,Fs,'qam');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%% CHANNEL NOISE %%%%%%%%%%%%%%%

%%%%%%%%%% Channel Impairment Section %%%%%%%%%%%%%

% Add AWGN noise and compute Eb/No

%fprintf('adding AWGN... ')

noise_var=[2,1.5,1,0.3,0.2,0.15,0.01];

fprintf('adding AWGN with variance: %2.1d\n',noise_var(i))

%Additive noise variance

noise_gaussian=randn(length(transmit_rf),1) * noise_var(i);

noisy_rf_signal=transmit_rf + noise_gaussian;

% Calculate signal and noise energy

signal_energy=transmit_rf' * transmit_rf / length(transmit_rf);

noise_energy=noise_gaussian' * noise_gaussian / length(noise_gaussian);

Eb_No(i)= signal_energy/noise_energy;

70

%%%%%%%%%%% QAM 64 RECEIVER %%%%%%%%%%%%%%%%

% analog demodulation of carrier and qam signal

analog_rx=ademod(noisy_rf_signal,Fc,Fs,'qam');

%%%%% Received Matched filter - Raised Cosine %%%%%%%%%%%%

% with excess bandwidth = 0.13

rx_ana_data=rcosflt(analog_rx,Fd,Fs/50,'fir/sqrt',0.13);

%%%%%% Decimate results by taking every 1/Fs sample %%%%%%%%%

% decimate to subsample the Matlab rcosflt output

exp_ana_data_i = decimate(rx_ana_data(:,1), 4);

exp_ana_data_q = decimate(rx_ana_data(:,2), 4);

%%%%%%%%%%%%%%%%% SLICER %%%%%%%%%%%%%%%%%

slicer=demodmap([exp_ana_data_i exp_ana_data_q],Fd,Fs,'qask',64);

%%%%%%%%% decode symbols into bits %%%%%%%%%%%%%

demod_bit=de2bi(slicer,bits_per_symbol)';

demod_bit=demod_bit(:);

%

% Reed Solomon Decoding

%

if use_reed_solomon==1

decoded_bits = decode(demod_bit,N,K,'rs');

else

decoded_bits = demod_bit;

end

%

%%%%%%%%%%%%%% BER Tests %%%%%%%%%%%%%%%%%%

%err = symerr(bits,demod_bit);

[numb(i),BER(i)]=biterr(decoded_bits(:),bits);

ber_array(i,1)=BER(i)

end

%%%%%%%%%%%%%%%% Extra Graphs %%%%%%%%%%%%%%%%

if extra_graphs==1

plot(mapped_data);title('Mapped Data');figure;

plot(filtered_data);title('XMIT Filtered Data');figure;

plot(transmit_rf);title('RF data');figure;

plot(abs(fft(rx_ana_data)));title('FFT of RCVR filter output');figure;

qaskenco(slicer,64); % plot received symbols on constellation

end

%%%%%%%%%%%%%%% BER PLOTS %%%%%%%%%%%%%%%%%%

% Curve fitting using Spline function

x_axis=logspace(log10(min(Eb_No)),log10(max(Eb_No)),20);

Eb_No(find(BER==0))=[];

BER(find(BER==0))=[];

y_data=spline(log10(Eb_No),log10(BER),log10(x_axis));

%

%plot results

figure

loglog(x_axis,10.^y_data,'b-',Eb_No,BER,'bo')

71

xlabel('Eb/No')

ylabel('BER')

% next line added to fix the xy axis scales

axis([1 1E4 1E-12 1]);

if use_reed_solomon==1

title([num2str(2^bits_per_symbol),'-ary QASK with [',num2str(N),',',num2str(K),']

Reed Solomon simulation result'])

grid;

else

title([num2str(2^bits_per_symbol),'-ary QASK Simulation result'])

grid;

end

zoom

fprintf('Select area to zoom in and right click to zoom out\n')

stop_time=clock;

elapsed_time=stop_time - start_time

%%%%%%%%%%%%%%%%%% END %%%%%%%%%%%%%%%%%%

72

Figure 7.1 QAM -Matlab System

decoded_bits

DATA

SOURCE

ENCODE

Reed

Solomon

VEC2MAT BI2DE MODMAP

RCOSFLT AMOD

NOISE

ADEMOD RCOSFLT

DECIMATE

DEMODMAP

DE2BI

bits

coded_data

symbols

mapped_dat

a

mapped_dat

a

filtered_data transmit_rf

noise_gaussia

n

analog_rx

rx_ana_da

ta

rx_ana_data

exp_ana_data

i

exp_ana_data_

q

slicer

demod_bi

t

noisy_rf_signal

DECIMATE

DECODE

Reed

Solomon

73

Section 7.3 Discussion of Matlab Code

The user launches Matlab and then types the name of the program “qam64”.

The program then prompts the user to activate the Reed Solomon error

correction block or bypass correction. If the user selects Reed Solomon error

correction then he is asked to input the code word length N. There is a rule for

selecting N and it is 1 2 −

M

N where M = 3, 4, 5, 6 etc. M cannot be less than

3. Here is a list of valid N 7, 15, 31, 63 based on the four values of M listed

above. If Reed Solomon is not selected then N defaults to 7 so that we get a

reasonable Data_length. Then the program prompts for extra graphs and if one

chooses not to display them, a graph of BER vs E

B

/N

o

is displayed at the end

anyway.

Random data is then generated with a function called RANDINT, which has the

format:

RANDINT Random integer matrix generator.

OUT = RANDINT(N,M,RANGE) generates an N-by-M matrix of random

binary numbers in the RANGE. The appearance of "0" and "1" have even

probability. When

RANGE is a scalar positive integer, the output integer range is [0, RANGE-1].

In my program I have: bits = randint(Data_length(i),1,2);

Since Data_length is defined earlier on as

Data_length=[10 10 10 10 10 10 10]*N*bits_per_symbol*K;

It takes on the value depending on N, bits_per_symbol, and K. The value of

bits_per_symbol is 6 in accordance with 64-QAM. The value of K is 6. So

Data_length comes out to be 360N. However coding changes that as discussed

below.

The program runs through its entire course 7 times (Data_length). So if we

wanted to increase the number of loops we simply increase the length of

Data_length by adding another 10. The program is designed so that for each set

of “runs” out of the 7 runs it generates and pushes as many bits as dictated by

the following algorithm:

Data_length.mcd

RajatSewal

N 31 bits_per_symbol 6 K 6

data_length 10 N

.

K

.

bits_per_symbol

.

data_length 11160

uncoded_data_length data_length uncoded_data_length 11160

coded_data_length

uncoded_data_length

bits_per_symbol

N K ( )

.

uncoded_data_length

coded_data_length 57660

74

Using the above equations the coded_data_length with several values of N are

tabulated in Table 7.1.

N (uncoded)

Data_length=360*N

Coded Data Length

7 2520 2940

15 5400 13500

31 11160 57660

63 22680 238140

Table 7.1 Data Lengths

So “bits” contains Data_length number of binary data (0110001010101010…).

This is then Reed Solomon encoded if the choice was made or left un-encoded.

The format of the function “encode” is:

ENCODE Error-control code encoding computation.

CODE = ENCODE(MSG, N, K, METHOD)

Encodes the binary message specified in MSG using the coding technique in

METHOD. The code word length is N and the message length is K. The format

of MSG can be either a vector or K column matrix. A code has code word length

2^M -1, where M is an integer no less than 3. The message length is 2^M - M - 1.

Hamming code is a single error-correction code.

The METHOD can be 'hamming' Hamming code, 'linear' Linear block code,

'cyclic' Cyclic code, 'bch' Binary BCH code, 'rs' Reed-Solomon code, or

'convol' Convolution code.

When MSG is a K-column matrix, the output CODE is an N-column matrix.

In my program the usage is:

coded_data = encode(bits,N,K,'rs');

After coding the data is called “coded_data” and is still binary data. This data is

then sent to a block called VEC2MAT described next:

VEC2MAT Vector to matrix conversion.

MAT = VEC2MAT(VEC, M) converts VEC to be an M column matrix with row

priority arrangement. If it needs to add an element, 0 will be added to the end of

the input vector to form the required matrix.

In my program the usage is:

symbols=bi2de(vec2mat(coded_data,bits_per_symbol));

Where bits_per_symbol=6 so that the output of vec2mat is a binary data of 6

column matrix partitioned symbol by symbol. This step is followed by a

conversion from binary to decimal format:

75

symbols=bi2de(vec2mat(coded_data,bits_per_symbol));

So now symbols is a decimal grouping of numbers from 0 to 63.

Here is the format of the bi2de command:

BI2DE Converts binary to decimal format.

D = BI2DE(B) converts a binary representation vector B to a decimal

representation D. When B is a matrix, the output D is a column vector with each

element being the transfer of a row of B. The first element in B represents the

lowest binary bit. For example bi2de([1 0]) results in 1; bi2de([0 1]) results in 2.

The next step is to take the “symbols” vector and run it into MODMAP which

maps the decimal formatted numbers into their equivalent QAM symbol

constellation coordinates ( ± 1, ± 3, ± 5, and ± 7). The modmap function is

described next.

MODMAP Maps a digital signal to an analog signal for modulation.

Y = MODMAP(X, Fd, Fs, METHOD,M) maps a sample

frequency Fd (Hz) signal vector X into a sample frequency Fs (Hz)

in-phase and quadrature components in Y. Y is a two column matrix.

The first column is an in-phase component and second column is a

quadrature component. When METHOD = 'ask', Y is a column vector

instead of a matrix.

This function does mapping only. M defines the M-ary number of a square

constellation when METHOD is qask. METHOD is a string, which can be one of

the following: 'ask' M-ary Amplitude shift keying modulation. 'psk' M-ary Phase

shift keying modulation. 'qask' M-ary Quadrature amplitude shift-keying

Modulation. 'fsk' M-ary Frequency shift keying modulation. 'msk' Minimum

shift keying modulation. 'sample' Up sample the input signal.

In my program the usage is:

mapped_data = modmap(symbols,Fd,Fs,'qask',64)

The next block is the filter block to pulse-shape the symbols that are to be

transmitted. This is the RCOSFLT ie raised cosine filter with excess bandwidth

13 . 0 α . The format is shown next:

RCOSFLT Filters the input signal using raised cosine filter.

Y = RCOSFLT(X, Fd, Fs, TYPE_FLAG, R) filters the input signal X using raised

cosine (R-C) FIR filter. The sample frequency for X is Fd (Hz). The sample

frequency for Y is Fs. Fs must be larger than Fd. Fs/Fd must be an integer. The

rolloff factor R has a default of 0.5 but must a real number in the range [0, 1].

TYPE_FLAG is a string, which can be one of the following:

'fir' Use FIR R-C filter (default).

'iir' Use IIR R-C filter.

'normal' Use normal R-C filter (default), in contrast to 'qart'.

76

'sqrt' Use square root raised cosine filter.

'wdelay' Keep the full length of the filtered result, in the case

the row number (or vector length) of Y is

(length_of_X + DELAY)*Fs/Fd. The value DELAY is a default of

3. The function default has had the delay cut off from

the output.

'Fs' X is input with sample frequency Fs. In this case, only

elements X(i*Fs/Fd+1,:) are used in the calculation. All

others are discarded.

In my program the usage is:

filtered_data=rcosflt(mapped_data,Fd,Fs/50,'fir/sqrt',0.13)

The next section is the last part of the transmitter and is AMOD (analog

modulator).

AMOD Analog signal modulation.

Y = AMOD(X, Fc, Fs, METHOD) modulates the message signal X with

carrier frequency Fc (in Hz) and sample frequency Fs (Hz) using the modulation

scheme in string variable METHOD. The time interval between two successive

points in X is 1/Fs. When Fs is a two-element vector, the second element

specifies the initial phase in the carrier signal modulation. The unit of the initial

phase is rad. For best results, Fs > Fc is required (by Nyquist theory).

METHOD is a string, which can be one of the following:

'amdsb-tc' Amplitude modulation, double sideband with transmission carrier

'amdsb-sc' Amplitude modulation, double sideband suppressed carrier

'amssb' Amplitude modulation, single sideband suppressed carrier

'qam' Quadrature amplitude modulation

'fm' Frequency modulation

'pm' Phase modulation

In my program the usage is:

transmit_rf = amod(filtered_data,Fc,Fs,'qam')

Now the signal goes through an ideal channel with AWGN (additive white

gaussian noise) added at the input of the receiver. The code that generates the

random noise is discussed next.

First we define a noise variance matrix called noise_var

noise_var=[2,1.5,1,0.3,0.2,0.15,0.01]

Here the length of the noise_var matrix is 7 elements long to match the way the

program is designed: it loops through the entire program 7 times picking the first

noise variance of 2 and then moving on to smaller and smaller noise till it gets to

0.01. The function that is used in generating noise is RANDN.

RANDN Normally distributed random numbers.

77

RANDN(M,N) is an M-by-N matrix with random entries. RANDN produces

pseudo-random numbers. The sequence of numbers generated is determined

by the state of the generator.

In my program the usage is:

noise_gaussian=randn(length(transmit_rf),1) * noise_var(i)

The noise is then added to the tranmitted rf signal:

noisy_rf_signal = transmit_rf + noise_gaussian

Now we enter the receiver with “noisy_rf_signal” and process it with ADEMOD

(analog demodualtor) which is the opposite function of AMOD. The output of the

ADEMOD is analog_rx, which is the demodulated analog baseband QAM signal.

This signal needs to be filtered to remove any carrier components and to reduce

intersymbol interference (ISI). Another raised cosine filter (Receive Filter) is

used here in the filter block “rcosflt”.

The output of the RCVR filter is rx_ana_data and since the XMIT filtering

operation had interpolated data, we need to decimate this data at the same rate

using the DECIMATE blocks. We decimate the in-phase and quadrature

portions separately. The command is described next.

DECIMATE Resample data at a lower rate after lowpass filtering.

Y = DECIMATE(X,R) resamples the sequence in vector X at 1/R times the

original sample rate. The resulting resampled vector Y is R times shorter,

LENGTH(Y) = LENGTH(X)/R.

DECIMATE filters the data with an eighth order Chebyshev type I lowpass

filter with cutoff frequency .8*(Fs/2)/R, before resampling.

In my program the usage is:

exp_ana_data_i = decimate(rx_ana_data(:,1), 4)

exp_ana_data_q = decimate(rx_ana_data(:,2), 4)

The next step is to do a demapping of the exp_ana_data_i and

exp_ana_data_q signals so that the symbol value is

extracted. This is done with inverse function of modmap ie.

DEMODMAP described next.

DEMODMAP Demaps a modulation mapped signal to the closest digit number.

The sampling frequency for Y is Fs (Hz) and the digital sampling frequency is Fd

(Hz).

slicer = demodmap([exp_ana_data_i exp_ana_data_q],Fd,Fs,’qask’,64)

Z = DEMODMAP(Y, Fd, Fs, METHOD,M) is a reverse mapping of function

MODMAP. This function demaps a sampling frequency Fs (Hz) analog signal

into a sampling frequency Fd (Hz) digital signal Z. Y is a two column matrix

78

where the first column is an in-phase component and second column is a

quadrature component. When METHOD = 'ask', 'fsk', or 'msk', Y is a one column

vector instead of a matrix. When Fd is a two element vector, the second

element is the offset value for the decision point. The offset timing in the plot is

offset/Fs. The default offset is 0. The received digital signal is sampled at time

i/Fd + offset/Fs. The sample value holds until time (i+1)/Fd +offset/Fs when the

next sample point is taken. The demapping process finds the distance from the

sample value to all of the possible digital symbols. The digital symbols with the

shortest distance to the current sampling point is the demodulated output.

In my program the usage is:

slicer = demodmap([exp_ana_data_i exp_ana_data_q],Fd,Fs,’qask’,64)

The output “slicer” is then sent to a decimal to binary converter so that the binary

bits can be recovered. This function is described next.

DE2BI Converts positive decimal numbers to binary numbers.

B = DE2BI(D, N) specifies the column number for matrix B. N is a

positive scalar number.

The first element in B represents the lowest binary bit. For example

DE2BI(1, 2) results in [1 0]; DE2BI(2) results in [0 1].

In my program the usage is:

demod_bit=de2bi(slicer,bits_per_symbol)

The next step is to take all the columns of demod_bit and convert them into one

single column so we have a string of bits in one column. This is done with the

command

demod_bit=demod_bit(:)

The next step is to decode with Reed Solomon algorithm if encoded. This is

done in an if statement:

if use_reed_solomon==1

decoded_bits = decode(demod_bit,N,K,'rs');

else

decoded_bits = demod_bit;

end

DECODE Error-control code decoding computation.

MSG = DECODE(CODE, N, K,METHOD) decodes binary codeword in

CODE using decode METHOD. The code word length is N and the message

length is K. The format of CODE can be either a vector or an N column matrix.

METHOD ENCODE SCHEME

79

'hamming' Hamming code

'linear' Linear block code

'cyclic' Cyclic code

'bch' BCH code

'rs' Reed-Solomon code

'convol' Convolution code

In using methods other than the "rs" method, L equals N. In using the "rs"

method, L = M, where N = 2^M - 1. M is an integer >= 3. CODE can also be a

non-negative integer in the range of [0, 2^L-1]. In this case, you have to add

'/decimal' in the method specification. For example, 'bch' is equivalent to

'bch/binary'. 'bch/decimal' means the data in MSG is binary. Except for the 'rs'

method, MSG can only be a vector when using the decimal method.

The output MSG contains the decoded message. The format of MSG matches

the format of CODE. When CODE is a N-column matrix, the output MSG is a K-

column matrix.

When the format of the input CODE is not the same as the output of function

ENCODE, this function stops processing.

The next step is to take decoded_bits and perform BER (bit error tests) and

graph the results.

The BER tests are done with a function called biterr

BITERR Computes bit error.

[NUMBER, RATIO] = BITERR(X, Y) compares the elements in the input

matrices X and Y. The number of the bit differences is outputted in

NUMBER. The ratio of NUMBER to the total bit number contained in

Y is output in RATIO. All elements in X and Y should be non-negative

integers. The total bit number in Y is estimated by

column_y * row_y * K,

where K is the bit number for each element in Y. K is the smallest

integer satisfying MAX < 2^K, where MAX is the maximum number in both

X and Y. When X or Y is a matrix and the other is a vector, this

function convert the vectors to a matrix with the column number the

same as the matrix before the comparison.

In my program the usage is:

[numb(i),BER(i)]=biterr(decoded_bits(:),bits);

Signal and noise energy is calculated using

signal_energy=transmit_rf' * transmit_rf / length(transmit_rf)

noise_energy=noise_gaussian' * noise_gaussian / length(noise_gaussian)

and SNR is calculated using:

Eb_No(i)= signal_energy/noise_energy;

80

Section 7.4 Discussion of Simulation Results

The data beside the graph is the bit error array produced for 7 different noise

variances.

Data_length=[10 10 10 10 10 10 10]*N*bits_per_symbol*K;

noise_var=[2,1.5,1,0.3,0.2,0.15,0.01];

The program runs through 7 times, each time picking a new noise variance from

the array shown above. The bit error is logged into an array called ber_array and

each point is plotted using a sophisticated algorithm called “spline” for curve

fitting. The circles on the graph are the data points in the ber_array. Values that

are zero (no single error) are not shown because this is a log scale and it does

not go below 1x10

-12

.

CASE 1

N=7 (default), since No error correction selected, number of bits = 2520.

Bits pushed = 2520 x 7 = 17,640

ber_array =

0.1246

0.0798

0.0444

0.0004

0

0

0

Figure 7.2 No Error Correction

10

0

10

1

10

2

10

3

10

4

10

-12

10

-10

10

-8

10

-6

10

-4

10

-2

10

0

Eb/No

B

E

R

64-ary QASK Simulation result

81

CASE 2

N=7 , Reed Solomon error correction selected, number of bits (coded) = 2940

Correction bits = N-K=7-6=1. Bits pushed = 2940 x 7 = 20,580

ber_array =

0.1187

0.0857

0.0353

0

0

0

0

Figure 7.3 Error Correction N=7

10

0

10

1

10

2

10

3

10

4

10

-12

10

-10

10

-8

10

-6

10

-4

10

-2

10

0

Eb/No

B

E

R

64-ary QASK with [7,6] Reed Solomon simulation result

82

CASE 3

N=15 , Reed Solomon error correction selected, number of bits (coded) =

13,500. Bits pushed = 13,500 x 7 = 94,500

Correction bits = N-K=15-6=9

ber_array =

0.1385

0.0617

0.0104

0

0

0

0

Figure 7.4 Error Correction N=15

10

0

10

1

10

2

10

3

10

4

10

-12

10

-10

10

-8

10

-6

10

-4

10

-2

10

0

Eb/No

B

E

R

64-ary QASK with [15,6] Reed Solomon simulation result

83

CASE 4

N=31 , Reed Solomon error correction selected, number of bits (coded) =

57,660. Bits pushed = 57,660 x 7 = 403,620

Correction bits = N-K=31-6=25

ber_array =

0.1228

0.0461

0.0002

0

0

0

0

Figure 7.5 Error Correction N=31

10

0

10

1

10

2

10

3

10

4

10

-12

10

-10

10

-8

10

-6

10

-4

10

-2

10

0

Eb/No

B

E

R

64-ary QASK with [31,6] Reed Solomon simulation result

84

CASE 5

N=7 , No error correction selected, number of bits pushed = 2520 x 7 = 17,640

Additional graphs selected. In this mode the following graphs are displayed:

• Mapped Data Figure 7.6

• XMIT Filtered Data Figure 7.7

• RF Data Figure 7.8

• FFT of RCVR Filter Figure 7.9

• QASK Constellation Figure 7.10

85

Figure 7.6 Mapped Data

86

Figure 7.7 XMIT Filtered Data

87

Figure 7.8 RF Data

88

Figure 7.9 FFT of RCVR Filter Output

89

Figure 7.10 QASK Constellation

90

Section 7.5 Summary of Simulation Results

The simulation results are summarized in Table 7.2. The error correction

algorithm used in cases 2-4 is the Reed Solomon with ) , ( k n = ) 6 , (N , where k is

the message length and N is the code word length. The effect of increasing the

code word length on the bit error rate is explored. The value of BER is a ratio

not a percentage (so BER = 0.0444 is 4.44%). The values of BER = 0 mean no

bits were in error and is not a result of rounding off in the calculations.

CASE 1

No Error

Correction

CASE 2

Reed

Solomon

N=7

CASE 3

Reed

Solomon

N=15

CASE 4

Reed

Solomon

N=31

1 0.1246 0.1187 0.1385 0.1228

2 0.0798 0.0857 0.0617 0.0461

3 0.0444 0.0353 0.0104 0.0002

4 0.0004 0 0 0

5 0 0 0 0

6 0 0 0 0

7 0 0 0 0

Table 7.2 BER Summary

As can be seen going across any row, there is improvement in the BER

performance as the value of N increases because more and more redundancy is

added as correction bits (N-K) increases. Increasing N does come at a cost of

reduced source rate. The simulation times can be large for N=31 and can range

somewhere around 8-12hrs depending on the machine.

How N is picked is very important and the rule is 1 2 −

M

N where 6 , 5 , 4 , 3 M

resulting in N 7, 15, 31, and 63 respectively. I actually ran N 63 and the

computer (233Mhz Pentium, 64 Mbyte of SD Ram) ran out of resources after 32

hrs. The total number of bits I was trying to push through the modem was

1,666,980 bits. A factor in simulation speed is whether one is doing a passband

simulation or a baseband simulation of a passband system. The later runs much

faster because it does not involve a carrier (less computation on the part of the

computer). However, the baseband simulation involves using the complex

envelope of the Qam signals and the math can be complex. The filters also have

to be complex. Matlab allows one to do the baseband simulation in Simulink and

although I have familiarity with it I did not use a Simulink model in this project.

My model does not have an equalizer because the channel I was using is an

ideal channel corrupted by AWGN and this cannot be equalized. The carrier

recovery in the ADEMOD function is direct. The model picks up Fc directly from

the transmitter. Carrier Phase offsets can be modeled by the ADEMOD function

call by specifying the phase offset but I let it run with zero phase offset.

91

Chapter 8 Set-top Box ASIC Design

For a set-top terminal, most of the hardware design work is implemented in

ASICs. An ASIC's functionality is usually defined in the system engineering,

feature selection, and customer requirements phase. After the functions have

been defined and partitioned, design teams can be assembled to complete the

task of designing and fabricating the product ASICs. The kind of tools needed by

the ASIC engineers are Synopsys design compiler, Chronologic Verilog

simulators, Motive static timing analyzers, and Cadence Verilog simulators. Sun

Sparc workstations are used as simulation and synthesis servers. The first stage

of the ASIC implementation is writing a high-level description document. The

document contains high-level block diagrams, and architecture descriptions for

the modules contained in the ASIC. The document is written by the ASIC design

team and is supervised by an ASIC lead designer or project leader. This high-

level description document is used by the design team as a guide through the

ASIC development phase.

After implementation of the high-level description is approved, the ASIC

design team codes the design in Verilog. The design is simulated and each code

block is verified at the module level. Each designer is responsible for the

functionality of his/her assigned sections. Individual integration efforts can begin

at a point where major modules can be connected. Typically, integration occurs

in phases, but each stage of integration only proceeds after the modules to be

integrated have been thoroughly verified. While preliminary integration occurs,

synthesis of lower-level modules may be completed in parallel. Synthesis scripts

can be developed in an infant state, then later optimized and integrated when

synthesizing at the full chip level.

After full ASIC-level integration has been completed, chip synthesis may

begin. This process converts the Verilog RTL (register transfer level) behavioral

code to the actual chip netlist for the targeted ASIC library. In parallel to chip

synthesis, regression tests that verify the functionality are developed. The

regression tests verify the functionality of the behavioral code, and later can be

used to verify the gate-level implementation. After the ASIC has been

synthesized, regression tests should be run to verify the ASIC functionality by

simulating the design at a unit-delay level. Once the design functions at the unit-

delay level, the design can be back annotated with estimated pre-layout delays.

Functionality is then rechecked with the regression tests. The design should also

be checked with a static timing analyzer tool (Design Compiler by Synopsys) to

verify that worst-case paths (which are hard to simulate) meet timing. Once the

design meets timing and functionality with pre-layout estimated timing, the

design is ready for floor planning followed by cell placement and routing.

The floor planning is sometimes done in parallel with the estimated timing

verification phase of the design. This occurs because the design is somewhat

stable and usually the major blocks of the design do not change architecturally.

The first stage of the cell placement and routing can take up to 2 weeks for

designs greater than 100,000 gates. The average turn time for designs ranging

92

from 50,000 gates to 150,000 gates can be anywhere from 1 to 2 weeks. After all

nets are routed and all cells placed, the layout engineer delivers a wire delay file

(based on actual capacitive loading) back to the ASIC designer so that actual

timing can be back-annotated into the design. Typically, loading constraints on

buffers and some timing has been violated with the first cut of the layout. The

designer is required to perform a regression test and retime static paths in the

design so that all violations due to the actual wire loading can be corrected.

When all violations are detected and repaired, the ASIC designer returns the

updated netlist to the layout engineer so that the new and changed cells can be

updated in the layout database. One more wire delay file is delivered from the

layout engineer to the ASIC designer for final verification.

Once the ASIC designer completes the final verification, they will run the final

LVS (layout vs. schematic) and DRC (design rule checker) tools before handing

the layout database to the mask shop.

Return to Table of Contents TOC

Table of Contents

**Chapter 1 QAM Demodulator_____________________________________________ 6
**

Section 1.1 INTRODUCTION – DIGITAL COMMUNICATION SYSTEM ____________ 6

**Chapter 2 DISCUSSION OF INFORMATION THEORY ________________________ 9
**

Section 2.1 LOGARITHMIC MEASURE OF INFORMATION ______________________ 9 Section 2.2 SOURCE ENCODING ____________________________________________ 13 Section 2.3 CHANNEL ENCODING __________________________________________ 18

**Chapter 3 ERROR CORRECTION ________________________________________ 21
**

Section 3.1 Block Codes ____________________________________________________ 21 Section 3.2 Convolutional Codes ______________________________________________ 22 Section 3.3 Block Codes in Detail _____________________________________________ 23

**Chapter 4 DATA MODULATION & DEMODULATION _______________________ 26
**

Section 4.1 Discrete Data Transmission ________________________________________ 26 Section 4.2 Introduction to Linear Modulation Methods____________________________ 27 Section 4.3 QAM Schematic _________________________________________________ 34 Section 4.4 Probability of Error in QAM ______________________________________ 36

**Chapter 5 Cable Modem Introduction _____________________________________ 39
**

Section 5.1 Definition of Cable Modem ________________________________________ 39 Section 5.2 Structure of Cable systems _________________________________________ 39 Section 5.3 Cable Specifications ______________________________________________ 45 Section 5.4 Baud, Bit-rate, Modem Speed _______________________________________ 50 Section 5.5 Digital TV Standards______________________________________________ 51 Section 5.6 Overview of transport subsystem ____________________________________ 52 Section 5.7 MPEG-TS Transport Stream________________________________________ 54 Section 5.8 Set-Top Boxes ___________________________________________________ 55 Glossary of terms __________________________________________________________ 57

**Chapter 6 Modem Design _______________________________________________ 59
**

Section 6.1 Basic Modulator _________________________________________________ 59 Section 6.2 Modem Specification _____________________________________________ 63 Section 6.3 IEEE802.14 Specification __________________________________________ 66

**Chapter 7 Matlab Simulation ____________________________________________ 67
**

Section 7.1 Communication Tool Box__________________________________________ 67 Section 7.2 Matlab Code ____________________________________________________ 68 Section 7.3 Discussion of Matlab Code _________________________________________ 73

2

Section 7.4 Discussion of Simulation Results ____________________________________ 80 Section 7.5 Summary of Simulation Results_____________________________________ 90

Chapter 8 Set-top Box ASIC Design _______________________________________ 91

3

5 DELTA MODULATION ________________________________________________________ 17 FIGURE 2.2 ANATOMY OF A CODEWORD __________________________________________________ 21 FIGURE 3.9 FCC FREQUENCY DETAIL ____________________________________________________ 49 FIGURE 5.1 ENTROPY OF SOURCE _______________________________________________________ 12 FIGURE 2.5 RAISED COSINE PULSE α = 0.15 NOISY SIGNAL CONSTELLATION ______________________________________________ 38 FIGURE 5.7 QPSK WAVEFORM ________________________________________________________ 31 FIGURE 4.6 SIMPLE CHANNEL CODING ____________________________________________________ 18 FIGURE 3.1 QAM -MATLAB SYSTEM ___________________________________________________ 72 FIGURE 7.4 COAXIAL CABLE____________________________________________________________ 43 FIGURE 5.8 QAM CONSTELLATIONS _____________________________________________________ 33 FIGURE 4.10 RECTANGULAR QAM_______________________________________________________ 34 FIGURE 4.2 NO ERROR CORRECTION _____________________________________________________ 80 FIGURE 7.5 ______________________________________________ 62 FIGURE 6.2 LOW PASS FILTER __________________________________________________________ 60 FIGURE 6.10 TRANSPORT PACKET FORMAT ______________________________________________ 53 FIGURE 5.4 RAISED COSINE PULSE α = 0 (IDEAL LOW PASS) _________________________________ 62 FIGURE 6.1 BASIC MODULATOR _________________________________________________________ 59 FIGURE 6.12 QAM DEMODULATOR _______________________________________________________ 35 FIGURE 4.9 MODULATED WAVEFORMS __________________________________________________ 33 FIGURE 4.9 TYPE C PHY ______________________________________________________________ 66 FIGURE 7.8 TRUNK COAX CONSTRUCTION _________________________________________________ 45 FIGURE 5.1 DIGITAL COMMUNICATION SYSTEM MODEL _______________________________________ 6 FIGURE 2.11 TRANSMITTER-RECEIVER FOR DIGITAL TELEVISION _______________________________ 53 FIGURE 5.2 DIGITAL COMMUNICATION SYSTEM ____________________________________________ 13 FIGURE 2.4 BASE BAND PAM __________________________________________________________ 30 FIGURE 4.3 PAM CONSTELLATION _______________________________________________________ 29 FIGURE 4.13 ____________________________________________ 61 FIGURE 6.6 FULL RAISED COSINE PULSE α = 1 __________________________________________ 62 FIGURE 6.3 ERROR CORRECTION N=7 ____________________________________________________ 81 FIGURE 7.7 QAM ARCHITECTURE _____________________________________________________ 63 FIGURE 6.13 64-QAM BIT ASSIGNMENT __________________________________________________ 36 FIGURE 4.1 CABLE NETWORK___________________________________________________________ 40 FIGURE 5.4 ERROR CORRECTION N=15 ___________________________________________________ 82 FIGURE 7.3 HFC NETWORK ____________________________________________________________ 42 FIGURE 5.1 SYSTEMATIC BLOCK ENCODER ________________________________________________ 21 FIGURE 3.11 QAM MODULATOR ________________________________________________________ 34 FIGURE 4.List of Figures FIGURE 1.8 NATIONAL SEMICONDUCTOR-QAM SCHEMATIC ________________________________ 65 FIGURE 6.2 PAM SIGNAL.14 PM VS SNR FOR QAM & PSK ________________________________________________ 38 FIGURE 4. & PSK __________________________________________________ 28 FIGURE 4.2 HYBRID FIBER/COAX NETWORK ________________________________________________ 41 FIGURE 5.12 MPEG-2 FRAME __________________________________________________________ 54 FIGURE 5.1 VECTOR MODEL OF COMMUNICATION SYSTEM _________________________________ 26 FIGURE 4.7 TRUNK CABLE FREQUENCY RESPONSE __________________________________________ 44 FIGURE 5.5 FCC FREQUENCY ALLOCATION ________________________________________________ 43 FIGURE 5.6 PSK ____________________________________________________________________ 31 FIGURE 4.5 ERROR CORRECTION N=31 ___________________________________________________ 83 4 .5 PASS BAND PAM __________________________________________________________ 31 FIGURE 4.3 RAISED COSINE PULSE α = 0.3 PCM ____________________________________________________________________ 15 FIGURE 2.6 DROP CABLE FREQUENCY RESPONSE ___________________________________________ 44 FIGURE 5.13 DIGITAL VIDEO STANDARDS _________________________________________________ 56 FIGURE 6. FSK.4 DPCM ENCODER _________________________________________________________ 16 FIGURE 2.3 CLASS OF CHANNEL CODES ___________________________________________________ 22 FIGURE 4.

7 XMIT FILTERED DATA ______________________________________________________ 86 FIGURE 7.FIGURE 7.8 RF DATA _________________________________________________________________ 87 FIGURE 7.9 FFT OF RCVR FILTER OUTPUT ________________________________________________ 88 FIGURE 7.6 MAPPED DATA ____________________________________________________________ 85 FIGURE 7.10 QASK CONSTELLATION _____________________________________________________ 89 5 .

6 .Chapter 3.1.1 Digital Communication System Model The following is a very brief synopsis of the above model and a more detailed discussion is to be found later on in Chapter 2. 1.1 INTRODUCTION – DIGITAL COMMUNICATION SYSTEM A Demodulator for a Quadrature Amplitude Modulated signal with 64 symbol constellations for Cable Modem is designed. Data Source: Set of Symbols generated by a person or system to be sent over a transmission medium to a user. Each block is defined below. Before getting into the specific design aspects of a QAM demodulator we need to define terms and go over some basic concepts in Digital Communications. A general communication system is shown in Figure 1. perform compression of redundancy in a systematic manner and that is called source encoding. Since we are looking to represent the source output with as few binary digits as possible this is also called compression.Chapter 1 QAM Demodulator Section 1. and Chapter 4. Figure 1. So we 2. Examples • Speech/Audio • Image/Video • Telemetry • Computer Data Source Encoder: Messages from users are highly redundant.

4. Examples • Air/Deep space Radio Frequency • Telephone twisted pair (POTS . Here binary data is mapped into symbols and modulated with a carrier.1 for another perspective of a Discrete Data Transmission system with vector representation. Examples • Block Codes: BCH • Trellis codes: Convolutional & Coset In many cases the two (Source Encoder & Channel Encoder) are combined into one function called "Vector Encoder”. Refer to Figure 4. • • • PSK QPSK QAM Channel: This is any physical medium over which the Transmitted signal 5.3. must pass to get to the Receiver. See Figure 3.Plain Old Telephone System) • Ethernet • Fiber-optic Link (using a pulsed laser light) • CD Rom • Magnetic Disk Distortion & Noise: When analog signals are digitized and compressed 6. any other source compression is realized at a cost of varying degree of imperfect representation. However. In digitization of band-limited signals. also called LZ compression Channel Encoder: any coding for improved transmission over a physical 3. They are loosely called noise.Examples • CELP coding for speech/audio signals • JPEG coding for still images • Lempel-Ziv universal lossless coding for test compression. Digital Modulator: This is one of many modulation schemes possible. In addition. medium. The modulator accepts a discrete time information sequence at its input and puts out a set of corresponding waveforms. there is always a cost associated with the process. The main difference between Block codes and Convolutional codes is the existence of memory in Convolutional codes. we employ Nyquist Theorem to guarantee exact reconstruction. There are two classes of Channel encoders (a) Block Codes (b) Convolutional codes. signals in the communication link are faced with a number of ills. 7 . This is called distortion and it is NOT recoverable.

etc. Channel Decoder: Perform inverse operations of Channel Coder Source Decoder: Perform inverse operations of Source Coder. User: The final destination of the message.1. modulator. This is referred to as the ˆ recovered message m . Digital Demodulator: This operation is the exact mirror operation of the 7. 10. Here the carrier is removed from the signal stream and the in-phase and quadrature components (in the case of QAM) separated into two paths.The presence of noise on a signal changes its shape and characteristics and it limits the ability of the intended receiver to make correct symbol decisions. The two 9. Examples: • • • • • • • • Additive Gaussian White Noise Device noise Atmospheric noise in the microwave channels Intersymbol interference in data communication systems Interspeaker interference in voice communications Near-end and Far-end crosstalk Echoes in Link and chamber Friendly and unfriendly jammers. and thereby affects the rate of reliable communication. Return to Table of Contents TOC 8 . functions Channel Decoder and Source Decoder are often lumped as Vector Detector as shown in Figure 4. At this point the message is in its original format but may not be identical. 8.

xn} and Y ∈ {y1. We shall see how this works. It is this sort of thing we are doing with the random variables X and Y. Some knowledge of probability will be assumed otherwise this discussion will go north exponentially.ym} We can have two situations either X depends on Y or X is independent of Y.x3. Given a discrete random variable is exactly like giving a dice (actually die) and predicting the outcome of an event (what number shows up) when a trial is conducted.….Chapter 2 DISCUSSION OF INFORMATION THEORY Rare events carry more information than common events Information is directly linked with probability. There are only six possible outcomes so this is a discrete random event. Section 2.x2.y3. and F 9 .…. E. Now that’s information! The nature of information defined scientifically is explored next. It is very important to realize that if the occurrence of the first event x2 tells us something about the event y3 then we have some knowledge or information about Y from X. It was a great scientist named Claude Shannon in 1948 who based on probabilistic models presented two papers that gave birth to Information Theory. Of course when I say X depends on Y. B. He discussed the basic problem of reliable transmission of information in statistical terms. I mean it may depend on Y to a small degree or a large degree and that relation is defined loosely right now as Mutual Information. But when the events x2 and y3 are so tightly related such as in the following example then no information is conveyed. It is worthwhile to appreciate that Shannon’s work on DIGITAL communication was done at a time when communication was primarily analog and there was little demand for systems that used digital communication because of the large complexity and hence cost of digital hardware required to achieve the high efficiency and the high reliability predicted by Shannon’s theory. more so than we realize at first.y2. and a yellow card with letters D. and C written on the face. If I told you that the sun was shining brightly in San Francisco there would not be as much information conveyed as if I told you that there was a magnitude 7 earth quake in San Francisco this morning and there was great destruction to lives and property. Say we have a blue card with the letters A. He adopted a logarithmic measure for the information content of a source and established basic limits on the maximum rate that digital information can be transmitted reliably over a noisy communication channel.1 LOGARITHMIC MEASURE OF INFORMATION Say we have two discrete random variables X and Y which can take on values from X ∈ {x1. If we had another die and began to throw it and started to predict its outcome based on the outcome of the first die we are trying to relate the two events.

Similarly there is no information when P=0. A suitable measure that satisfies these conditions is the logarithm of the ratio of the conditional probability. The information content provided by the occurrence of the event Y = yj about the event X = xi is defined as I ( xi. Here is a basic review of probability: P( X = xi ) ≡ P( xi ) is read probability of the random variable X taking on the value xi is read conditional probability of X taking on the value xi P( X = xi / Y = yj ) ≡ P( xi / yj ) given that Y has occurred and is yi. The units of I ( xi. what is the probability that it also shows the letter E? Well this is of course P(E/yellow) = 1 . yj ) are determined by the base of the logarithm which is usually selected as 2 but can be the natural base e . Note: when working with log2() it is easier to calculate the log to base 10. I have told you nothing. yj ) are called nats (natural units). the occurrence of Y = yj provides no information about the occurrence of the event X = xi. Again non-sense. yj ) is called the mutual information between xi and yj. written log() then divide by the log of 2 to base 10: 10 . On the other hand. A B C D E F We know this so well that it seems absurd to even discuss it! So THERE IS NO INFORMATION given when the outcome is certain (probability = 1).1 I ( xi. yj ) are bits and when the base is e then the units of I ( xi. We can start putting this is mathematical terms. When X and Y are statistically independent. or no information.on it. When do we have information? When there is some probability of event y3 occurring when x3 has occurred. we know that it is impossible to do this. Now we draw a card (face-up) and given that we pull the yellow card. When the base of the logarithm is 2 the units of I ( xi. when X and Y are fully dependent such that the occurrence of Y = yj determines the occurrence of X= xi the information content is simply that provided by the event X = xi. Now for the definition of mutual information. So if I told you that I pulled a yellow card (given) and I have also pulled the letter E. yj ) = log P( xi / yj ) P( xi ) eqn 2. This is like saying “you know what? Astronauts are going to land on the surface of the Sun".

2 where X represents the alphabet of possible output letters from a source and H ( X ) represents the average self-information per source letter and is also called the entropy of the source. So equation 2. the conditional probability in the numerator of eq 2. I ( xi. yj ) = log I ( xi ) = − log P( xi ) What is even more important than the self-information is the average self information of the source H ( X ) . To plot the graph we use log to base 10. the mutual information is zero.log 2(a) = log 10(a) log(a ) = log 10(2) 0.1 becomes. 1 In the special case when letters from the source are equally probable P( xi ) = n n 1 1 for all i eqn 2.1 is 1 and so 1 P( xi / yj ) ) = − log P( xi ) Which is just the information of the = log( P( xi ) P( xi ) event X = xi and for this reason is called the self information of the event X = xi and is denoted as I ( xi.301 When the random variables X and Y are statistically independent P( xi / yj ) = P( X = xi / Y = yj ) = P( xi ) because the probability of X is not affected by what happens to Y. so use the following eqn: 11 . or is 1 with probability (1-q). This is defined as H ( X ) = ∑ P( xi ) I ( xi ) but I ( xi ) = − log P( xi ) so that H ( X ) = −∑ P( xi ) log P( xi ) i =1 n i =1 n eqn 2.2 becomes H ( X ) = −∑ log = log n n i =1 n When a general problem is considered where a source emits a sequence of statistically independent letters. The entropy of such a source is calculated using eqn 2. yj ) = log P( xi ) = log(1) = 0 . P( xi ) However when the occurrence of Y = yj uniquely determines the occurrence of X = xi ie fully-dependent. where each output letter is either 0 with probability q.2. H ( X ) = −∑ P( xi ) log P( xi ) = −∑ P( xi ) log P( xi ) = −q log q − (1 − q ) log(1 − q ) i =1 i =1 n 2 Note: log in above eqn is in base 2.

301 0. Thus the entropy of a discrete source is a at q = 2 2 maximum when the output letters are equally probable.4 q Probability 0.8 H( q ) 0. the entropy H ( X ) of the source represents the average amount information emitted by the source.H (q) = −q log q log(1 − q ) − (1 − q ) 0.1 Entropy of Source Also note that when X is the output of a discrete source. 1 Entropy in bits/letter 0.6 0.2 0.2 0 0.6 0.4 0.301 Note from the graph in Figure 2.1 that the maximum value of the entropy occurs 1 1 where H ( ) = 1 .8 1 Figure 2. 12 .

2 SOURCE ENCODING Please refer to Figure 2.2 Digital Communication System SOURCE CODING IN ANALOG SOURCES In contrast to a discrete time source whose output is a discrete random variable X .2 for this discussion. The objective of source coding is to minimize the source bit rate while keeping the distortion tolerable. The analog source is therefore reduced to a discrete-time source having a finite number of levels or finite alphabet. Since an exact representation of an analog output requires an infinite number of bits quantization results in data compression. This converts the continuous time source into an equivalent discrete time source. Thus the quantization process introduces some distortion depending on the method used. Having discussed the measure for information. In the encoding of such a signal the first step involves in sampling the source periodically. If the source output is bandlimited and the sampling is performed at Nyquist rate or higher we get no loss of information. This is important to discuss now. the amplitudes of the samples are continuous random variables and so each sample cannot be represented by a finite sequence of binary digits. There is more fundamental reasoning behind source coding when considering analog sources. a continuous time source (analog source) has an output X (t ) that is characterized by a stochastic process. Source Source Encoder (analog to digital) Channel Encoder Digital Modulator Distortion & Noise Channel User Source Decoder Channel Decoder Digital DeModulator Figure 2. 13 . However.Section 2. Why we do source encoding or sometimes called simply source coding is to remove redundancy in the input data. Data compression is achieved at the cost of some distortion. So each sample is quantized in amplitude to a finite number of levels. We now examine the process of encoding the output of a source called source encoding.

When the source is memoryless (ie each symbol is independent of the previous one) the encoding is done separately and the system is called a discrete memoryless system (DMS). • • • • PCM – Pulse Code Modulation DPCM – Differential Pulse Code Modulation DM – Delta Modulation LPC – Linear Predictive Coding – is a very different method of encoding PCM – Pulse Code Modulation In PCM each sample of the analog signal is quantized to one of 2 R amplitude levels where R is the number of binary digits used to represent each sample. When source coding is performed on a block of outputs the efficiency of the encoding method improves as the block size is increased. 14 . When a block of samples is quantized jointly as a single vector the process is called vector quantization or block quantization. There are several source coding techniques used for analog sources and they are listed below.3. By making the block size sufficiently large the average number of binary digits per output letter can be made arbitrarily close to the entropy of the source. If R = 3 and we use a uniform quantizer then we get an input/output relationship as shown in Figure 2. A measure of the efficiency of a source encoding method can be obtained by comparing the average number of binary digits per output letter from the source to the entropy H ( X ) .When each sample is quantized separately the process is called scalar quantization. It is always more efficient to encode blocks of symbols instead of encoding each symbol separately.

So for a 7 bit quantizer error = -52. DPCM exploits the redundancy in the samples to achieve a lower bit rate for the source output.8db = −28.3 PCM The unit delta should be replaced with ∆ in Figure 2.0013 12 12 Measured in db the mean square quantization error is: 2 −2 R ∆2 10 log 10 log E= = = −6 R − 10. 15 .Figure 2. µ Law).125 ∆2 2 −2 R This leads to a mean square quantization error of E = = = 0.8db for a 3-bit quantizer.8 db Many signals such as speech waveforms have the characteristic that small signal amplitudes occur more frequently than large amplitudes. Telephone central office uses PCM codes with non-uniform quantizers (A-Law. So for our example ∆ = 2 −3 = 0. 12 12 What this tells us is that for one added bit in the quantizer we reduce the error by 6db. DPCM – Pulse Code Modulation In sources that show significant correlation from one sample to the next a better approach that leads to smaller bit rates is to code the differences between samples instead of coding each sample independently. For such signals we use non-linear (non-uniform) quantizers that have more closely spaced levels for small amplitudes and widely spaced levels at large signal amplitudes.3 and then the step size of the quantizer is defined as ∆ = 2 − R .

Each value of the quantized prediction x x x error ~n is encoded into a sequence of binary digits and transmitted over the e channel to the destination. Practical DPCM systems use an algorithm for predicting the current sample based on the weighted linear combination of the previous p samples.3 ˆ xn = ∑ aixn − i i =1 p eqn 2. At the destination the same predictor that was used ˆ in the transmitter is synthesized and its output ~n is added to ~n to yield ~n .DPCM also achieves higher dynamic range and improved resolution as the encoder “looks at” tiny variations (resolution) and can follow large signals (dynamic range). Sampler x(t) xn + e(n) Quantizer ~n e ~n x ~n ˆ x _ ~n ˆ x Predictor predicted _ value Figure 2.4 DPCM ENCODER The input to the predictor is denoted as ~n which is the signal sample xn modified x by the quantization process. see eqn 2. The prediction algorithm used is Levinson and Durbin’s. x e x i =1 p 16 .3 ˆ where xn is the weighted linear combination of the past p samples and ai are the predictor coefficients. ~n = ∑ ai~n − i and en = xn − ~n . ˆ ˆ Also.

The purpose here is not to bring a signal into the digital domain (obviously since it is already digital) rather to combat the effects of noisy channels. To put it neatly. SOURCE CODING IN DIGITAL SOURCES There has been some confusion regarding source coding for digital sources and what we shall see later called Channel Encoding. This requirement implies that the sampling rate must be several (at least 5 ) times the Nyquist rate. Sampler x(t) xn + e(n) Quantizer ~ n = ±1 e _ ~n ˆ x Unit Delay ~n x ~n ˆ x z −1 predicted _ value Figure 2. the parameters of a linear system are transmitted along with the proper excitation signal. Discrete time sources whose output is a discrete random variable have to be encoded in a different way and for a different purpose than analog sources.5 Delta Modulation In effect the DM encoder approximates a waveform x(t ) by a linear staircase function. the term source coding when applied to analog sources implies some scheme to quantize the signal and when the source is digital the source coder and channel coder are used 17 .DM – DELTA Modulation Delta modulation can be viewed as a special case of DPCM in which a two level (1-bit) quantizer is used in conjunction with a fixed first order predictor z − 1 . Instead of transmitting the samples of the source waveform to the receiver. Linear Predictive Coding LPC This is a completely different approach to the problem of source encoding from what we have seen so far ie waveform encoding. To do this the source is modeled as a linear system (filter) which when excited by an appropriate input results in the observed output. In order for the approximation to be relatively good the waveform x(t ) must change slowly relative to the sampling rate.

Systems that use channel coding are said to employ coded waveform signaling. Higher bandwidth increases the noise introduced in the channel and if we simply increased M we would increase noise proportionally. Section 2. The redundancy introduced at the transmitter aids the receiver in decoding the desired information bearing sequence. Channel Encoding is discussed in the next section and in more detail under Error Correction. However.synonymously. We can repeat the binary digit m times where m is say 3. to lower Pe .1. So in the case of digital signals we can go directly to the channel encoding methods.2 emphasizes the analog to digital nature of source coding. So the possible source coder outputs are as shown in Figure 2. 0 Encoder 1 000 111 001 010 100 011 101 110 Figure 2. 18 . A SIMPLE EXAMPLE OF CHANNEL CODING Here is a simple example to illustrate how redundancy can be introduced. Coding results in a lower probability of error at the price of increasing the bandwidth and the complexity of the system.3 CHANNEL ENCODING In order to overcome noise and interference and to increase the reliability of the data through the channel it is necessary to introduce some redundancy to the data stream in a controlled manner. the increase in bandwidth required to transmit a coded waveform is not as much as would be needed if we simply increased M the number of symbols.6 below. One can conceive of a transmission model that employs no Channel coding at all but practical systems do use some sort of channel coding or error correction. One way to reduce the bit error rate ( Pe ) is to add more orthogonal signals (by introducing more symbols M ) but this increases the bandwidth required proportional to M . So coding is a more bandwidth efficient way to improve the bit-error rate. With coding the gain in lower Pe comes at a lower cost of noise than with increasing M .6 Simple Channel Coding A more sophisticated method is to take k bits (message) at a time and mapping this sequence to another n bit sequence called a code word see Figure 3. The Communication model in Figure 2.

A modern day example of this coding is the Huffman code (1952). the probabilities of occurrence of the source letters are used in assigning the code words. There are two major classes of codes 1. introducing a memory (in the case of sliding-window) and redundancy into the signaling process. Please refer to Figure 3. Under block codes we have Fixedlength codes (Linear Codes) and Variable length codes (Non-linear codes). In the Morse code the letters that occur more frequently are assigned short code words and those that occur less frequently are assigned long code words. Sliding Block codes but I prefer the former identification. Block Codes and 2.3 for clarification and a quick synopsis of this. There is too much detail to go into here and we must move on to fixed length coding. There is an underlying concern with Variable Length coding that the received sequence must be uniquely and instantaneously decodable. what is their Hamming distance? 19 . Convolutional or Trellis Codes. FIXED LENGTH CODES (LINEAR BLOCK CODES) Say we have M possible symbols that we would like to transmit using binary digits. The process of channel coding produces modulator input symbols that are interrelated in either a block by block or sliding-window fashion.where n > k . VARIABLE LENGTH CODES (NON-LINEAR BLOCK CODES) When the source symbols are not equally probable an efficient encoding method is to use variable-length code words. This type of encoding is called entropy coding. Some textbooks classify them as 1. Block Codes and 2. So in short. Since there are M possible symbols the number of binary digits per symbol required for unique encoding when M is a power of 2 is k given as: k = log 2 M where 2 k = M and when M is not a power of 2 it is k = log 2 M + 1 Fixed length codes is the subject of Chapter 3 and this is discussed in more detail there. Fixed length codes will be discussed in more detail but first let me get the Nonlinear codes out of the way. The amount of redundancy introduced by this is measured by the ratio k / n and is called the code rate Rc . An example of such encoding is the Morse code from the 1800s. HAMMING DISTANCE The number of bit positions by which two codewords for a particular code are different is called the Hamming distance d H . Example: Given two code words c1 = 101001 and c2 = 101110.

1 1 same 0 0 same 1 1 same 0 1 Different 0 1 different 1 0 different 3 bit positions are different so d H = 3 MINIMUM HAMMING DISTANCE The minimum number of bit positions in a set in which any two codewords for a particular code are different is called the Minimum Hamming distance d H min . Return to Table of Contents TOC 20 .

Most block codes are systematic. If a code is transmitted without being altered (ie parity bits are tacked on) it is called systematic encoding shown in Figure 3. transforms each information block u into the codeword v by a static time invariant digital system G(u). A key point in block codes (as opposed to convolutional codes) is that each codeword is formed independently from other codewords.1 Systematic Block Encoder In a block code the input information sequence u is divided into blocks of length k and each block is mapped into coded vectors v of length n.1 Block Codes Block channel encoders are implemented by combinatorial circuits. Each codeword results from a unique message.1. This simple coder appends parity check digits so that the message appears unaltered in the codeword occupying the last k bits.3. The job of the encoder is to choose the n-k digits called parity check digits. Figure 3.2 Anatomy of a Codeword 21 . In this project I shall discuss only Linear and Cyclic codes while the Convolutional codes will only be mentioned in passing. An inverse circuit is used in the decoder. An (n. This mapping is independent from previous blocks (there exists no memory from one block to another).Chapter 3 ERROR CORRECTION Data is source coded in order to enable the receiver to perform error correction and the general classification of codes is shown in Figure 3. Refer to Figure 3. The decoder simply picks the last k digits to recover the message.k) block encoder over the field with N elements. Section 3. k message bits n code bits Figure 3.2.

The decoding of block codes is done using algebraic methods based on a special branch of linear algerbra called Galois 22 . Convolutional codes differ from block codes in that there are no independent codewords.Section 3.3 Class of Channel Codes There are two methods of decoding (a) algebraic and (b) probabilistic. The code rate is always k / n . Cyclic Hamming. With each step of the sliding window. Hadamard codes. The encoding process can be envisioned as a sliding window M symbols wide. The method by which convolutional codes are decoded is probabilistic and most often done using the Viterbi Algorithm. M is called the constraint length of the code and K is usually equal to 1. Cyclic Golay Figure 3. which moves over the sequence of information symbols in steps of K symbols. Hamming codes. Reed Solomon. the encoding process generates N symbols based on the M symbols visible in the window. Most Convolutional codes are nonsystematic. Golay codes BCH.2 Convolutional Codes Convolutional channel encoders are encoders with memory.

If we know the Hamming distance of a code. a (15. This is done by making the minimum Hamming distance d H min as large as possible. This is referred to as a (n. An encoder outputs a unique n-bit code for each of the 2 k possible input k − bit blocks . Section 3. Galois Field is needed only for non-binary codes (in fact the binary codes are a special case of GF with M=2). For example. 4 bits of which (15-11) are parity bits and the remaining 11 bits are data. Hamming Codes: A good example of Block codes with the special property given below are the Hamming codes. We then choose M = 2 k of these vertices as codewords. The idea of coding should be envisioned as creating an n dimensional hypercube in n dimensional space with 2 n vertices. d H min then the number of errors that can be corrected is t ≤ (d H min − 1) / 2 and the number of errors that can be detected is ≤ d H min . A linear block code is a k -dimensional linear subspace of the n -dimensional space. and Golay codes. Block length n = 2 m − 1 Number of message bits k = 2 m − m − 1 Hamming distance d H min = 3 For some integer m ≥ 3 23 .3 Block Codes in Detail In general block codes break the data stream up into k − bit blocks and (n − k ) check bits are added to these blocks. Hadamard codes. The goal is to choose parity bits to correct as many errors as possible getting as close to the theoretical limit of t ≤ (d H min − 1) / 2 while keeping the communication efficiency as high as possible (don’t use too much bandwidth). and p is a prime number. Note: 2 k < 2 n since k < n . It is true that adding more parity bits will enable the system to correct more errors but this requires more bandwidth (adding more noise) and the complexity of the hardware needed to decode longer codes increases enormously. k ) bock code. The vertices of the codewords should be chosen to be as far apart as possible to minimize the error probability.(pronounced "Galua") finite fields.11) code has 15 bit codewords. Examples of Block codes are Hamming codes. The general form of a Galois Field is GF(pM) where there are pM elements.

Some valid Hamming codes are: N K M 7 4 3 15 11 4 31 26 5 63 57 6 127 120 7 255 247 8 511 502 9 1023 1013 10 2047 2036 11 4095 4083 12 8191 8178 13 16383 16369 14 32767 32752 15 Consider the example of a (7.4) the last condition of m ≥ 2 is satisfied n = 7 = 2 m − 1 so m = 3 k = 2m − m −1 = 4 Code rate Rc = k / n = 4 / 7 Example of (7.2 Decoding Table Error in bit position No errors 1 2 3 4 5 6 7 24 .4) Hamming code.4) Hamming code.1 Code Words for (7. k ) = (7.k) = (7. Since (n.4) Syndrome 000 100 010 001 110 011 111 101 Error Pattern 0000000 1000000 0100000 0010000 0001000 0000100 0000010 0000001 Table 3.4) Hamming Code Correcting an error Here is a listing of Code words for a (n. Message Word 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Code Word 0000000 1010001 1110010 0100011 0110100 1100101 1000110 0010111 1101000 0111001 0011010 1001011 1011100 0001101 0101110 1111111 Table 3.

2 above the matrix HT 100 010 001 Is known and so s = [1100010]110 = [001] . min 25 . We realize by inspection that bit 3 is wrong. The error correction circuit needs to do this via the algorithm as follows.Now say we transmit a [1110010] and receive r = [1100010] instead. for Hamming codes d H so (d H min − 1) / 2 = (3 − 1) / 2 = 1 we can only correct 1 bit error.2 and it is [0010000] which tells us that bit 3 is in error. so we look for the error pattern for the 011 111 101 syndrome [001] in Table 3. Received vector: Error Pattern: Corrected vector original transmitted vector). 1100010 0010000 1110010 (which is the same as the =3 Since we can correct only t ≤ (d H min − 1) / 2 errors. The syndrome vector s is calculated from s = rH T In the syndrome table Table 3. To correct the error we add the received vector to the error pattern and get the corrected vector.

Message Source mi Vector Encoder Modulator xi Symbol xi(t) Transmitter Channel ˆ m Message Sink Vector Detector y DeModulator y(t) Receiver Figure 4.1 Vector Model of Communication System Encoding is the process of converting the messages from their raw form as bits into vectors of real numbers that represent the messages.1. The message source generates messages mi which are binary bits. which is a real vector (in signal space). 26 . The source must select which of the allowed messages in a finite set that the transmitter sends over the communication channel. Refer to Figure 4.1 Discrete Data Transmission A Discrete data transmission system involves transmission of one of a finite set of messages over a communication channel. and wants to communicate with the message sink at the receiver. The receiver must determine the message sent (estimate m ) and provide it to the message sink.Chapter 4 DATA MODULATION & DEMODULATION Section 4. A vector encoder converts each message mi into a symbol xi.

There is a set of possible M signal waveforms xi(t) that is in direct one-to-one correspondence with the set of M messages. This estimate from the detector is m . The Demodulator converts continuous time channel output signals back into a channel output vector y.Modulation is a procedure for converting the encoder output vectors into analog waveforms for transmission over a physical channel. the modulator is the interface device that maps the digital information into analog waveforms that match the characteristics of the channel. See Figure 4. or the carrier frequency (frequency modulation – FM). The output of the carrier modulator is a passband signal that can be represented as follows: s (t ) = Re{v(t )e j 2πfct } eqn 4.1 Where fc is the carrier frequency and v(t ) is the baseband information-bearing signal.2 Introduction to Linear Modulation Methods In analog modulation the information bearing signal is impressed onto a carrier frequency by modulating either the carrier amplitude (amplitude modulation – AM) or the carrier phase (Phase modulation – PM). When the mapping from the digital sequence {an} to waveforms is performed under the constraint that a waveform transmitted in any time interval depends on one or more previously transmitted waveforms the modulator is said to have memory otherwise if the mapping is symbol by symbol then it is called memoryless. In digital modulation the modulator maps the sequence of binary digits into a corresponding set of discrete amplitudes (PAM). or a set of discrete frequencies (FSK). The mapping is performed by taking blocks of k = log 2 M binary digits at a time from the information sequence {an} and selecting one of M waveforms for transmission over the channel. The term passband and bandpass are used interchangeably but I prefer the consistency in using passband for carrier modulated and baseband for signals that include 0 hz. 27 . In the transmission of digital information over a communication channel. its FSK version and then its PSK signal. The modulator converts the symbol vector x that represents the selected message into a continuous time (analog) waveform that the transmitter outputs into the channel.2 for an example of a binary PAM message signal. Section 4. from which the detector estimates x and thus also the message sent. In general the conversion of a discrete data signal into a continuous time analog signal is called digital modulation. or a set of discrete phases (PSK).

Figure 4.2 PAM Signal.The signal waveform v(t ) depends on the method by which the binary information sequence is mapped into either the set of discrete amplitudes or discrete phases or discrete frequencies. FSK. & PSK 28 .

..3 for M =2. The signal waveform is then... M } are the M possible signal amplitudes corresponding to the M = 2 k possible k bit blocks or symbols. Suppose the bit rate is R bits/sec then the symbol rate is R / k .PAM If the modulator maps the binary information sequence into discrete amplitudes then the method is called digital pulse amplitude modulation (PAM) or amplitude shift keying (ASK). m = 1.2..2. 4 and 8.2 Where { Am. u (t ) is a real valued signal pulse whose shape constitutes a signal design problem when there is a band limited channel. sm (t ) = Re{ Amu (t )e j 2πfct } m = 1. The symbol rate is the rate at which changes occur in the amplitude of the carrier to reflect the transmission of new information...3 PAM Constellation 29 .. Figure 4. Note that this is a one-dimensional modulation scheme. The signal space diagram of PAM is shown in Figure 4. M eqn 4.

4 Base Band PAM 30 . M ˆ And uses half the bandwidth of the DSB version...Digital PAM can also be used for transmission over a channel that does not require carrier modulation..3 Since there is no carrier this is called a baseband signal.2) sm (t ) = Re{ Amu (t )e j 2πfct } is a double sideband (DSB) signal and requires twice the channel bandwidth of the equivalent lowpass signal for transmission.. u (t ) denotes the Hilbert transform of u (t ) . Figure 4... Figure 4. In this case the signal waveform is simply Am (t ) = Amu (t ) m = 1.4 illustrates the concept graphically and shows a baseband PAM and the carrier modulated version of the same signal as a passband PAM signal is shown in Figure 4..2.2. M eqn 4.5 The PAM carrier modulated signal (eqn 4. There is a single sideband (SSB) PAM that is given by ˆ sm(t ) = Re{ Am[u (t ) ± ju (t )]e j 2πfct } m = 1..

6 for M = 2.Figure 4. and 8... This is shown in Figure 4.. Because the range of the carrier phase is 0 ≤ θ ≤ 2π .. Figure 4.6 PSK Figure 4. 4.2 for M=2. When M = 4 the phase difference works out to 90 and this is called QPSK.7 QPSK Waveform 31 .1. M − 1 . PSK is a 2 dimensional modulation scheme.5 Pass Band PAM PSK When you modulate the phase of a carrier the modulation scheme is known as Phase Shift Key (PSK) and this was shown in Figure 4. the phase of each of the M symbols is θk = 2πk / M where k = 0.

As shown in Figure 4.. 6 bits are used to map into the 64 possible symbols. 16. Furthermore.. To see why eqn 4. The resulting modulation technique is called quadrature PAM or QAM (quadrature amplitude modulation). 1 symbol takes 6 bits to represent. Abrupt changes in phase may seem like mathematical absurdities but these phase changes are actually continuos but very rapid. In Figure 4.5 it is apparent that QAM signal waveforms are a form of combined amplitude and phase modulation..7 where T is the symbol period.0) are used to find which symbol within that quadrant was transmitted.8 shows various QAM constellations and how many bits are needed to modulate the data. 8. The signal waveforms are sm (t ) = Re{( Amc + jAms )u (t )e j 2πfct } = Amcu (t ) cos 2πfct − Amsu (t ) sin 2πfct m = 1... θm = tan −1 Figure 4.4 as sm(t ) = Re{Vme jθm u (t )e j 2πfct } = Vmu (t ) cos(2πfct + θm ) where Vm = Amc 2 + Ams 2 and eqn 4. 2nd. 2 of these six bits are used to decode the quadrant (1st.. 4th).4 is a phase and amplitude modulation scheme we can re-write eqn 4. 3rd. In other words. 32 and 64.10 several different signal space diagrams for QAM are shown for M = 4.13 the first two bits (bits 5.1.2. So in the case of 64 QAM. M eqn 4.The QPSK waveform is shown in Figure 4.4) in the six bit symbol are used to decode the quadrant and the next four bits (bits 3. M eqn 4. They are always shown as abrupt in textbooks. QAM QAM modulates the phase and the amplitude of the carrier.6 where M is the total number of signal points in two dimensional space.5 Ams Amc From eqn 4. QAM is a 2 dimensional modulation scheme.2. 32 . The phase angle θm for each constellation (M) can be calculated from θm = 2π (m − 1) M m = 1. The bandwidth efficiency of PAM/SSB can also be obtained by simultaneously impressing two separate k bit symbols from the sequence {an} on two quadrature carriers cos 2πfct and sin 2πfct ..4 where Amc is the signal amplitude modulated by the cosine carrier and Ams is the signal amplitude modulated by the sine carrier..2.

8 QAM Constellations Figure 4.“Constellations” QPSK (=4-QAM) 1 symbol ➛ 2 bits 2 16-QAM 1 symbol ➛ 4 bits 4 64-QAM 1 symbol ➛ 6 bits 6 6 256-QAM 1 symbol ➛ 8 bits 8 6 Figure 4.9 Modulated Waveforms 33 .

Figure 4. Figure 4.10 Rectangular QAM Section 4.12.11 and the Demodulator is shown in Figure 4.11 Qam Modulator 34 .3 QAM Schematic The schematic of a QAM modulator is shown in Figure 4.

12 Qam Demodulator 35 .Figure 4.

4 Probability of Error in QAM Noise in the channel causes the received signal to be distorted and can lead to erroneous decoding in the demodulator. Pc as follows: 36 .15. The starting point of this discussion is the probability of error in a PAM system given by 1 M )Q( 3 Eav ) M − 1 No P M = 2(1 − eqn 4. For rectangular k constellations in which M = 2 where k is even the QAM signal constellation is M = 2k / 2 equivalent to two PAM signals on quadrature carriers each having signal points. If the constellation is not rectangular you cannot use the following equations.13 64-QAM Bit Assignment Section 4.7 and the above is related to the probability of correct decision in a M-ary QAM.Figure 4. The calculation of probability of a symbol error is based on a PAM system which extends easily into the rectangular constellation based on quadrature carriers. The signal constellation in a noisy QAM system is depicted in Figure 4.

PM = 1 − Pc = 1 − (1 − P M ) 2 Substituting eqn 4.9 PM = 1 − [1 − 2(1 − where PM = probability of symbol error in QAM M-ary M = # of symbols Eav = SNR.9 eqn 4. Now eqn 4. 3 Eav 2 1 ) ≈ 1 .0.Pc = (1 − P M ) 2 eqn 4.11 37 .1).10 is exact for k = even but if k = odd in M = 2 k we have no equivalent M ary PAM system. This is the exact form of the probability of error in a QAM system.10 3 Eav 3 Eav ) − 4Q 2 ( ) M − 1 No M − 1 No 3 Eav 3 Eav 3 Eav ) − 4Q 2 ( ) ≈ 4Q( ) M − 1 No M − 1 No M − 1 No for k = odd Further simplification 4Q( gives PM ≤ 4Q( 3 Eav ) M − 1 No eqn 4. Since the probability of making a wrong decision is 1 – probability of making the correct decision.7 into eqn 4. this has with the simplification (1 − )] M − 1 No M the effect of overestimating PM so it is okay to do so.8 where P M is the probability of a symbol error in M ary PAM with 12 the average power in each quadrature signal of the equivalent QAM system. signal energy/noise energy No Q( ) = erf function which can be calculated using a table or solved in MathCad using Q(x) = 1 – pnorm(x. PM ≤ 1 − [1 − 2Q( PM ≤ 1 − [1 − 4Q( PM ≤ 4Q( 3 Eav 3 Eav ) + 4Q 2 ( )] M − 1 No M − 1 No 1 M )Q( 3 Eav 2 )] M − 1 No eqn 4. So for k = odd we calculate an upper bound on PM .

14 PM vs SNR for QAM & PSK Figure 4.Figure 4.15 Noisy Signal Constellation The probability of error for various modulation schemes is shown in Figure 4.14 Return to Table of Contents TOC 38 .

Perhaps I should have chosen the title "Video Modem design". It is hoped that this standard will be adopted and companies can begin competing in the video modem arena. Actual implementation involves many other blocks and will be covered in detail later. However in this project the term Cable modem refers to modems used in digital cable-TV set-top boxes whose FEC (Forward Error Correction) is compliant with the IEEE802. A simple-minded view is as a modulator (at the transmitting end) and a demodulator (at the receiving end).14 in draft form this design concerns mostly with this standard. and 5. There are five major parts to a cable system: 1. The head end is the source in a central facility that broadcasts signals onto the cable network. Section 5.the distribution (or feeder) cable in the neighborhood.1). A cable modem as the term applies today is a very high-speed modem for Internet access over a cable CATV present in a lot of homes in the USA today. The term Cable modem has since the initial writing of this project changed its meaning and it was intended to refer to a highspeed video modem.2 Structure of Cable systems The basic structure of a cable system is a simple one (see Figure 5. Contrasted with the kind of modem we are used to talking about in the context of telephone line modems which are very slow indeed. called POTS modem for Plain Old Telephone Modem. The head end gathers signals from various sources such as satellite dishes and high-gain antenna.Chapter 5 Cable Modem Introduction Section 5. 4. 3.1 Definition of Cable Modem Cable Modem A cable modem is a high-speed device for digital transmission of bits over a coaxial cable.14 (not released yet). 2.the drop cable to the home and in-house wiring. 39 .the trunk cable.the headend.the set-top box equipment (consumer electronics). Other standards that may apply are the European DVB-C standards (Digital Video broadcasting) and the DAVIC standard (Digital Audio-Visual Council) which is also a European standard. Due to the availability of the IEEE802.

The subscriber drop line is taken from the distribution network by tapping the line and is no more than 150-200ft. Power is not carried beyond the distribution networks into the subscriber drop.2 and in a broader context of networks in Figure 5. This simplifies the trunk architecture and reduces the noise that is introduced. This tap is at the curb usually inside an underground service box. Where does the power for the amplifiers come from? Answer: from the cable itself! A 60V. For the same length of coax cable and fiber. This combination is called a hybrid fiber coax (HFC) shown in Figure 5. When a coax is used in the trunk the signal needs to be amplified every two thousand feet because of loss (especially at high frequencies).3. At times the power is taken from a telephone pole transformer and fed into the cable midway and this is why cable 40 . The distribution network is coax and is bridged off the trunk. This trunk amplifier in the case of an analog signal adds noise. Here is the surprising part.Figure 5.1 Cable Network The trunk network is made of a larger coax and in fact today an optical fiber is used for this. Optical transmission of digital data (fiber) can go much longer before requiring re-amplification. coax can have 500 times more attenuation than the fiber. 60Hz ac current is sent over the trunk cable (of course this is not possible if the trunk is fiber) and is taken to the trunk amplifiers. The distribution network is the “neighborhood network” and amplifiers here are called line extenders.

2 Hybrid fiber/coax network 41 .service may be interrupted during a power failure in a certain neighborhood even when the Cable Company has emergency generators. Figure 5.

3 HFC Network 42 .Figure 5.

If channel 2 is attenuated 10db in 1000ft then channel 13 will be attenuated 20db (see Figure 5. It can be seen that the trunk cable has a higher performance than the drop cable. Figure 5.6 and for that of a trunk cable see Figure 5.5).8. Oregon. It was first built in 1948 by Ed Parson of Astoria. So the attenuation at 216Mhz (channel 13) is twice that of 54Mhz (channel 2) since the frequency is four times as great.4 Coaxial Cable Figure 5. Cable does have a high loss and it depends on the frequency of interest. The logarithm of the attenuation of cable (db) varies with the square root of the frequency. For the frequency response of a drop cable see Figure 5. see Figure 5.CATV stands for Community antenna television.5 FCC Frequency Allocation 43 . The characteristic impedance of this cable is 75 Ω .7. The graphs show the attenuation for a 100ft-length cable over various frequencies. Finally a plastic sheath protects the contents from damage. It consists of a copper-clad steel center conductor inside an insulating foam dielectric material surrounded by a braided wire and/or metal foil.4 and Figure 5.

1 1 10 Frequency (Mhz) 100 3 1 10 Figure 5.1 1 10 Frequency (Mhz) 100 3 1 10 Figure 5.Drop Cable 10 Attenuation (db/100ft) 1 0.7 Trunk Cable Frequency Response 44 .6 Drop Cable Frequency Response Trunk Cable 10 Attenuation (db/100ft) 1 0.

Section 5. Figure 5.3 Cable Specifications TRUNK CABLE SPECIFICATIONS courtesy of CommScope.8 Trunk Coax Construction 45 .

46

DROP CABLE SPECIFICATIONS Cable type RG-58/U Used In Ethernet (but not recommended due to improper shielding) RG-58A/U or RG10 Base2 CSMA/CD (Thin 50 Ω 58C/U wire Ethernet) RG-59/U CATV (cable TV) 75 Ω RG-62/U IBM 3270 terminals, 93 Ω ARCnet RG stands for radio guide as the cable guides radio frequency signals. The /U means general utility. Characteristic Impedance 53.5 Ω

47

48

9 FCC Frequency Detail 49 .Figure 5.

The unit of modulation rate (also called signaling rate) is baud or symbols/sec. The relationship between Baud and bits-per-sec depends on the number of bits used to make up a symbol. Modulation rate refers to the rate at which the symbols are transmitted over the physical medium. The symbol rate (called Baud or loosely Baud rate) is about 3000 Baud. Or. Baudot (1845-1903). Modem Speed The units can be confusing to a new comer so here is a quick summary. more generally. and named after J. A symbol is a unique state of the communication channel.4 Baud. It was proposed at the International Telegraph Conference of 1927. Bit-rate.M. or 4. For example.5MBaud . set at one Morse code dot per second.5x106 Baud then it translates into 6bits / Baud 50 .14.7 seconds POTS modems are modems used for modulating digital data inside a computer onto an analog phone line. distinguishable by the receiver from all other possible states. the French engineer who constructed the first successful teleprinter. Comparison of speed of transferring a 10-Megabyte file over different modems: MODEM SPEED / TYPE 9. So the relationship between bits per sec (bps) and Baud (symbols/sec) is Baud = bps 6bits / Baud For 64 QAM Example: If we are using a 64 QAM modulation scheme and we have 27 Mbps 27 Mbps = 4.5 hours 46 minutes 24 minutes 10 minutes 52 seconds 20 seconds 8 seconds 2. the reciprocal of the duration of the shortest signaling element.8-Kbps Telephone Modem 56-Kbps Telephone Modem 128-Kbps ISDN Modem 1.3 hours 1. The unit of data rate or bit rate is bits/sec. The term "baud" was originally a unit of telegraph signaling speed. it may be one of two voltage levels on a wire for a direct digital connection or it might be the phase or frequency of a carrier or a unique combination of phase and amplitude (QAM).6-Kbps Telephone Modem 14.54-Mbps T-1 Connection 4-Mbps Cable Modem 10-Mbps Cable Modem 30-Mbps Cable Modem TRANSFER TIME 2. Data rate refers to the rate at which bits are transmitted over the physical medium.4-Kbps Telephone Modem 28. it takes 6 bits to make up a symbol. In 64 QAM which is one of the modulation schemes in the downstream Digital Video DVB-C standard and IEEE802.E.Section 5.

Computer monitors on the other hand use 480 lines and display all 480 lines from top to bottom without interlacing. Each set of odd and then even lines is scanned 30 times a sec.5 Digital TV Standards HDTV Current TV sets display 480 lines of information with the 240 odd-numbered lines being scanned from top to bottom first and then the 240 even-numbered lines are scanned next.e.A Digital TV channel bandwidth is 6Mhz (based on the current analog NTSC allocation). SDTV This is HDTV in a standard resolution comparable to the existing standard but of course digital i. The FCC has allocated the 6 Mhz band into several channels and "lent" each station an additional channel so that they may transmit both NTSC and digital signals until the year 2006 at which time they must "return" the analog channel bandwidth to FCC. High definition TV changes all that. Section 5. and green colors. Most stations in the Bay area are going to transmit some digital channel by Nov 1999. MPEG-2 Compression standard for moving images conceived by the Motion Pictures Expert Group. so around 4 digital TV channels can be safely supported in a single channel without congestion. HDTV will contain seven times more information than what today's format allows. This is called progressive format. This removes redundancy in the digitized picture matrix by using Discrete Cosine transforms. A little history is in order. an international group of industry experts set up to standardize compressed moving pictures and audio. This gives the present TV its flicker and is called the interlaced format. With compression these bit rates can be in the 27x106 bits/s range. In 51 . This 6Mhz bandwidth can accommodate 36 Mbps under the adopted ATSC standard for digital TV. This is great news for the FCC as they can sell more channels in the same space. Audiovisual signals with standard resolution can be compressed using MPEG-2 to sustainable rates of around 6 Mbps. 480 lines progressive scanning. This is why computer monitor pictures appear sharper. blue. SDTV stands for Standard Definition Television. The analog bandwidth from a HDTV camera consists of something like 30Mhz each of red. That’s nearly 100Mhz of analog signal and would require more than a gigabit (109 bits) per second of straight digital transmission if no compression was used. HDTV uses 1080 interlaced lines or 720 progressively scanned lines on a 16:9 aspect ratio screen. the minimum frames per sec are 60fps or up to 85fps in some high-end monitors. The aspect ratio of today's TV sets is 4:3. Also. In 1988 the process of creating a universal audio and video compression standard was started by the Motion Pictures Expert Group.

Each header identifies a particular application bit stream (also called an elementary bit stream). Cable companies are deploying 64-QAM (with 27 Mbps) because it maps one 27 Mhz satellite transponder capacity in one 6 Mhz channel (allocated by FCC). At the receiver. This is called the Packet Transport. The organization of a digital television transmitter-receiver pair and the location of the transport subsystem in the overall system is shown in Figure 5. data. frame-rates and resolutions necessary for specific applications.g. These different solutions are not interoperable. To ensure the support of many different equipment and chip vendors. program and system 52 . The data transport mechanism is based on the use of fixed-length packets that are identified by headers. Everyone must work within the 6 Mhz bandwidth allocated.14. Section 5. audio or video) encoding/decoding function and the transmission subsystem. The transport resides between the application (e. Quicktime and Cinepack.. which forms the payload of the packet.11. This standard is already being used in the VideoCD and CD-I products. Because of the many available bit-rates. Applications supported include video. the MPEG hardware vendors choose to support only a few of those different bit-rates. It is illustrated in Figure 5. The MPEG standard also has a major drawback. many different standards are created with one common name: MPEG.10. One way is to use the ATM network and is supported in the IEEE802.1990 the MPEG-1 standard was derived. so in order to create one standard for many different applications.5 Mbps. At its lowest layer. it is responsible for recovering the bit streams for the individual application decoders and for the corresponding error signaling. Modulation Methods Two main competitors are Quadrature amplitude modulation (QAM) and Vestigial sideband (VSB) modulation. A 16-VSB system tested by ATTC (Advanced Television Test Center) delivered 38. frame-rates and resolutions in the MPEG standard. Other competing standards are Indeo. The MPEG-2 is a more advanced standard supporting higher picture resolutions for HDTV and DVD (Digital Video Disk). audio.6 Overview of transport subsystem There are several transport methods. but only the coded bit-stream. the standard does not define a standard encoder or decoder. The MPEG-2 compressed signal rides on a mass transit-like system already developed for ATM networks. the encoder transport subsystem is responsible for formatting the encoded bits and multiplexing the different components of the program for transmission.

10 Transport packet format Figure 5.control information. etc. The elementary bit streams for video and audio are themselves wrapped in a variable-length packet structure called the packetized elementary stream (PES) before transport processing.11 Transmitter-Receiver for Digital Television 53 . and synchronization of decoding and presentation of the individual application. The PES layer provides functionality for identification. Figure 5.

The IEEE802.Section 5. The TS stands for transport stream. The next four bits are CC (continuity counter) which keeps the packet identified with the program id. Figure 5. The next field is 1 bit TEI and shows the mpeg decoder if the entire packet has an error. The next two bits are AFC (adaptation field control) which is not discussed at all in the IEEE802. The next 13 bits are the program id (PID) and is set to 0x1FFD. The next bit is TP (transport priority) and can be used in giving some packets higher priority.7 MPEG-TS Transport Stream The preferred method for video is to use the MPEG2-TS framing structure and not use the ATM format.12. The MPEG2-TS framing is shown in Figure 5. The next 2 bits are TSC (transport scrambling control) which is 00 for now (reserved).14 supports both formats.14 spec. The first octet (byte=8bits) is the SYNC field used to recognize the beginning of the transport stream. So a total of 1504 bits are used to make up an MPEG2-TS packet. This too is poorly understood and not described in the spec. Finally the payload! The next 184 octets (1472 bits) are used to deliver the payload (video data). The next bit is PUSI (payload unit start indicator) and is reserved for future use.12 MPEG-2 Frame 54 .

mixed-signal demodulator for intermediatefrequency (IF) processing. Low-End Interactive Digital Boxes At the present time it seems that most digital set-top (ST) boxes will be used for satellite transmission. These set-top boxes have a return channel to the CATV head-end station. Most boxes also have 8-bit controllers and associated memory for internal and remote control functions. The decompressed (MPEGII) video and audio signal has to be up converted to NTSC (or PAL. These ST boxes will utilize MPEG-II decompression technology to increase the number of channels possible. Key components in a basic analog set-top box include an RF tuner. The return channel is similar to the analog addressable ST box. Digital audio will range from CD-quality in the low-end box to Dolby surround sound quality in the highend boxes. Analog-Addressable Interactive Boxes A great deal of development activity is currently focused on analog-addressable interactive set-top boxes. There are audio/video amplifiers and a standard UHF channel modulator to communicate with the NTSC television set. The return channel uses Quadrature Phase Shift Keying (QPSK) or Frequency Shift Keying (FSK) demodulation techniques. and a descrambler chip. QAM is still an open standard for the cable industry promoted by a number of set-top box manufacturers such as General Instruments. bulletin boards. including pay-per-view programs.8 Set-Top Boxes Basic Analog Boxes Today set-top boxes in homes are analog and the RF signal coming in is demodulated to recover the analog signal. This return channel enables subscribers to obtain a variety of services at their fingertips. online program guides. VSB is a proprietary standard backed by Zenith. except in the case of satellite ST box which uses a conventional telephone modem. 55 . sports scores. However there are companies developing Digital ST boxes for CATV. The CATV return channel will be about 100K bps. weather and home shopping. as the true digital television receiver has not yet arrived. SECAM) for today's television. and other online services such as stock quotes. In the satellite ST box demodulation will be done with QPSK and in CATV boxes it will be QAM or Vestigial Sideband (VSB).Section 5.

Figure 5. but with transmission rates of 1. A RISC or CISC microprocessor with 16Mbytes of RAM will be common. using QPSK or FSK (in some cases). These boxes will have flexible and upgradeable features since they have microprocessors and software in them. i. The return channel will be similar to the Lowend interactive digital boxes. They will be capable of displaying 3-D graphics.High-End Interactive Digital Boxes High-end interactive digital boxes are strictly for CATV at the moment.5 Mbps.13 Digital Video Standards 56 .e.

new forms of digital audio codingoften known as "perceptual coding"-have been developed to allow the use of lower data rates with a minimum of perceived degradation of sound quality. This coder has been designed to take maximum advantage of human auditory masking in that it divides the audio spectrum of each channel into narrow frequency bands of different sizes.1 channel (surround-sound) audio standard for ATSC digital television. As a result. Digital Video broadcasting (European) Digital Video broadcasting for Cable CATV DAVIC DCT DSS DVB DVB-C 57 . Right. now also Dolby D): The approved 5. Formed to establish technical standards for advanced television systems. Email. Digital satellite system. Six discreet audio channels are used: Left. In this key respect. Internet: http://www. The bit rate can range from 56 Kbps to 640 Kbps. This makes it possible to sharply filter coding noise so that it is forced to stay very close in frequency to the frequency components of the audio signal being coded. A widely used method of data compression of digital video pictures basically by resolving blocks of the picture (usually 8 x 8 pixels) into frequencies. especially when multiple channels are required. amplitudes. An alternative to cable and analog satellite reception initially utilizing a fixed 18-inch dish focused on one or more geostationary satellites. Left Rear (or side) Surround.org/ Dolby Digital (formally Dolby AC-3. DSS typically uses MPEG-2 encoding. using approximately 13:1 compression. including digital high definition television (HDTV).Glossary of terms ATSC AC3 ATSC: Advanced Television Systems Committee. JPEG and DV depend on DCT. and colors. and related data. When moving from analog recording to a digital recording medium. one finds that the digital audio coding used yields an amount of data too immense to store or transmit economically. Center. DSS units are able to receive multiple channels of multiplexed video and audio signals as well as programming information. Digital Audio-Visual Council Discrete Cosine Transform. Right Rear (or side) Surround. Dolby's third generation audio coding algorithm (originally called AC-3) is such a coder. Reducing or eliminating coding noise wherever there are no audio signals to mask it can subjectively preserve the sound quality of the original signal. Community antenna television. optimized with respect to the frequency selectivity of human hearing. and a subwoofer. a coding system like Dolby Digital is essentially a form of very selective and Powerful noise reduction.atsc.

an international group of industry experts set up to standardize compressed moving pictures and audio. Its work follows on from that of JPEG to add interfield compression. which are analyzed during MPEG coding to give an estimate of the movement between frames. This generates the motion vectors that are then used to place the macroblocks in decoded pictures. usually four.080-line progressive formats in a 16:9 aspect ratio. In particular its work has been involved with pictures coded to the ITU-R 601 standard. MPEG-4 is intended for unrelated applications. JPEG is a standard for the data compression of still pictures (intrafield). so that video could be played from CDs.and 1. A professional organization that sets standards for American television.smpte. The main interest for the television industry is in MPEG-1 and MPEG-2.125-. http://www. however can be used to display ATSC formats on a PC National Television Standards Committee Quadrature Amplitude Modulation Quadrature Phase Shift Key Society of Motion Picture and Television Engineers. Typically 1. JPEG uses DCT and offers data compression of between two and 100 times and three levels of processing are defined: the baseline. the extra compression potentially available through similarities between successive frames of moving pictures. MPEG-2 is the basis for ATSC digital television transmission. However the quality is not sufficient for TV broadcast.HDTV JPEG MPEG MPEG-1 MPEG-2 MPEG4 NTSC QAM QPSK SMPTE High definition television. Joint Photographic Experts Group. . the data rate of CD-ROM.080. Four MPEG standards were originally planned but the accommodation of HDTV within MPEG-2 has meant that MPEG-3 is now redundant.org Return to Table of Contents TOC 58 . MPEG-1: A group of picture blocks. extended and "loss less" encoding.035-line interlace and 1.2 Mbits/sec. This was designed to work at 1. There is a debate as to whether 720-line progressive is also high definition. ISO/ITU-T. Compression standards for moving images conceived by the Motion Pictures Expert Group. Officially a format is high definition if it has at least twice the horizontal and vertical resolution of the standard signal being used. 1.

1 below. If the DAC frequency is 8B.1: The bit stream is formatted into symbols consisting of In-phase (I) and Quadrature (Q) words. D/A convert it and output an analog signal ready to be mixed up to a final radio carrier frequency of several hundred megahertz. ±5 and ±7. The desired sample rate is a function of the IF signal frequency and its bandwidth. 3 bits for the I and 3 bits for the Q. then 7 zeroes must be inserted between each symbol. BIT STREAM IN 30 Mbps I FORMAT INTO SYMBOLS ZERO PAD PULSE SHAPE FILTER Mixer Q ZERO PAD PULSE SHAPE FILTER 20 Mhz (IF=5 Mhz) DIGITAL SIN/COS OSC D/A IF SIGNAL OUT 20 Mhz CLOCK SYNTHESIZER 30 Mhz =(6bitsx5Mhz) FDAC=20 Mhz =(4 x 5Mhz) Figure 6. then a DAC frequency of 8B is needed. If the excess bandwidth of the Nyquist filter is α . The I and Q values for 64 QAM are ±1. then the DAC frequency must be at least twice (F + (1+ α )B/2). If the IF is centered at the symbol rate B. and the IF signal’s center frequency is F. The modulator described here will accept a data stream (bit stream) with a symbol rate equal to B (standing for baud) and will output a modulated QAM signal centered at an IF (intermediate frequency) equal to the symbol rate or twice the symbol rate (B or 2B). A 64-QAM symbol uses 6 input bits per symbol.1 Basic Modulator The basic functions of a QAM modulator are shown in Figure 6. The modulator will Nyquist filter (pulse shape) the QAM signal. If the DAC frequency is chosen as 4B. mix it up to be centered at either 5 MHz or 10 MHz (digital sine/cosine generator). then a DAC frequency of 4B is adequate. then the zero pad circuit must insert 3 zeroes between each symbol. A typical application would be a 5 MBaud (5 million symbols per second) 64 QAM modulator for a digital television transmitter. The pulse shape filter is typically the raised cosine pulse defined in eqn 6. ±3.1 Basic Modulator To understand the demodulator one must first understand the modulator basics.Chapter 6 Modem Design Section 6. This means that the DAC frequency must be greater than (2F + (1+ α )B). If the IF center frequency is 2B. The symbols are zero padded to generate a data stream at the desired sample rate for the final digital to analog converter (DAC). 59 .

then h(k) = p(kT/8). A lowpass filter smoothes the DAC output.1. and hence the length of the filter. The value of N. If the DAC frequency is 4B. If the DAC frequency is 8B.2 Low Pass Filter DAC frequency FDAC is calculated on the next page for our case. then the pulse filter will use the impulse response h(k) = p(kT/4) for k = -N to +N. The I/Q signal coming from the pulse shape filters is mixed up to the desired IF center frequency as shown in Figure 6. Typically N is less than 30 for a DAC frequency of 4B and is less than 60 for a DAC frequency of 8B. The real part of the mixer output is retained and sent to the DAC.1 Where α sets the excess bandwidth of the pulse and Ts is the symbol time spacing and baud rate B = 1/T.1 is sufficiently close to zero for k > N. 60 . πt απt sin cos Ts Ts p (t ) = πt 2αt 2 1 − Ts Ts eqn 6. is set so that the value of p(t) in eqn 2. The length of the filter is 2N+1. The lowpass filter’s passband extends from 0 to (F + (1+ α )B/2) and its stop band starts at FDAC .(F + (1+ α )B/2) F+(1+ α )B/2 FDAC – F-(1+ α )B/2 Figure 6.

5. A cable system uses typically α = 0. The case of α = 0 (0 excess bandwidth) is ideal low pass. then the mixer frequency is e which is simply the sequence (1.175 Mhz Stop_band (1 α ).5 p( t ) 0 0. Mhz If the DAC frequency is 4B and the IF is B.825 Stop_band = 12.13 (please see Figure 6. B 2 B 2 Stop Band starting at 3B-(1+ α )B/2 Pass_band = 7..F F (1 5 IF center frequency (Mhz) α ) . Three different raised cosine pulses are shown in Figure 6. and 1. and Figure 6. This means that the mixer only needs to make sign changes and to multiplex between the I and Q filter outputs.).5. 0. sin(x)/x response.B ) DAC = Rajat Sewal DAC_freq.DAC Frequency α 0. j.1). Figure 6..13 ( 2 .B (1 α ).13 61 . 1 π j n 4 0.3 Raised Cosine Pulse α = 0. the case of α = 0. j.65 4B = 20 Mhz.5 (50% excess bandwidth) is a realistic filter with some trade-off between excess bandwidth and pulse rate.5 10 5 0 5 10 Figure 6. or if the DAC frequency is 8B and the IF is 2B..3 and Table 6.mcd B 5 Baud rate (Mhz) Dac_freq Dac_freq = 15. The case of α = 1 is called full cosine roll-off and the excess bandwidth is 100%.6 for α = 0 . Also Mhz so we can use 20 Mhz ie F note that F=B Low Pass Filter Pass Band from 0 to (B+(1+ α )B/2 Pass_band B 3 . -1.4 .

4 Raised Cosine Pulse α = 0 (ideal low pass) 1 0 t 5 10 0.5 10 5 t 0 5 10 Figure 6.6 Full Raised Cosine Pulse α = 1 62 .5 Raised Cosine Pulse α = 0.5 10 5 0 5 10 t Figure 6.5 p(t) 0 0.5 10 5 Figure 6.5 p( t ) 0 0.5 p( t ) 0 0.5 1 0.1 0.

The FET has to be large to be able to switch quickly but a large FET area means more gate to source/drain coupling. The ADC is a 10 bit fast sampling device and considerable design effort goes into this component.Section 6. low-pass filtering operation without adding any noise. Figure 6. It is kept away from any hot components to keep its Johnson noise to a minimum. This adds more demands on the modem design. The architecture of a 64 QAM modem is shown in Figure 6.05Mbaud for 64 QAM. This allows the ADC to have a good dynamic range as the input signal amplitude may vary considerably.7. as it is a passive device.7 QAM Architecture The RF input (88Mhz to 860Mhz in USA) has several 6Mhz bandwidth channels and is the cable input to the subscriber and carries digital RF modulated signals which are down-converted (carrier is stripped off) and filtered by a SAW (surface acoustic wave) filter in the tuner. This conflicting requirement has been a real challenge for design engineers and some clever 63 . The output is then fed into an AGC circuit whose gain is controlled by the output of the ADC (analog to digital converter).14 standard (in development) and is 5. A SAW filter is simply an analog version of a FIR filter but is made from a piezoelectric material on a ceramic substrate. The only drawback is that it has some insertion loss. The SAW filter performs a very sharp cut-off. The charge couples into the drain/source circuitry and results in errors in the storage element. Because of its high bandwidth efficiency quadrature amplitude modulation has become the established modulation scheme for digital high-capacity modems. The symbol rate has to be in accordance with the IEEE802.2 Modem Specification A video modem processing an MPEG2-TS stream has to be fast because it is not only processing high-speed video data but also the overhead bits used in synchronizing and other housekeeping tasks. One difficult part of the ADC design is that the sampling FET introduces noise current as charge is rapidly pulled in and out of its gate.

These are demodulated by a cosine and a sine wave signal generated by the symbol timing recovery circuits. For high performance transmission equalization is necessary after the demodulation to compensate for the dispersive fading of the transmission channel (cable exhibits loss at high frequencies). 1 symbol takes 6 bits to represent.0) are used to find which symbol within that quadrant was transmitted. 2 of these six bits are used to decode the quadrant (1st. Motorola 56000. signal energy/noise energy No Q( ) = erf function which can be calculated using a table The block diagram of a 64-QAM from National Semiconductor is shown in Figure 6.ways have been developed to try and reduce this effect. The output of the ADC now contains the in-phase and quadrature components of the baseband QAM modulated signal. The probability of error for a rectangular constellation is repeated here: PM = 1 − [1 − 2(1 − where PM = probability of symbol error in QAM M-ary M = # of symbols Eav = SNR. 2nd. 4th). Furthermore. Recall that in the case of 64 QAM.2 . The amount of computation necessary in the tap coefficient updates (multiply and accumulate) far exceeds the capabilities of programmable DSP chips (such as TI 320 series. Analog Devices 2600 series and Intel i860). The multiplier time using pipelined multipliers that I have seen are 10ns. Another area of the design that has been a challenge is controlling the phase jitter of the PLL driver to the ADC sampling circuit.13 the first two bits (bits 5. In other words. These DSP chips (processors) are good for up to 100K Baud. If the clock driving the PLL has jitter or the PLL itself introduces jitter noise then the ADC sampling is in real trouble and the accuracy of the ADC is effected directly.8 and it shows a more practical view down to the external input/output pins.1. 64 1 M )Q( 3 Eav 2 )] M − 1 No eqn 6. if the IF is at 2B then ADC sampling is done at 8B. 6 bits are used to map into the 64 possible symbols. If the IF is centered around symbol rate B then the ADC sampling is done at 4B.4) in the six bit symbol are used to decode the quadrant and the next four bits (bits 3. Above 100K Baud one must design custom chips (ASICS) that are fully optimized for high computation rates to support rates as high as 35 M Baud. The sampling frequency of the ADC depends on whether the IF frequency (Intermediate frequency) is centered at the symbol rate B or twice the symbol rate. This level of performance requires pipelining and large multipliers. 3rd.2. As shown in Figure 4. 2B.

Figure 6.8 National Semiconductor-QAM Schematic 65 .The demodulator is controllable from an external microprocessor via a serial interface.

19.14 supports three physical layer (PHY) formats A.13 Modulation rate: 5. PHY Type A 64QAM & 256 QAM 8 Mhz Channel BW FEC is Reed Solomon Spectral roll-off α = 0.31 Mbaud Figure 6.15 Modulation rate: 6~6.Section 6.0 ~ 5.9 Type C PHY Return to Table of Contents TOC 66 .12 64QAM: 5.952 Mbaud PHY Type B 64QAM & 256 QAM 6 Mhz Channel BW FEC is RS for outer and Trellis (TCM) for inner symbols ie concatenated Spectral roll-off 64QAM: α = 0. B and C as shown in the table below.18 256QAM: α = 0.3 IEEE802. 5.14 Specification The IEEE802.05 Mbaud 256QAM: 5.1 PHY Formats PHY Type C (USA) 64QAM & 256 QAM 6 Mhz Channel BW FEC is Reed Solomon Spectral roll-off α = 0.36 Mbaud Table 6.

1 Version 2. I did not have access to the DSP Blocksets toolbox unfortunately.Chapter 7 Matlab Simulation Section 7.2 Version 1. The version of Matlab I used is listed here: MATLAB Toolbox Communications Toolbox Signal Processing Toolbox Simulink Version 5.1 Communication Tool Box The modem is simulated using the Communication ToolBox of Matlab.2 18-Dec-1997 01-Dec-1997 21-Nov-1997 21-Nov-1997 67 . such as equalizers and carrier recovery blocks. The communication toolbox from Matlab allows one to design a high level system without having to design every single lower level function.3 Version 4. A higher level of abstraction gives the designer mobility in choosing various system parameters and try out different scenarios in a shorter time. There is another toolbox called DSP Blocksets which has larger blocks built in.

0=No]: '). %Sample Rate or sample freq Fs.0 Display Ber vs Eb_No curve % 10/27/98 4.1.0 Added channel impairment % 10/26/98 3.15. K=6.0 Added RS Error correction with prompt % 10/27/98 5.0 Prompt for code word length N & log start/stop time % % Initialization fprintf('Clearing all variables.0 Fixed some errors in data lengths % 10/28/98 6.2 Matlab Code The matlab code is shown in the next few pages and to understand the code you need to refer to Figure 7. % %Error-control coding use_reed_solomon=input('Do you want Reed Solomon error correction?[1=Yes.---------------------------% 7/11/98 1.0=No]: ').m % % This program simulates a 64 QAM Modem % % Date Revision History % ------. end fprintf('Do you want extra graphs of Mapped Data... This is the rate Matlab samples the analog signals because after all the computer cannot sample infinitely fast to simulate an analog signal.& QASk Constellation?[1=Yes. % N=(2^M)-1. XMIT Filtered output\n'). Fs=100. 68 . FFT of RCVR Filt. %assign Carrier Frequency Fc=10. % EE297 Project Rajat Sewal % File Name : qam64. This frequency has more to do with the computer than the modem itself.Section 7.31: '). say 7. N=7. Check bits = N-K % start_time=clock.\n') clear all %symbol rate.0 Prompt for extra graphs and zoom in Eb_No curve % 10/29/98 7.-------. digital transfer frequency Fd Fd=1. if use_reed_solomon==1 N=input('Enter code word length {N=2^M-1}.0 Started writing code % 10/24/98 2. extra_graphs=input('RF Data. the system block diagram.

1.0.15. % note: 2^6=64 QAM Data_length=[10 10 10 10 10 10 10]*N*bits_per_symbol*K.0.Fd.'rs').Fs..0.01].13).1.K.'qam').5... % Calculate signal and noise energy signal_energy=transmit_rf' * transmit_rf / length(transmit_rf). %%%%%%%%%% Transmit Raised Cosine shaping %%%%%%%%%% filtered_data=rcosflt(mapped_data.0.1) * noise_var(i). noisy_rf_signal=transmit_rf + noise_gaussian.Fd.1. % encode data else coded_data = bits. Eb_No(i)= signal_energy/noise_energy.0. fprintf('adding AWGN with variance: %2.Fs/50.Fc.bits_per_symbol)). % Reed Solomon Encoding % if use_reed_solomon==1 coded_data = encode(bits. noise_energy=noise_gaussian' * noise_gaussian / length(noise_gaussian). % don't encode data end % Generate symbols (0 to 63) from binary bits (0. % for i=1:length(Data_length) % the message source bits = randint(Data_length(i).1. 69 . ') noise_var=[2.3.%QAM bits/symbol Specification bits_per_symbol=6.0.2). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%% CHANNEL NOISE %%%%%%%%%%%%%%% %%%%%%%%%% Channel Impairment Section %%%%%%%%%%%%% % Add AWGN noise and compute Eb/No %fprintf('adding AWGN.N.'fir/sqrt'.2.'qask'.) symbols=bi2de(vec2mat(coded_data.1..1.0. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%% QAM MODULATION & %%%%%%%%%%%% %%%%%%% Analog Upconversion to communication channel transmit_rf = amod(filtered_data. % Digital to analog signal mapping mapped_data = modmap(symbols.Fs.noise_var(i)) %Additive noise variance noise_gaussian=randn(length(transmit_rf).64).1d\n'.

demod_bit).Fs. plot(transmit_rf).N. %%%%% Received Matched filter .'fir/sqrt'.^y_data.log10(BER).title('FFT of RCVR filter output').bits_per_symbol)'. 4). %%%%%% Decimate results by taking every 1/Fs sample %%%%%%%%% % decimate to subsample the Matlab rcosflt output exp_ana_data_i = decimate(rx_ana_data(:. Eb_No(find(BER==0))=[]. [numb(i).%%%%%%%%%%% QAM 64 RECEIVER %%%%%%%%%%%%%%%% % analog demodulation of carrier and qam signal analog_rx=ademod(noisy_rf_signal. BER(find(BER==0))=[].title('Mapped Data').'bo') 70 .log10(x_axis)). plot(abs(fft(rx_ana_data))). ber_array(i. exp_ana_data_q = decimate(rx_ana_data(:.figure. plot(filtered_data).figure.Fd. % % Reed Solomon Decoding % if use_reed_solomon==1 decoded_bits = decode(demod_bit.BER(i)]=biterr(decoded_bits(:).bits).0.1)=BER(i) end %%%%%%%%%%%%%%%% Extra Graphs %%%%%%%%%%%%%%%% if extra_graphs==1 plot(mapped_data). 4). qaskenco(slicer.Fs/50.20).figure. %%%%%%%%%%%%%%%%% SLICER %%%%%%%%%%%%%%%%% slicer=demodmap([exp_ana_data_i exp_ana_data_q]. y_data=spline(log10(Eb_No).1).2). % plot received symbols on constellation end %%%%%%%%%%%%%%% BER PLOTS %%%%%%%%%%%%%%%%%% % Curve fitting using Spline function x_axis=logspace(log10(min(Eb_No)). else decoded_bits = demod_bit.Fd.K. %%%%%%%%% decode symbols into bits %%%%%%%%%%%%% demod_bit=de2bi(slicer.64). end % %%%%%%%%%%%%%% BER Tests %%%%%%%%%%%%%%%%%% %err = symerr(bits.'rs').log10(max(Eb_No)).Eb_No.'qask'. demod_bit=demod_bit(:). % %plot results figure loglog(x_axis.Fs.'qam').Raised Cosine %%%%%%%%%%%% % with excess bandwidth = 0.Fc.13 rx_ana_data=rcosflt(analog_rx.10.title('RF data').13).'b-'.title('XMIT Filtered Data').64).BER.figure.

xlabel('Eb/No') ylabel('BER') % next line added to fix the xy axis scales axis([1 1E4 1E-12 1]); if use_reed_solomon==1 title([num2str(2^bits_per_symbol),'-ary QASK with [',num2str(N),',',num2str(K),'] Reed Solomon simulation result']) grid; else title([num2str(2^bits_per_symbol),'-ary QASK Simulation result']) grid; end zoom fprintf('Select area to zoom in and right click to zoom out\n') stop_time=clock; elapsed_time=stop_time - start_time %%%%%%%%%%%%%%%%%% END %%%%%%%%%%%%%%%%%%

71

DATA SOURCE

bits

ENCODE Reed Solomon

coded_data

VEC2MAT

BI2DE

symbols

MODMAP

mapped_dat a

mapped_dat a

filtered_data RCOSFLT AMOD

transmit_rf

noisy_rf_signal ADEMOD

analog_rx RCOSFLT

noise_gaussia n NOISE rx_ana_data rx_ana_da ta

DECIMATE

exp_ana_data i

slicer DEMODMAP

DE2BI

demod_bi t

DECODE Reed Solomon

decoded_bits

DECIMATE exp_ana_data_ q

Figure 7.1 QAM -Matlab System

72

**Section 7.3 Discussion of Matlab Code
**

The user launches Matlab and then types the name of the program “qam64”. The program then prompts the user to activate the Reed Solomon error correction block or bypass correction. If the user selects Reed Solomon error correction then he is asked to input the code word length N. There is a rule for selecting N and it is N = 2 M − 1 where M = 3, 4, 5, 6 etc. M cannot be less than 3. Here is a list of valid N = 7, 15, 31, 63 based on the four values of M listed above. If Reed Solomon is not selected then N defaults to 7 so that we get a reasonable Data_length. Then the program prompts for extra graphs and if one chooses not to display them, a graph of BER vs EB/No is displayed at the end anyway. Random data is then generated with a function called RANDINT, which has the format: RANDINT Random integer matrix generator. OUT = RANDINT(N,M,RANGE) generates an N-by-M matrix of random binary numbers in the RANGE. The appearance of "0" and "1" have even probability. When RANGE is a scalar positive integer, the output integer range is [0, RANGE-1]. In my program I have: bits = randint(Data_length(i),1,2); Since Data_length is defined earlier on as Data_length=[10 10 10 10 10 10 10]*N*bits_per_symbol*K; It takes on the value depending on N, bits_per_symbol, and K. The value of bits_per_symbol is 6 in accordance with 64-QAM. The value of K is 6. So Data_length comes out to be 360N. However coding changes that as discussed below. The program runs through its entire course 7 times (Data_length). So if we wanted to increase the number of loops we simply increase the length of Data_length by adding another 10. The program is designed so that for each set of “runs” out of the 7 runs it generates and pushes as many bits as dictated by the following algorithm:

N 31 bits_per_symbol 10.N .K .bits_per_symbol data_length uncoded_data_length . (N bits_per_symbol 6 K 6 Data_length.mcd RajatSewal

data_length

data_length = 11160 uncoded_data_length = 11160 K) uncoded_data_length

uncoded_data_length coded_data_length

coded_data_length = 57660

73

1. K. The code word length is N and the message length is K.Using the above equations the coded_data_length with several values of N are tabulated in Table 7. The format of MSG can be either a vector or K column matrix.M . This data is then sent to a block called VEC2MAT described next: VEC2MAT Vector to matrix conversion. The format of the function “encode” is: ENCODE Error-control code encoding computation. N 7 15 31 63 (uncoded) Data_length=360*N 2520 5400 11160 22680 Coded Data Length 2940 13500 57660 238140 Table 7. M) converts VEC to be an M column matrix with row priority arrangement. This step is followed by a conversion from binary to decimal format: 74 . METHOD) Encodes the binary message specified in MSG using the coding technique in METHOD. 'cyclic' Cyclic code. 'bch' Binary BCH code. After coding the data is called “coded_data” and is still binary data. MAT = VEC2MAT(VEC. Hamming code is a single error-correction code.1. This is then Reed Solomon encoded if the choice was made or left un-encoded. In my program the usage is: coded_data = encode(bits.1 Data Lengths So “bits” contains Data_length number of binary data (0110001010101010…). The METHOD can be 'hamming' Hamming code. the output CODE is an N-column matrix. or 'convol' Convolution code. 'linear' Linear block code. 'rs' Reed-Solomon code. A code has code word length 2^M -1.K. If it needs to add an element.bits_per_symbol)). The message length is 2^M .N.'rs'). Where bits_per_symbol=6 so that the output of vec2mat is a binary data of 6 column matrix partitioned symbol by symbol. where M is an integer no less than 3. In my program the usage is: symbols=bi2de(vec2mat(coded_data. When MSG is a K-column matrix. 0 will be added to the end of the input vector to form the required matrix. N. CODE = ENCODE(MSG.

'qask'. Y is a column vector instead of a matrix. For example bi2de([1 0]) results in 1. 75 .bits_per_symbol)). 'qask' M-ary Quadrature amplitude shift-keying Modulation. 'msk' Minimum shift keying modulation.13 . R) filters the input signal X using raised cosine (R-C) FIR filter. MODMAP Maps a digital signal to an analog signal for modulation. This is the RCOSFLT ie raised cosine filter with excess bandwidth α = 0. the output D is a column vector with each element being the transfer of a row of B. METHOD. ± 3. Fd. When B is a matrix.5 but must a real number in the range [0. The first element in B represents the lowest binary bit. The modmap function is described next. 1]. Y = MODMAP(X. Y = RCOSFLT(X. This function does mapping only. ± 5. 'psk' M-ary Phase shift keying modulation. D = BI2DE(B) converts a binary representation vector B to a decimal representation D.64) The next block is the filter block to pulse-shape the symbols that are to be transmitted. The sample frequency for X is Fd (Hz).Fs.M) maps a sample frequency Fd (Hz) signal vector X into a sample frequency Fs (Hz) in-phase and quadrature components in Y. Fs. The rolloff factor R has a default of 0. In my program the usage is: mapped_data = modmap(symbols. The first column is an in-phase component and second column is a quadrature component. 'sample' Up sample the input signal. METHOD is a string. bi2de([0 1]) results in 2. The format is shown next: RCOSFLT Filters the input signal using raised cosine filter. Fs must be larger than Fd.symbols=bi2de(vec2mat(coded_data. 'fsk' M-ary Frequency shift keying modulation. Fs. Y is a two column matrix. TYPE_FLAG. When METHOD = 'ask'. in contrast to 'qart'. which can be one of the following: 'ask' M-ary Amplitude shift keying modulation. The next step is to take the “symbols” vector and run it into MODMAP which maps the decimal formatted numbers into their equivalent QAM symbol constellation coordinates ( ± 1.Fd. which can be one of the following: 'fir' Use FIR R-C filter (default). TYPE_FLAG is a string. So now symbols is a decimal grouping of numbers from 0 to 63. Here is the format of the bi2de command: BI2DE Converts binary to decimal format. 'iir' Use IIR R-C filter. The sample frequency for Y is Fs. and ± 7). Fs/Fd must be an integer. 'normal' Use normal R-C filter (default). Fd. M defines the M-ary number of a square constellation when METHOD is qask.

METHOD is a string.'sqrt' Use square root raised cosine filter. In this case.1. The value DELAY is a default of 3. The function default has had the delay cut off from the output.5. Fs. double sideband with transmission carrier 'amdsb-sc' Amplitude modulation. RANDN Normally distributed random numbers. The time interval between two successive points in X is 1/Fs.'qam') Now the signal goes through an ideal channel with AWGN (additive white gaussian noise) added at the input of the receiver. AMOD Analog signal modulation. METHOD) modulates the message signal X with carrier frequency Fc (in Hz) and sample frequency Fs (Hz) using the modulation scheme in string variable METHOD.'fir/sqrt'. 'Fs' X is input with sample frequency Fs.0.01] Here the length of the noise_var matrix is 7 elements long to match the way the program is designed: it loops through the entire program 7 times picking the first noise variance of 2 and then moving on to smaller and smaller noise till it gets to 0. First we define a noise variance matrix called noise_var noise_var=[2. Fc.0.15. In my program the usage is: filtered_data=rcosflt(mapped_data.Fc. All others are discarded. which can be one of the following: 'amdsb-tc' Amplitude modulation. When Fs is a two-element vector.0.13) The next section is the last part of the transmitter and is AMOD (analog modulator).Fs.Fs/50. the second element specifies the initial phase in the carrier signal modulation.Fd. For best results.3. The unit of the initial phase is rad. in the case the row number (or vector length) of Y is (length_of_X + DELAY)*Fs/Fd. The code that generates the random noise is discussed next. Y = AMOD(X. 'wdelay' Keep the full length of the filtered result.0. double sideband suppressed carrier 'amssb' Amplitude modulation. 76 .:) are used in the calculation. single sideband suppressed carrier 'qam' Quadrature amplitude modulation 'fm' Frequency modulation 'pm' Phase modulation In my program the usage is: transmit_rf = amod(filtered_data.2. Fs > Fc is required (by Nyquist theory). only elements X(i*Fs/Fd+1.0.01.1. The function that is used in generating noise is RANDN.

which is the demodulated analog baseband QAM signal. DECIMATE filters the data with an eighth order Chebyshev type I lowpass filter with cutoff frequency . METHOD. RANDN produces pseudo-random numbers.64) Z = DEMODMAP(Y. This is done with inverse function of modmap ie. DEMODMAP described next.RANDN(M. Another raised cosine filter (Receive Filter) is used here in the filter block “rcosflt”. The output of the ADEMOD is analog_rx. Fs.’qask’. DECIMATE Resample data at a lower rate after lowpass filtering. In my program the usage is: exp_ana_data_i = decimate(rx_ana_data(:. Y is a two column matrix 77 .R) resamples the sequence in vector X at 1/R times the original sample rate. 4) The next step is to do a demapping of the exp_ana_data_i and exp_ana_data_q signals so that the symbol value is extracted. we need to decimate this data at the same rate using the DECIMATE blocks. The sampling frequency for Y is Fs (Hz) and the digital sampling frequency is Fd (Hz).1) * noise_var(i) The noise is then added to the tranmitted rf signal: noisy_rf_signal = transmit_rf + noise_gaussian Now we enter the receiver with “noisy_rf_signal” and process it with ADEMOD (analog demodualtor) which is the opposite function of AMOD. The sequence of numbers generated is determined by the state of the generator.Fd. The output of the RCVR filter is rx_ana_data and since the XMIT filtering operation had interpolated data.2). Fd.Fs. The resulting resampled vector Y is R times shorter. This function demaps a sampling frequency Fs (Hz) analog signal into a sampling frequency Fd (Hz) digital signal Z. The command is described next.M) is a reverse mapping of function MODMAP.1). 4) exp_ana_data_q = decimate(rx_ana_data(:.8*(Fs/2)/R. We decimate the in-phase and quadrature portions separately. In my program the usage is: noise_gaussian=randn(length(transmit_rf). before resampling.N) is an M-by-N matrix with random entries. LENGTH(Y) = LENGTH(X)/R. This signal needs to be filtered to remove any carrier components and to reduce intersymbol interference (ISI). DEMODMAP Demaps a modulation mapped signal to the closest digit number. slicer = demodmap([exp_ana_data_i exp_ana_data_q]. Y = DECIMATE(X.

For example DE2BI(1. The demapping process finds the distance from the sample value to all of the possible digital symbols.’qask’.where the first column is an in-phase component and second column is a quadrature component. In my program the usage is: demod_bit=de2bi(slicer.METHOD) decodes binary codeword in CODE using decode METHOD. This is done in an if statement: if use_reed_solomon==1 decoded_bits = decode(demod_bit.Fd. The format of CODE can be either a vector or an N column matrix. MSG = DECODE(CODE. or 'msk'. This function is described next. else decoded_bits = demod_bit. K. The offset timing in the plot is offset/Fs.'rs'). The digital symbols with the shortest distance to the current sampling point is the demodulated output.N. This is done with the command demod_bit=demod_bit(:) The next step is to decode with Reed Solomon algorithm if encoded. The sample value holds until time (i+1)/Fd +offset/Fs when the next sample point is taken. the second element is the offset value for the decision point. Y is a one column vector instead of a matrix. When Fd is a two element vector. The first element in B represents the lowest binary bit. When METHOD = 'ask'.K. 2) results in [1 0].64) The output “slicer” is then sent to a decimal to binary converter so that the binary bits can be recovered. end DECODE Error-control code decoding computation. The code word length is N and the message length is K. The default offset is 0.bits_per_symbol) The next step is to take all the columns of demod_bit and convert them into one single column so we have a string of bits in one column. N) specifies the column number for matrix B.Fs. The received digital signal is sampled at time i/Fd + offset/Fs. B = DE2BI(D. DE2BI Converts positive decimal numbers to binary numbers. 'fsk'. METHOD ENCODE SCHEME 78 . N. N is a positive scalar number. DE2BI(2) results in [0 1]. In my program the usage is: slicer = demodmap([exp_ana_data_i exp_ana_data_q].

In my program the usage is: [numb(i). CODE can also be a non-negative integer in the range of [0. The ratio of NUMBER to the total bit number contained in Y is output in RATIO. When the format of the input CODE is not the same as the output of function ENCODE. Signal and noise energy is calculated using signal_energy=transmit_rf' * transmit_rf / length(transmit_rf) noise_energy=noise_gaussian' * noise_gaussian / length(noise_gaussian) and SNR is calculated using: Eb_No(i)= signal_energy/noise_energy. M is an integer >= 3. L = M. For example. 79 . Except for the 'rs' method. In using the "rs" method. The number of the bit differences is outputted in NUMBER. L equals N. K is the smallest integer satisfying MAX < 2^K.bits). The next step is to take decoded_bits and perform BER (bit error tests) and graph the results. where N = 2^M . When X or Y is a matrix and the other is a vector. you have to add '/decimal' in the method specification. Y) compares the elements in the input matrices X and Y.1. 'bch' is equivalent to 'bch/binary'. where MAX is the maximum number in both X and Y.'hamming' 'linear' 'cyclic' 'bch' 'rs' 'convol' Hamming code Linear block code Cyclic code BCH code Reed-Solomon code Convolution code In using methods other than the "rs" method. The BER tests are done with a function called biterr BITERR Computes bit error.BER(i)]=biterr(decoded_bits(:). 2^L-1]. All elements in X and Y should be non-negative integers. the output MSG is a Kcolumn matrix. MSG can only be a vector when using the decimal method. [NUMBER. this function stops processing. The total bit number in Y is estimated by column_y * row_y * K. The format of MSG matches the format of CODE. When CODE is a N-column matrix. where K is the bit number for each element in Y. The output MSG contains the decoded message. In this case. this function convert the vectors to a matrix with the column number the same as the matrix before the comparison. RATIO] = BITERR(X. 'bch/decimal' means the data in MSG is binary.

noise_var=[2.0.2 No Error Correction 80 .1.Section 7. Values that are zero (no single error) are not shown because this is a log scale and it does not go below 1x10-12.15. since No error correction selected.0798 0.3.4 Discussion of Simulation Results The data beside the graph is the bit error array produced for 7 different noise variances.0004 0 0 0 BER 64-ary QASK Simulation result 10 0 10 -2 10 -4 10 -6 10 -8 10 -10 10 -12 10 0 10 1 10 Eb/No 2 10 3 10 4 Figure 7. The bit error is logged into an array called ber_array and each point is plotted using a sophisticated algorithm called “spline” for curve fitting.1246 0. number of bits = 2520.0. each time picking a new noise variance from the array shown above.2.1. The circles on the graph are the data points in the ber_array.0.5. Bits pushed = 2520 x 7 = 17. Data_length=[10 10 10 10 10 10 10]*N*bits_per_symbol*K. CASE 1 N=7 (default).0.0444 0.01]. The program runs through 7 times.640 ber_array = 0.

Bits pushed = 2940 x 7 = 20.0353 0 0 0 0 BER 0 64-ary QASK with [7.6] Reed Solomon simulation result 10 10 -2 10 -4 10 -6 10 -8 10 -10 10 -12 10 0 10 1 10 Eb/No 2 10 3 10 4 Figure 7. number of bits (coded) = 2940 Correction bits = N-K=7-6=1. Reed Solomon error correction selected.1187 0.CASE 2 N=7 .3 Error Correction N=7 81 .580 ber_array = 0.0857 0.

4 Error Correction N=15 82 .500. Bits pushed = 13.0104 0 0 0 0 BER 10 0 64-ary QASK with [15.CASE 3 N=15 .500 Correction bits = N-K=15-6=9 ber_array = 0. Reed Solomon error correction selected.500 x 7 = 94. number of bits (coded) = 13.6] Reed Solomon simulation result 10 -2 10 -4 10 -6 10 -8 10 -10 10 -12 10 0 10 1 10 Eb/No 2 10 3 10 4 Figure 7.1385 0.0617 0.

0002 0 0 0 0 BER 10 0 64-ary QASK with [31. number of bits (coded) = 57.620 Correction bits = N-K=31-6=25 ber_array = 0. Reed Solomon error correction selected. Bits pushed = 57.660 x 7 = 403.0461 0.CASE 4 N=31 .660.1228 0.5 Error Correction N=31 83 .6] Reed Solomon simulation result 10 -2 10 -4 10 -6 10 -8 10 -10 10 -12 10 0 10 1 10 Eb/No 2 10 3 10 4 Figure 7.

6 XMIT Filtered Data Figure 7.10 84 . In this mode the following graphs are displayed: • • • • • Mapped Data Figure 7.640 Additional graphs selected. No error correction selected.8 FFT of RCVR Filter Figure 7.CASE 5 N=7 . number of bits pushed = 2520 x 7 = 17.9 QASK Constellation Figure 7.7 RF Data Figure 7.

Figure 7.6 Mapped Data 85 .

Figure 7.7 XMIT Filtered Data 86 .

Figure 7.8 RF Data 87 .

9 FFT of RCVR Filter Output 88 .Figure 7.

10 QASK Constellation 89 .Figure 7.

The carrier recovery in the ADEMOD function is direct.0798 0.0857 0. k ) = (N .0444 0.1246 0.0353 0 0 0 0 CASE 3 Reed Solomon N=15 0. However.0002 0 0 0 0 Table 7.Section 7. CASE 1 No Error Correction 1 2 3 4 5 6 7 0.1385 0. The model picks up Fc directly from the transmitter.2.4. Matlab allows one to do the baseband simulation in Simulink and although I have familiarity with it I did not use a Simulink model in this project. The values of BER = 0 mean no bits were in error and is not a result of rounding off in the calculations. How N is picked is very important and the rule is N = 2 M − 1 where M = 3. Increasing N does come at a cost of reduced source rate. and 63 respectively. The error correction algorithm used in cases 2-4 is the Reed Solomon with (n. 64 Mbyte of SD Ram) ran out of resources after 32 hrs.0004 0 0 0 CASE 2 Reed Solomon N=7 0.5 Summary of Simulation Results The simulation results are summarized in Table 7.1187 0. where k is the message length and N is the code word length.0461 0.6 resulting in N = 7. I actually ran N = 63 and the computer (233Mhz Pentium. The total number of bits I was trying to push through the modem was 1.0104 0 0 0 0 CASE 4 Reed Solomon N=31 0. The filters also have to be complex. The value of BER is a ratio not a percentage (so BER = 0.1228 0. The simulation times can be large for N=31 and can range somewhere around 8-12hrs depending on the machine. there is improvement in the BER performance as the value of N increases because more and more redundancy is added as correction bits (N-K) increases.6) . 90 . the baseband simulation involves using the complex envelope of the Qam signals and the math can be complex. 31. The effect of increasing the code word length on the bit error rate is explored.980 bits.44%).0617 0. Carrier Phase offsets can be modeled by the ADEMOD function call by specifying the phase offset but I let it run with zero phase offset. A factor in simulation speed is whether one is doing a passband simulation or a baseband simulation of a passband system. The later runs much faster because it does not involve a carrier (less computation on the part of the computer).666. 15.2 BER Summary As can be seen going across any row.0444 is 4.5. My model does not have an equalizer because the channel I was using is an ideal channel corrupted by AWGN and this cannot be equalized.

In parallel to chip synthesis. The design should also be checked with a static timing analyzer tool (Design Compiler by Synopsys) to verify that worst-case paths (which are hard to simulate) meet timing. After full ASIC-level integration has been completed. The regression tests verify the functionality of the behavioral code. Each designer is responsible for the functionality of his/her assigned sections. Typically. most of the hardware design work is implemented in ASICs. This process converts the Verilog RTL (register transfer level) behavioral code to the actual chip netlist for the targeted ASIC library. The average turn time for designs ranging 91 .Chapter 8 Set-top Box ASIC Design For a set-top terminal.000 gates. then later optimized and integrated when synthesizing at the full chip level. Functionality is then rechecked with the regression tests. The document contains high-level block diagrams. The design is simulated and each code block is verified at the module level. and customer requirements phase. and later can be used to verify the gate-level implementation. and architecture descriptions for the modules contained in the ASIC. Motive static timing analyzers. design teams can be assembled to complete the task of designing and fabricating the product ASICs. Once the design meets timing and functionality with pre-layout estimated timing. Chronologic Verilog simulators. the design can be back annotated with estimated pre-layout delays. This highlevel description document is used by the design team as a guide through the ASIC development phase. regression tests should be run to verify the ASIC functionality by simulating the design at a unit-delay level. feature selection. After the functions have been defined and partitioned. Once the design functions at the unitdelay level. regression tests that verify the functionality are developed. After implementation of the high-level description is approved. Sun Sparc workstations are used as simulation and synthesis servers. The kind of tools needed by the ASIC engineers are Synopsys design compiler. the design is ready for floor planning followed by cell placement and routing. The floor planning is sometimes done in parallel with the estimated timing verification phase of the design. Synthesis scripts can be developed in an infant state. chip synthesis may begin. integration occurs in phases. and Cadence Verilog simulators. The first stage of the cell placement and routing can take up to 2 weeks for designs greater than 100. the ASIC design team codes the design in Verilog. An ASIC's functionality is usually defined in the system engineering. synthesis of lower-level modules may be completed in parallel. but each stage of integration only proceeds after the modules to be integrated have been thoroughly verified. After the ASIC has been synthesized. Individual integration efforts can begin at a point where major modules can be connected. This occurs because the design is somewhat stable and usually the major blocks of the design do not change architecturally. While preliminary integration occurs. The first stage of the ASIC implementation is writing a high-level description document. The document is written by the ASIC design team and is supervised by an ASIC lead designer or project leader.

After all nets are routed and all cells placed. the ASIC designer returns the updated netlist to the layout engineer so that the new and changed cells can be updated in the layout database. the layout engineer delivers a wire delay file (based on actual capacitive loading) back to the ASIC designer so that actual timing can be back-annotated into the design. When all violations are detected and repaired. Once the ASIC designer completes the final verification. One more wire delay file is delivered from the layout engineer to the ASIC designer for final verification.000 gates to 150.from 50. schematic) and DRC (design rule checker) tools before handing the layout database to the mask shop. loading constraints on buffers and some timing has been violated with the first cut of the layout. Typically. they will run the final LVS (layout vs.000 gates can be anywhere from 1 to 2 weeks. Return to Table of Contents TOC 92 . The designer is required to perform a regression test and retime static paths in the design so that all violations due to the actual wire loading can be corrected.

Sign up to vote on this title

UsefulNot useful- 10.1.1.110
- chapter1_2
- 3ECE-AC Lab Manual
- CE - Question Bank
- Section 3 1 Digital Mod Tech v7
- Rr311202 Communication Theory
- Communication Systems-II
- Per Asbeck.pdf.pdf
- EEC-659.doc
- r311202 Communication Theory[1]
- Evolution Gsm
- Low Density Parity Check Codes Ppt
- patr s1
- Data Com
- Vector Modulation Analysis
- CSE-3-8Cur&syll
- EECE 301 Note Set 15 FT Properties
- Manchester An401
- Lecture3 & 4_Amplitude Modulation_done
- 04623789.pdf
- L-05
- W61PC_Manual_V7.3.00
- 1. Comp -Ijcse - Trellis Coded Modulation Over Land Mobile Satellite Channel
- Mutual Information LLR
- Synopsis General Code of Linguistics
- CDMA network.CPT1
- Electronics Assignment
- Chapter 3-Hybrid Mqam-lfsk (Hqfm) Signaling
- Optical
- First 3 Pages
- Qam64

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue reading from where you left off, or restart the preview.