Citation
A comparative analysis of modulation and demodulation methods in digital communications

Material Information

Title:
A comparative analysis of modulation and demodulation methods in digital communications
Creator:
Burgess, William A
Publication Date:
Language:
English
Physical Description:
xii, 167 leaves : ; 28 cm

Subjects

Subjects / Keywords:
Digital communications ( lcsh )
Demodulation (Electronics) ( lcsh )
Modulation (Electronics) ( lcsh )
Demodulation (Electronics) ( fast )
Digital communications ( fast )
Modulation (Electronics) ( fast )
Genre:
bibliography ( marcgt )
theses ( marcgt )
non-fiction ( marcgt )

Notes

Bibliography:
Includes bibliographical references (leaf 167).
Statement of Responsibility:
by William A. Burgess.

Record Information

Source Institution:
University of Colorado Denver
Holding Location:
Auraria Library
Rights Management:
All applicable rights reserved by the source institution and holding location.
Resource Identifier:
47121053 ( OCLC )
ocm47121053
Classification:
LD1190.E54 2000m .B87 ( lcc )

Downloads

This item is only available as the following downloads:


Full Text

PAGE 1

A COMPARATNE ANALYSIS OF MODULATION AND DEMODULATION METHODS IN DIGITAL COMMUNICATIONS by William A. Burgess B.S.E.E, Louisiana Tech University, 1996 A thesis submitted to the University of Colorado at Denver in partial fulfillment of the requirements for the degree of Master of Science Electrical Engineering 2000

PAGE 2

The thesis for the Master of Science degree by William A. Burgess has been approved by Miloje Radenkovic Jan Bialasiewicz Hal'Itid Fardi Date

PAGE 3

Burgess, William A. Electrical Engineering) A comparative analysis of modulation and demodulation methods in digital communications Thesis direct by Professor Miloje Radenkovic ABSTRACT A digital communication system is system that transmits and receives information such that all information is represented by a sequence of discrete messages. Most digital systems utilized a two-state set and are referred to as binary. Digital modulation impresses a digital data set, know as a pulse train, onto a signal suitable for transmission For long distance and wireless transmission, bandpass modulation (or carrier modulation) is usually used. The three carrier modulation techniques examined by this thesis are Binary Phase Shift Keying (BPSK), Quadrature Phase Shift Keying (QPSK), and Quadrature Amplitude Modulation (QAM) along with their associated demodulation techniques. BPSK is the simplest case of phase shift keying and will be discussed for comparison to the more common QPSK and QAM techniques. This modulation is characterized by creating a cosine wave for the symbol 1 and shifting the phase by 180 degrees for the symbol o. QPSK is a digital modulation technique that utilizes two BPSK signals and sends the difference between then two. QPSK is the most popular type of phase shift iii

PAGE 4

keying. QAM is a digital modulation technique that utilizes two multi-leveled BPSK signals (thus the word amplitude in the description). Communication systems that employ QAM include digital cellular systems in the United States and Japan as well as most high speed modems. These modulation and demodulation techniques will be demonstrated by creating MA TLAB programs that will simulate the continuous-time waveform and the different modulated outputs using user-inputted data. addition to modulation and demodulation, this thesis will examine the effect of noise. This abstract accurately represents the content of the candidate's thesis. recommend its publication. Miloje Radenkovic iv

PAGE 5

DEDICATION I dedicate this thesis to the three most important women in my life: Jennifer, Cheyenne, and Jasmine.

PAGE 6

ACKNOWLEDGMENT My thanks to my Dr. Radenkovic for his patience and guidance while I was working on this thesis. My thanks also go out to Lockheed Martin, who made my graduate work possible. I would also like to thank my parents, who taught me the value of an education. And finally, I would like to thank my wife, who always made me smile when I was frustrated.

PAGE 7

CONTENTS Igures ...................................................................................................................... Tables ....................................................................................................................... xi Chapter 1. Introduction to Digital Communications ........................................................ 1 2. Digital Modulation Techniques ...................................................................... 6 2.1. Binary phase shift keying (BPSK) ................................................................. 6 2.2. Quadrature phase shift keying (QPSK) ......................................................... 10 2.3. Quadrature amplitude modulation (QAM) .................................................... 14 3. Digital Demodulation Techniques ................................................................. 18 3.1. Effects of Noise and Channel Distortion ....................................................... 18 3.2. BPSK Demodulation ..................................................................................... 19 3.3. QPSK Demodulation ..................................................................................... 32 3.4. QAM Demodulation ...................................................................................... 38 4. Experiments and Results ............................................................................... 41 4.1. Coding ........................................................................................................... 41 4.2. BPSK Modulation and Demodulation .......................................................... .43 4.3. QPSK Modulation and Demodulation .......................................................... 69 4.4. QAM Modulation and Demodulation ........................................................... 94 5. Conclusion ........................................................................... ........................ 116 vii

PAGE 8

Acronyms ................................................................................................................. 119 Appendix Al Source Code for A2 Source Code for A3 Source Code for 3 A4 Source Code for A5 Source Code for A6 Source Code for A7 Source Code for A8 Source Code for A9 Source Code for A10 Source Code for Source Code for Source Code for A13 Source Code for A 14 Source Code for ......................................................................... 162 Source Code for References ................................................................................................................ 167 viii

PAGE 9

FIGURES Figure 1.1 Block Diagram of a Typical Digital Communication System ....................... 1 1.2 Baseband Pulse Trains ................................................................................... 3 2.1 BPSK Constellation ........................................................................................ 7 2.2 Binary Phase Shift Keying Superimposed ..................................................... 8 2.3 Binary Phase Shift Keying Serial ................................................................... 8 2.4 BPSK Modulator ............................................................................................ 9 2.5 QPSK Constellation ...................................................................................... 11 2.6 Quadrature Phase Shift Keying Superimposed ............................................. 12 2.7 Quadrature Phase Shift Keying Superimposed ............................................. 12 2.8 QPSK Modulator ........................................................................................... 13 2.9 Gray Coded Square 16-QAM Constellation ................................................. 15 2.10 Quadrature Amplitude Modulation Superimposed ....................................... 16 2.11 Quadrature Amplitude Modulation Serial ..................................................... 16 2.12 QAM Modulator ............................................................................................ 17 3.2.1 Two Correlation BPSK Receiver .................................................................. 28 3.2.2 PLL BPSK Demodulator ............................................................................... 30 3.2.3 Quadrature Correlator QPSK Demodulator .................................................. 35 3.2.4 QPSK Demodulator ....................................................................................... 36 3.3.1 Demodulation and Detection of QAM signals .............................................. 39 3.3.2 PLL Circuitry for QAM Demodulation ....................................................... .40 4.2.1 BPSK Modulation for the Character B ........................................................ .45 4.2.2 BPSK Demodulation for the Character B, no noise ..................................... .46 4.2.3 BPSK Demodulation for the Character B, sigma=0.5 ................................. .47 4.2.4 BPSK Demodulation for the Character B, sigma=1 .................................... .48 4.2.5 BPSK Demodulation for the Character B, no noise ..................................... .49 4.2.6 BPSK Demodulation for the Character B, sigma=0.5 .................................. 50 4.2.7 BPSK Demodulation for the Character B, sigma=1 ..................................... 51 4.2.8 BPSK Modulation for the Character P .......................................................... 52 4.2.9 BPSK Demodulation for the Character P, no noise ...................................... 53 4.2.10 BPSK Demodulation for the Character P, lag=50 ......................................... 54 4.2.11 BPSK Demodulation for the Character P, lag=75 ......................................... 55 4.2.12 BPSK Demodulation for the Character P, no noise ...................................... 56 4.2.13 BPSK Demodulation for the Character P, lag=50 ......................................... 57 IX

PAGE 10

4.2.14 BPSK Demodulation for the Character P, lag=75 ........... ............................. 58 4.2.15 BPSK Modulation for the Character S .......................................................... 59 4.2.16 BPSK Demodulation for the Character S, no noise ...................................... 60 4.2.17 BPSK Demodulation for the Character S, fade=75% ................................... 61 4.2.18 BPSK Demodulation for the Character S, fade=25% ................................... 62 4.2.19 BPSK Demodulation for the Character S, no noise ...................................... 63 4.2.20 BPSK Demodulation for the Character S, fade=75% ................................... 64 4.2.21 BPSK Demodulation for the Character S, fade=25% ................................... 65 4.2.22 BPSK Modulation for the Character K ......................................................... 66 4.2.23 BPSK Demodulation for the Character K, no noise ...................................... 67 4.2.24 BPSK Demodulation for the Character K, no noise .......... ; ........................... 68 4.3.1 QPSK Modulation for the Character Q ......................................................... 70 4.3.2 QPSK Demodulation for the Character Q, no noise ..................................... 71 4.3.3 QPSK Demodulation for the Character Q, sigma=0.5 .................................. 72 4.3.4 QPSK Demodulation for the Character Q, sigma=I ..................................... 73 4.3.5 QPSK Demodulation for the Character Q, no noise ..................................... 74 4.3.6 QPSK Demodulation for the Character Q, sigma=0.5 ..................... ; ............ 75 4.3.7 QPSK Demodulation for the Character Q, sigma=1 ..................................... 76 4.3.8 QPSK Modulation for the Character P .......................................................... 77 4.3.9 QPSK Demodulation for the Character P, no noise ...................................... 78 4.3.10 QPSK Demodulation for the Character P, lag=5 .......................................... 79 4.3.11 QPSK Demodulation for the Character P, lag=lO ........................................ 80 4.3.12 QPSK Demodulation for the Character P, no noise ...................................... 81 4.3.13 QPSK Demodulation for the Character P, lag=5 .......................................... 82 4.3.14 QPSK Demodulation for the Character P, lag=lO ........................................ 83 4.3.15 QPSK Modulation for the Character S .......................................................... 84 4.3.16 QPSK Demodulation for the Character S, no noise ...................................... 85 4.3.17 QPSK Demodulation for the Character S, fade=75% ................................... 86 4.3.18 QPSK Demodulation for the Character S, fade=25% ................................... 87 4.3.19 QPSK Demodulation for the Character S, no noise ...................................... 88 4.3.20 QPSK Demodulation for the Character S, fade=75% ................................... 89 4.3.21 QPSK Demodulation for the Character S, fade=25% ................................... 90 4.3.22 QPSK Modulation for the Character K ......................................................... 91 4.3.23 QPSK Demodulation for the Character K, no noise ..................................... 92 4.3.24 QPSK Demodulation for the Character K, no noise ..................................... 93 4.4.1 QAM Modulation for the Character Q .......................................................... 95 4.4.2 QAM Demodulation for the Character Q, no noise ...................................... 96 4.4.3 QAM Demodulation for the Character Q, sigma=0.5 ................................... 97 4.4.4 QAM Demodulation for the Character Q, sigma=0.75 ................................. 98 4.4.5 QAM Demodulation for the Character Q, no noise ...................................... 99 4.4.6 QAM Demodulation for the Character Q, sigma=0.5 .................................. 100 x

PAGE 11

4.4.7 QAM Demodulation for the Character Q, sigma=0.75 ................................ 101 4.4.8 QAM Modulation for the Character A ......................................................... 102 4.4.9 QAM Demodulation for the Character A, no noise ..................................... 103 4.4.10 QAM Demodulation for the Character A, lag=3 .......................................... 104 4.4.11 QAM Demodulation for the Character A, lag=4 .......................................... 105 4.4.12 QAM Demodulation for the Character A, no noise ..................................... 106 4.4.13 QAM Demodulation for the Character A, lag=3 .......................................... 1 07 4.4.14 QAM Demodulation for the Character A, lag=4 .......................................... 108 4.4.15 QAM Modulation for the Character M ........................................................ 109 4.4.16 QAM Demodulation for the Character M, no noise ..................................... l1O 4.4.17 QAM Demodulation for the Character M, fade=lO% .................................. 111 4.4.18 QAM Demodulation for the Character M, fade=15% .................................. 112 4.4.19 QAM Demodulation for the Character M, no noise ..................................... 113 4.4.20 QAM Demodulation for the Character M, fade=1O% .................................. 114 4.4.21 QAM Demodulation for the Character M, fade=15% .................................. 115 xi

PAGE 12

TABLES Table 4.1 The International Reference Alphabet (IRA) ............................................... .42 4.2 BPSK Demodulation Results ........................................................................ 44 4.3 QPSK Demodulation Results ........................................................................ 69 4.4 QAM Demodulation Results ......................................................................... 94 xii

PAGE 13

Introduction to Digital Communications A digital communication system is a system that transmits and receives information such that all information is represented by a sequence of discrete messages. The basic components of a digital communication system are represented below in the general block diagram: ---... 1 -.. -------J_ .... .. .... .... 1 Figure 1.1 Block Diagram of a Typical Digital Communication System [3] The data source generates the messages that are to be transmitted to the receiver. The characteristics of the signal depend on the type of information source which produces it [2]. For the purposes of simulation in this thesis, the information source shall be eight-bit binary vectors representing ASCII characters (see table 4.1).

PAGE 14

In the previous diagram, the modulator circuit is responsible for taking the digital messages and preparing them for transmission. This is done by either using baseband modulation, which places the signal onto the transmission media using DC voltage levels, or bandpass modulation, which manipulates a carrier frequency on the transmission media [2]. The three modulation techniques researched by this thesis all involve bandpass modulation. The power amplifier is an optional component that can be used to boost signals for long distance travel. The channel can be either hardwire such as twisted pair telephone lines, coaxial lines, and fiber optic cables, or softwire such as air, vacuum, and seawater, or some combination of these media [12]. The demodulator processes the waveform and reduces each waveform to a symbol number that represents an estimate of the transmitted data symbol. The source sink is the final destination of the digital signal and utilizes the data that has been sent [2]. Most digital systems utilize a two-state set and are referred to as binary. Utilizing the symbol 1 or the symbol 0, the digital data set is represented as a pulse train [l]. The non-return to zero-level (NRZ-L) baseband modulation represents a symbol 1 by a positive square pulse and a symbol 0 with a negative square pulse. The unipolar return to zero (URZ) modulation represents a positive half pulse for the symbol 1 and no pulse for o. The bi-phase level (BPL) modulation, or Manchesster modulation, uses waveforms consisting of a positive half pulse followed by a 2

PAGE 15

negative half pulse for the symbol 1 and a negative then positive half pulse for the symbol 0 [3]. For the purposes of simulation and due to popularity, the pulse train that will be used in this the.sis is the NRZ-The three baseband modulation techniques discussed above are represented in figure 1.2. r-[3], [4] For long distance and wireless transmission, the pulse train is placed onto a signal suitable for transmission [1]. This modulation is known as a bandpass modulation since the signal is placed onto a sinusoidal signal that is filtered out in the demodulation process. The general equation for bandpass modulation is represented below [3]. 3

PAGE 16

(1.1) For this thesis, all phase shifts shall be either 0 or tr radians (not degrees). Using the fact that cos(2tr tr) cos(2tr and sin(2tr tr) -sin(2tr the e: and phase shifters can be replaced with the amplitude shifters and The component is referred to as the In-Phase vector and the component is referred to as the Quadrature vector [12]. is the basic signaling interval and is the energy of the signal. Note that the signal interval is independent of the carrier frequency. Note that since which simplifies to equation 1.1 can be simplified to (1.2) where the amplitude A is not effected by the frequency since the signal interval is independent of the carrier frequency. This sinusoidal signal can either be 4

PAGE 17

manipulated by tweaking the amplitude (Amplitude Shift Keying, the frequency (Frequency Shift Keying, or the phase (Phase Shift Keying, or [2]. The Binary Phase Shift Keying (BPSK) mwiulation technique utilizes only the first part of equation 1 0) and has a constant amplitude and frequency Quadrature Phase Shift Keying (QPSK) utilizes the entire equation but with constant amplitude and frequency (1, = l,Q, l'/e = Quadrature Amplitude Modulation (QAM) also utilizes the entire equation but has varying amplitudes {-n ... -3,-1,1,3 ... n}; {-n ... -3,-1,1,3 ... n}) [3]. The demodulation process extracts the data from the received signal, now possibly distorted and noisy [1]. The distortion and noise is applied to the transmitted signal such that the received signal looks like [3]: = eJwith signalfading For the purposes of this thesis, shall be Additive Gaussian White Noise (A WGN), 9 shall the lag error, and shaH be the channel fading. 5

PAGE 18

2. Digital Modulation Techniques Digital modulation is the process that places a digital message onto a signal suitable for transmission [2]. This section will cover the Phase Shift Keying (PSK) techniques Binary Phase Shift Keying (BPSK) and Quadrature Phase Shift Keying (QPSK) and the technique Quadrature Amplitude Modulation (QAM). 2.1 Binary Phase Shift Keying (BPSK) The simplest type of phase shift keying modulation technique is Binary Phase Shift Keying (BPSK, This technique will be discussed for comparison to the more advanced and common QPSK and QAM techniques. BPSK is characterized by transmitting a burst of a fixed carrier frequency at a fixed amplitude to symbolize a one and transmitting a burst of the carrier frequency phase shifted by radians to symbolize a zero [3]. Utilizing equation 1.2 and the fact that BPSK modulation has a constant amplitude and frequency, the general form for a BPSK modulated signal is = with I, = { I for symbol I} -1 for symbol 0 (2.1.1) with as the carrier freqllency. 6

PAGE 19

The signal constellation for BPSK is 3 o _--=-3'---i1-____ -1'--t1 __ -1 [3] Notice that the two possible values for are 1 and -1, which coincides with equation 2.1.1

PAGE 20

BPSK is demonstrated in Figures 2.2 and 2.3 below 0.5 o -0.5 -1 20 40 60 80 100 120 140 160 180 200 Figure 2.2 Binary Phase Shift Keying Superimposed 0.5 o -0.5 100 200 300 400 500 600 700 BOO Figure 2.3 Binary Phase Shift Keying Serial 8

PAGE 21

An interesting note is that for a given symbol period, in this case 200 iterations, only one symbol is modulated onto the carrier frequency. We will see later that QPSK modulates 2 symbols and QAM modulates 4 symbols for the same symbol period. The block diagram for BPSK is represented below. is the power amplifier gain shown below. is the binary pulse train that consists of zeros and ones. SF [3] The BPSK demodulator will be discussed in section 3.2. 9

PAGE 22

2.2 Quadrature Phase Shift Keying (QPSK) The most common type of m-ary phase shift keying is Quadrature Phase Shift Keying (QPSK, which is characterized by combining two binary PSK signals with orthogonal carriers [3]. The orthogonal carriers are achieved by using a cosine and a sine wave for consecutive bits. Utilizing equation 1.2 and the fact that QPSK modulation has a constant amplitude and frequency, the general fonn for a QPSK modulated signal is sin(2lr with = (2.2.1) { 1 symbol = I} -1 symbol=O By dividing each eight-bit data vector into multiple two-bit vectors, the first bit can be represented by the In-Phase portion of the equation and the second bit can be represented by the Quadrature part on the equation [6].

PAGE 23

The constellation diagram for QPSK is as follows: 3 _--=-3=--J-____ -....:...1 __ Figure 2.5 QPSK Constellation [3] Notice that the two possible values for are 1 and -1 the two possible values for Q, are 1 and -1, which coincides with equation 2.2.1.

PAGE 24

QPSK is demonstrated in the following diagrams. a 1.5 1(1)= I, a (t)= -1 1(1)= -1, a (1)= -1 1(1)" -I, a (I)'" 1 1(1)= I, a (1)= 1 0.5 o -0.5 -1 -1.5 __ ____ ____ ____ __ ____ 10 20 30 40 50 60 70 80 90 100 Figure 2.6 Quadrature Phase Shift Keying Superimposed 1.5 a 1(1)= -1, (1)= 0.5 o -0.5 -1.5 ____ ______ ______ ______ 50 100 150 200 250 300 350 400 Figure 2.7 Quadrature Phase Shift Keying Serial

PAGE 25

PI The block diagram for the QPSK Modulator is depicted below. Figure 2.8 QPSK Modulator [3] 13 apSK r-----.,.

PAGE 26

2.3 Quadrature Amplitude Modulation (QAM) Quadrature Amplitude Modulation (QAM) is characterized by combining two ASK signals with orthogonal carriers [3]. Since the ASK signals can have a amplitude of both positive and negative values, the negative valued symbols effectively have a phase shift, or PSK. Utilizing equation 1.2 and the fact that QAM modulation has a constant frequency the general form for a QAM modulated signal is (2.3.1) and are determined by using a coded QAM constellation. There are many constellation available, but for the purposed of this thesis, the 16-QAM Gray Code is used [3]. It is demonstrated in the figure below. 14

PAGE 27

0010 1010 -3 1110 0110 0011 1011 -1 1111 0101 3 1 -1 0001 1001 1101 0101 0000 1000 3 1100 0100 Figure 2.9 Gray coded square 16-QAM constellation [3] By dividing each eight-bit data vector into multiple four-bit vectors, each half can be represented by separate gray-coded sequence. For example, the letter Z (ASCn number 90) is represented as [0 1 0 1 1 0 1 0] which divided into the two vectors [0 01] and [1 010]. Using figure 2.9 and equation 2.3.1, we see that the two sequential QAM equations are 3sin(27r (2.3.2) (2) = cos(27r -sin (2.3.3) QAM is demonstrated in the following diagrams. 15

PAGE 28

35 30 25 20 15 10 5 10 20 30 40 50 60 70 80 90 100 4 r------,------,------,-------,------,------,------,------, 3 2 o -3 .4 L____ -L ______ J____ o 100 200 250 300 350 16

PAGE 29

The QAM block diagram is depicted below. 1----.< Figure 2.12 QAM Modulator [6] 17

PAGE 30

3. Digital Demodulation Techniques The section will cover techniques used to digitally demodulate infonnation off of a digitally modulated signal. The three demodulation techniques will apply to Binary Phase Shift Keying (BPSK), Quadrature Phase Shift Keying (QPSK), and Quadrature Amplitude Modulation (QAM). 3.1 Effects of Noise and Channel Distortion Additive While Gaussian Noise (A WGN) channel is a universal channel model for analyzing modulation schemes that does nothing but add a white Gaussian noise to the signal passing through it [3]. The received signal is simplified to = (3.1.1) where is the additive white Gaussian noise and is the outputted signal in equations 2.1.1 (BPSK), 2.2.1 (QPSK), and 2.3.1 (QAM). However, noise may also be added in the fonn of lag or fading such that the received signal may look like (3.1.2) where e is the lag error and is the channel fading.

PAGE 31

3.2 BPSK Demodulation There are many ways to detect a BPSK signal and interpret it into a binary pulse train. The two methods involve a statistical method using correlators and a real-time method using Phase-Locked Loops. The first method discussed is the use of a dual correlation system using the minimum probability of error theorem. A digital signal waveform with binary signaling consists of two kinds of signals defined as [3] = cos(2Jr = (3.2.1) (3.2.2) both for S S = To simplify analysis without loss of generality, we set the time duration as 0 S From the point of view of detection theory, we have two hypotheses [10]: 0 S S is sent : The energy of each signal are 19

PAGE 32

and T 2 10 general these two signals may be correlated, so we define [11] [ = -OD I 2 (3.2.3) (3.2.4) (3.2.5) as the correlation coefficient of and Note that 1. The received signal is 1,2, 0 (3.2.6) where is one of the two possible signals, and is the additive white Gaussian noise with zero mean and a two sided spectral density of [10]. This implies that the autocorrelation function of is _0 2 where is the Dirac delta function defined by [12] 20 (3.2.7)

PAGE 33

(3.2.8) Since is a Gaussian process, the received signal is also a Gaussian process with as mean value. order to use the hypothesis test results described above, we need to represent by a set of discrete quantities [11]. At this point, orthogonal and orthonormal functions shall be defined. Function is said to be orthogonal to over the interval if they satisfy the condition [12] = = )' 0 the constants are all equal to 1, then and are said to be orthonormal functions [12]. Using equation 3.2.6, is expanded as a weighted sum of a set of orthonormal basis functions [11] (3.2.9)

PAGE 34

where are orthononnal basis functions defined below and (3.2.10) The vector is the desired set of discrete quantities, called projections of onto (1). It can be shown that since are orthogonal, is Gaussian and independent of each other. The orthogonal basis function can be found by the Gram-Schmidt procedure. this procedure, we choose the nonnalized first signal as the first coordinate or the basis function [11] (3.2.11) Clearly fIJI (1) has unit energy, that is, it is nonnalized (3.2.12) where the coefficient is the projection of on the coordinate fIJI (1) [12]. Next we define the second basis function as 22

PAGE 35

(3.2.13) where c) must be chosen to satisfy orthogonality of with and cmust be chosen to satisfy nonnality of [10]. Manipulating equation 3.2.13 using equation 3.2.11, we find that (3.2.14) (3.2.15) The remaining (/1; consist of an arbitrary orthononnal set whose member are orthogonal to (1) and However, only the first two coefficients depend on transmitted signal. Therefore we only need to check these two sufficient statistics [10] 1j = [St 23

PAGE 36

(3.2.16) where 1,2 (3.2.17) These are Gaussian random variables with zero-means and are independent of each other. Their variances are identical, that is = 1,2 (3.2.18) The mean of are (3.2.19) 24

PAGE 37

(3.2.19) Note that nonnally is used for mean values in general cases. Here symbol is used instead of to indicate that they are projections of signals onto the basis functions [12]. Using the fact that Kis defined as we see that the covariance matrixes are =[ } ] { } / 2} = 1,2 (3.2.20) which are identical regardless of Substituting this into the equation 25

PAGE 38

we can form the likelihood ratio [3] = J (3.2.21) Canceling the common terms and taking the logarithm we have the likelihood ratio test of (3.2.22) where the initial threshold (3.2.23) is the minimum error probability criterion. Realizing that each sum is just the squared magnitude of the difference vector, the above expression can be written as 26

PAGE 39

(3.2.24) or fJ 12 1 12) r S -2 2 (3.2.25) The left-hand side is the sufficient statistic and the right-hand side is the final threshold [10]. From Parseval's theorem we see that (3.2.26) = (3.2.27) and (3.2.28) Thus the receiver can be implemented as shown in figure 3.2.1 using two correlators. Since BPSK does not use amplitude modulation, both signals have the same energy and therefore equation 3.2.28 can be simplified to In...1.. 2 27 (3.2.29)

PAGE 40

which is simply detennined by the a priori probabilities and the noise spectral density. Further, we assume that both Sl and have the same probability and therefore 0 [10]. The block diagram for this receiver is shown below. 0 0 [3] 28

PAGE 41

Another way to demodulation BPSK signals is to use a Phase-Lock Loop (PLL) to detennine the phase shift of the received signal. A decision is then made about the signal [8]. PLLs are used widely in modern communications systems. Their application is more useful in low Signal-to-Noise Ratio (SNR) environments because of the improved performance in the threshold region [12]. There are several types of Phase-Lock Loops in use. The Analog Phase-Lock Loop (APLL), also known as the Linear Phase-Lock Loop, continuously tries to track the phase of the incoming signal. The phase shift is realized by a phase detector, a loop filter, and a voltage-controlled oscillator (VeO). The key difference between APLL and other types of PLLs is that is it is detecting the phase shift in an analog signal [12]. While this thesis is focused on digital modulation, an APLL is used since the received signal is on a continuous carrier frequency. Other types of PLLs include Digital Phase-Lock Loops (DPLL), All-Digital Phase-Lock Loops (ADPLL), and Software Phase-Lock Loops (SPLL). The DPLL is monitoring a digital signal, such as baseband signals shown in figure 1.2, and uses a sinusoidal signal to help realize its components. An ADPLL also investigates a digital input signal but uses a baseband signal to help realize its components. All three of these types of PLLs use off-the-shelf hardware and can be demodulated in almost real-time [8]. 29

PAGE 42

A SPLL uses a computer with an input module and does its realization using real-time software. SPLL presents itself with a delay problem since the input module must translate the signal into a fonnat that the software can read [8]. A PLL BPSK demodulator is shown below. PLL----1------1 Figure 3.2.2 PLL BPSK Demodulator [8] As can be seen in the above diagram, the voltage-controlled oscillator produces an expected cosine wave to be compared to the received signal [8]. Since the expected amplitude, frequency, and phase are known, this setup is considered a coherent detection system [2]. The initial frequency for the is the carrier frequency for the system and is represented below [8]: (3.2.30) The phase detector (PD) creates a signal if the phases of the received signal and the output of the are different. The phase detector detennines the 30

PAGE 43

phase by utilizing a Positive Zero Crossing Detector (PZCD) on each input and then subtracting the difference. The phase detector signal is usually in the fonn of a raised cosine wave (due to the hardware available). The loop filter in tum removes the cosine wave to produce a DC voltage level. This DC voltage is used to modify the phase ofthe VCO until the VCO output and the received signal are the same [8]. We see than the output of the voltage controlled oscillator will settle to = SJ; Se = ; { o symbol = I} symbol=O It should be noted that equation 3.2.31 will settle down until the next symbol period arrives and then the possibility of the phase shifting is possible. 31

PAGE 44

3.3 There are many ways to detect a QPSK signal and interpret it into a binary pulse train. The first method discussed is the use of a quadrature correlation system, again using the minimum probability of error theorem. Assuming 4 hypotheses, the received signal under hypothesis is + 0 S S = 1,2,3,4 (3.3.1) where is the signal and is the white Gaussian noise with zero mean and a power spectral density of The signal energy is 2 Jo = (3.3.2) and four signals are correlated (3.3.3) We have shown in section 3.2 that can be represented by a vector [Ij, whose elements are projections of onto a set of orthonormal 32

PAGE 45

functions 1,2, ... will be Gaussian and independent of each other. Like for BPSK, the orthogonal basis function can be found by the GramSchmidt procedure. They are (3.3.4) (3.3.5) (3.3.6) (3.3.7) Using this method, we can solve for and as (3.3.8) (3.3.9) Then we used this set of orthononnal functions to generate coefficients 33

PAGE 46

= r = 1,2, ... (3.3.1 0) are statistically independent Gaussian random variables with variance of No /2. Their mean values depend of hypotheses, (3.3.11) = = 1,2,3,4 This is the general Gaussian problem with equal for all and also (2/ No)I where Kis defined as ... } When the criterion is minimum error probability, using 34

PAGE 47

In InIK; 1(3.3.12) we see that by dropping the 1I2ln tern (which is independent of any hypothesis), we have this sufficient statistic o (3.3.13) and detennine is true when is the largest [3]. The block diagram for this system is shown below. 0 51(1) Bl 0 for allj;fi, r(l) choose 52(1) B2 0 53(1) B3 0 54(1) B4 Figure 3.2.3 Quadrature Correia tor QPSK Demodulator [3] 35

PAGE 48

An alternate method for demodulating the QPSK signal is to use a PhaseLocked Loop setup again. The PLL demodulator for QPSK is shown below [8]. PLL -----Figure 3.2.4 QPSK Demodulator [8] The carrier recoverer (CR) splits the incoming signal into its cosine and sine portions so that each PLL may detect the phase difference of each curve. As before, the voltage-controlled osci11ator (VCO) produces an expected cosine or sine wave to be compared to the received signal [8]. The initial frequency for the VCO is the carrier frequency for the system and is represented below: (3.3.14) (3.2.15) 36

PAGE 49

The phase detector (PD) creates a signal is the phases of the received signal and the output of the VCO are different. The phase detector detennines the phase by utilizing a Positive Zero Crossing Detector (PZCD) on each input and then subtracting the difference. The phase detector signal is usually in the fonn of a raised cosine wave (due to the hardware available). The loop filter in tum removes the cosine wave a produces a DC voltage level. This DC voltage is used to modify the phase of the VCO until the VCO output and the received signal are the same [8]. Examining figure 3.3.2 we see than the output of the voltage controlled oscillator will settle to = cos(27r a a = {O s y mbol=1} 7r symbol = 0 (3.3.16) {O s ymbol=1} sm(27r aJ, 7r symbol=O (3.3.17) It should be noted that both equations 3.3.16 and 3.3.17 will settle down until the next symbol period arrives and then the possibility of the phase shifting is possible. 37

PAGE 50

The QAM detection process works just like the QPSK process except that amplitude has to be taken into account. Viewing the fact that (3.3.1) may be overcome by incorrect amplitude (amplitude of improper may overcome proper signal the amplitude of the modulated signal must be taken into account. By viewing figures 2.10, it is plain to see that different combinations of I, and will produce different modulated signal amplitudes. Therefore, an amplitude switch is used. Using it is reveal that max { cos(2n sin(2n 0 max { sin(2n 0 < < max { cos(2n sin(27t 0 = max { sin(2n 0 Using these results, the amplitude switch will compare with the four signals l;Q, l if the maximum amplitude if less than and if 38

PAGE 51

the maximum amplitude if greater than the max amplitude falls between these two values, the amplitude switch will compare the input signal to the eight signals = ; = and = ; = The inherent flaw with the amplitude switch is that Gaussian noise can cause a mid or lower level signal to have a max value in the upper or mid range and fading can cause a mid or upper level signal to appear to be a low or mid range signal [12]. This concept is demonstrated in the following diagram .. .. -... ... Hi [3] 39

PAGE 52

Likewise, the PLL type demodulator will also use an amplitude switch so that the circuitry will view the proper signals. Like the correlator method, the amplitude switch will compare with the four signals ; if the maximum amplitude if less than and = ; = if the maximum amplitude if greater than If the max amplitude falls between these two values, the amplitude switch will compare the input signal to the eight signals = ; = and = = The PLL demodulator for QAM is shown below [8] .. .. .. 3.3.2 [3] 40

PAGE 53

4. Experiments and Results This chapter will present the experiments and results using MATLab simulations. Basic coding will be discussed so that the reader can fully understand the input to output process. BPSK, QPSK, and QAM will be simulated using normal modulation techniques and the correlation and PLL demodulation techniques will be used. Additive White Gaussian Noise (A WGN), lag (phase error), and fading (attenuation) will be applied to both demodulation techniques to show robustness. 4.1 Coding In order to covert a symbol from a readable letter to an eight bit binary sequence, the International Reference Alphabet conversion table is used [7]. A typical 8 bit word is setup as [0 b7 b6 bs b4 b3 b2 bI]. For example, the letter U would be represented by [0 1 0 1 0 1 0 The parity bit (bs) is used to help with error detection. an odd-parity scheme is being used, then bs is 1 if the total of l' s in the coded word is even. the total 1 's is already odd, then b s remains zero. The receiver then counts the number of 1 's in the demodulated word and if the total is even, the receiver requests a resend. Similarly, some systems use an even-parity setup and some systems do no use the parity bit at all [7]. The parity bit will not be used in this thesis. 41

PAGE 54

The International Reference Alphabet is represented below. 0 0 0 0 I I I I 0 0 I I 0 0 I I 0 I 0 I 0 I 0 I 0 0 0 0 NUL DLE SP 0 P 0 0 0 I SOH DCI I Q a q 0 0 I 0 STX DC2 2 B R 0 0 I I ETX DC3 # 3 C S c s 0 I 0 0 EOT DC4 $ 4 D T d 0 I 0 I ENQ NAK % E U e 0 I I 0 ACK SYN V v 0 I I I BEL ETB 7 W w I 0 0 0 BS CAN ( 8 X x I 0 0 I HT EM 9 I I 0 I 0 SUB J z I 0 I I VT ESC K I I 0 0 IS4 L 1 I I 0 I CR IS3 -M 1 1 I 0 SO IS2 N I I I I SI lSI ? 0 o DEL Table 4.1 The International Reference Alphabet (IRA) [7] 42

PAGE 55

For the first experiment, found in appendix A2, will be utilized to visually demonstrate BPSK modulation. The four modulated letters are B, P, S, and Notice in each figure that the pulse train is represented in the upper half of the diagram. Also notice that when the pulse train transitions from 0 to 1 or visa versa, the modulated signal "breaks" and is therefore readable by the receiver. The modulation program was written to utilize the subroutine This program requests the user for a text input (variable that consists of multiple characters. This program then creates a matrix titled that consists of a first column vector with the ASCn numeric value and a second thru ninth column with the 8 bit binary converted value. The number of rows depends directly on the length of the text input. For example, if the user were to enter "BPSK", would return to the modulation program the following two variables: S (4.2.1) 66 80 1 0 1 83 1 0 1 1 1 (4.2.2) 75 1 1 The modulation program then steps through and modulates each row from column 2 through 9. The modulation program then saves to disk 43

PAGE 56

the signal matrix, the amplitude, and the frequency (for coherent detection reasons). The program may be utilized to add noise to the saved signal matrix. This program can add additive noise, cause the signal to lag, or cause the signal to fade by a fixed amount. The first demodulation program then loads the applicable signal matrix and demodulates the signal into a matrix titled The demodulation program then utilizes the subroutine to create the variable The second demodulation program uses the PLL approach and also uses the program to create the variable. The results are as follows: Noise Correlator: Pass or Fail PLL: Pass or Fail None Pass Pass Pass Pass Pass Fail 50 samples Pass Pass 75 samples Fail Pass Pass Pass Pass Pass Table 4.2 BPSK Demodulation Results A discussion of the results will be presented in chapter 5. The simulation plots are on the following pages. 44

PAGE 57

3.5 3 2.5 2 1.5 0.5 o -0.5 0 1 0 0 0 0 1 0 A n 11 V V V V V V V V o 100 200 300 400 500 600 700 BOO 900 1000 45

PAGE 58

3 2 V V fI fI V 4.2.2 46

PAGE 59

3.5 3 2.5 0 1 0 0 2 1.5 1 0.5 A A 0 -0.5 -1 W w -1.5 0 0 1 0 W 100 200 300 400 500 600 700 800 900 1000 47

PAGE 60

3.5 3 2.5 o o o 2 1.5 0.5 0 -0.5 -1 -1.5 100 200 300 400 500 o o o 600 700 800 900 1000 & Figure 4.2.4 BPSK Demodulation for the Character B, sigma=1 48

PAGE 61

3.5 3 2.5 2 1.5 0.5 o -0.5 -1.5 0 1 0 0 V V 0 0 1 0 A A V V o 100 200 300 400 500 600 700 800 900 1000 & Figure 4.2.5 BPSK Demodulation for the Character B, no noise 49

PAGE 62

3 2 o V A A A V o 50

PAGE 63

@ 3.5 3 2.5 2 1.5 0.5 0 -0.5 -1 -1.5 0 o o o 100 200 300 400 500 o o o o 600 700 800 900 1000

PAGE 64

3.5 3 2.5 2 1.5 0.5 o -0.5 -1.5 0 0 0 0 0 0 1\ (\ f1 A A V V o 100 200 300 400 500 600 700 aoo 900 1000 52

PAGE 65

r(l) 3.5 3 2.5 0 1 0 1 2 1.5 0.5 A {\ A 0 -0.5 -1 -1.5 0 0 0 0 A FI FI f\ V V 100 200 300 400 500 600 700 800 900 1000 & 53

PAGE 66

3.5 3 2.5 2 1.5 0.5 o -0.5 -1.5 0 1 0 1 1'1 V 0 0 0 0 100 200 300 400 500 600 700 800 900 1000 Figure 4.2.10 BPSK Demodulation for the Character P, lag=50 54

PAGE 67

3.5 3 2.5 2 1.5 0.5 0 -0.5 -1 -1.5 100 200 300 400 A A fI A \ V v 500 600 700 800 900 1000 55

PAGE 68

3 2 o ret) V f\ V V o 56

PAGE 69

3.5 3 2.5 2 1.5 0.5 o ret) -0.5 -1.5 0 0 fI 0 0 0 0 A f\ fI (\ V V o 100 200 300 400 500 600 700 800 900 1000 57

PAGE 70

3 2 o f1 1\ V v V 1\ f1 V V V V o & Figure 4.2.14 BPSK Demodulation for the Character P, lag=75 58

PAGE 71

3.5 3 2.5 2 1.5 0.5 o s -0.5 0 1 0 1 0 0 1 1 fI 11 1\ V V V V o 100 200 300 400 500 600 700 800 900 1000 & 59

PAGE 72

3.5 3 2.5 0 1 0 1 2 1.5 0.5 A 0 -0.5 -1 V V V -1.5 0 0 1 1 V V 100 200 300 400 500 600 700 BOO 900 1000 & 60

PAGE 73

3.5 3 2.5 2 1.5 0.5 0 ret) -0.5 -1 -1.5 0 A 1 0 1 V V V V 0 0 1 1 A V V 100 200 300 400 500 600 700 800 900 1000 4.2.17 S, fade=25% 61

PAGE 74

3.5 3 2.5 2 1.5 0.5 0 -0.5 -1 -1.5 o o 100 200 300 400 500 o o 600 700 900 1000 & fade=75% 62

PAGE 75

3.5 3 2.5 2 1.5 0.5 o ret) -0.5 -1.5 0 \J 1 0 1 fI V 0 0 1 1 f\ V o 100 200 300 400 500 600 700 800 900 1000 63

PAGE 76

3.5 3 2.5 2 1.5 0.5 0 -0.5 -1 -1.5 0 V 1 0 1 A V V 0 0 1 1 {\ A V V V 100 200 300 400 500 600 700 aoo 900 1000 & 4.2.20

PAGE 77

3.5 3 2.5 o o 2 1.5 0.5 0 -0.5 -1 -1.5 100 200 300 400 500 o o 600 700 BOO 900 1000 & 65

PAGE 78

3.5 3 2.5 2 1.5 1 0.5 o s -0.5 -1.5 0 1 0 0 1 0 1 1 fI V V V v V V V o 100 200 300 400 500 600 700 800 900 1000 66

PAGE 79

3.5 2.5 0 0 0 2 1.5 0.5 0 -0.5 -1 V V -1.5 0 1 A V V v 100 200 300 400 500 600 700 800 900 1000 & Figure 4.2.23 BPSK Demodulation for the Character K, no noise 67

PAGE 80

3.5 3 2.5 2 1.5 0.5 o -0.5 -1.5 0 V V 0 0 V V V 0 f\ {\ V V 11 V V V V o 100 200 300 400 500 600 700 800 900 1000 Figure 4.2.24 BPSK Demodulation for the Character K, no noise 68

PAGE 81

4.3 QPSK Modulation Experiment For the second experiment, found in appendix will be utilized to visually demonstrate QPSK modulation. The four modulated letters are Q, P, S, and K. Notice in each figure that the pulse train is represented in the upper half of the diagram. The modulation program was written to utilize the subroutine as explained in section 4.2. After creating the signal matrix, the modulation program then saves to disk the signal matrix, the amplitude, and the frequency. Again, the program may be used to add various types of noise. The first demodulation program then loads the applicable signal matrix and demodulates the signal into a matrix titled The demodulation program then utilizes the subroutine to create the variable The second demodulation program uses the PLL approach and also uses the program to create the variable. The results are as follows: Noise Correlator: Pass or Fail PLL: Pass or Fail None Pass Pass = 0.5 Pass Pass = 1 Pass Fail = 5 samples Pass Pass = 10 samples Fail Pass Pass Pass Pass Pass Table 4.3 QPSK Demodulation Results 69

PAGE 82

0 7 6 0 0 0 0 5 4 3 0 2 o -2L_ __ _L ____ __ ____ _L ____ ____ L_ __ _L ____ ____ L_ __ 100 200 300 400 500 600 700 800 900 1000 70

PAGE 83

7 6 o o o o 3 o 2 o s _2L__ _L ____ ____ L_ __ _L ____ ____ L_ __ __ 100 200 300 400 500 600 700 800 900 1000 Figure 4.3.2 QPSK Demodulation for the Character Q, no noise 71

PAGE 84

7 6 o o 5 4r-------------------------. o o 3 o 2 o L_ __ _L ____ ____ L_ __ ____ ____ __ 100 200 300 400 500 600 700 800 900 1000 0' & 72

PAGE 85

7 6 a a 5 4 3 1 1 2 a 100 200 300 400 500 a a a 1 600 700 800 900 1000 & 73

PAGE 86

7 6 0 0 0 0 4 3 0 2 o 100 200 300 400 600 700 800 900 & Figure 4.3.5 QPSK Demodulation for the Character Q, no noise 74

PAGE 87

7 6 0 0 0 0 5 3 0 2 o sell -L ____ ____ __ __ 100 200 300 400 500 600 700 800 900 1000 75

PAGE 88

? 7 6 a a 5 4 a a 2 J a s tf W l1 &

PAGE 89

7 6 0 0 0 0 5 4 3 0 0 2 o s _2L__ ____ ____ L__ ____ ____ L__ ____ -L ____ L__ __ 100 200 300 400 500 600 700 BOO 900 1000 77

PAGE 90

7 6 o o 5 o o o o 2 A A A A A o s V V V v V V v V V V V 100 200 300 400 500 600 700 800 900 1000 78

PAGE 91

7 6 o o 5 4r-----------------------, o o 3 o o 2 A (\ o V V V v V V V V __ ____ __ ____ __ _l ____ __ & Figure 4.3.10 QPSK Demodulation for the Character P, lag=5 79

PAGE 92

7 6 5 4 3 2r---------------------------------------A A A a v v v v v v V v v v V Co4.3.11 80

PAGE 93

7 6 0 0 0 0 5 3 0 0 2 o s -2L__ ____ __ __ ____ ____ L__ -L ____ ____ L__ 100 200 300 400 500 600 700 800 900 1000 81

PAGE 94

7 6 1(1) 0 0 0 0 5 4 3 a a 2 s __ __ ____ ____ __ 100 200 300 400 500 600 700 BOO 900 1000 82

PAGE 95

7 6 o o 5 o o 3 o o 2 1 A A A o s V V V V v V V V V V 100 200 300 400 500 600 700 800 900 1000 83

PAGE 96

7 6 a a 5 4r-----------------------. a a 2 A A A (\ A a s V V V V V v V V V ____ __ ____ __ ____ __ 84

PAGE 97

7 6 o o 5 o o 2 o s -L ____ __ __ -L ____ ____ __ ____ ____ __ 100 200 300 400 500 600 700 BOO 900 1000 85

PAGE 98

7 6 o o o 3 o 2 o s 100 200 300 400 500 600 700 800 900 1000 & 86

PAGE 99

7 6 0 0 o 5 4 3 o 1 0 -1 100 200 300 400 500 600 700 800 900 1000 fade:::75% 87

PAGE 100

7 6 a 5 4 2 n A o s V V V V \ v V -1 & 88

PAGE 101

7 6 o o 5 o o 2 o s -2L_ __ _L ____ ____ L_ __ _L ____ ____ L_ __ 100 200 300 400 500 600 700 BOO 900 1000 89

PAGE 102

7 6 o o 5 o o 2 o s _2L__ _L ____ ____ L_ __ _L ____ ____ L_ __ ____ J_ ____ L_ __ 100 200 300 400 500 600 700 800 900 1000 & 90

PAGE 103

7 6 0 0 5 4 3 0 0 2 o s -2L__ ____ __ __ ____ ____ L__ -L ____ ____ L__ 100 200 300 400 500 600 700 800 900 1000 & 4.3.22 91

PAGE 104

s 7 6 5 3 1 A 0 V V V V V V V V V V V V & 92

PAGE 105

7 o o 4 1-----------, o o 2 o s __ __ __ __ 100 200 300 400 500 600 700 800 900 1000 & Figure 4.3.24 QPSK Demodu)ation for the Character K, no noise 93

PAGE 106

4.4 QAM Modulation Experiment For the third experiment, found in appendix will be utilized to visually demonstrate QAM modulation. The four modulated letters are Q, A, and M. Notice in each figure that the pulse train is represented in the upper half of the diagram. The modulation program was written to utilize the subroutine as explained in section 4.2. After creating the signal matrix, the modulation program then saves to disk the signal matrix, the amplitude, and the frequency. Again, the program may be used to add various types of noise. The first demodulation program then loads the applicable signal matrix and demodulates the signal into a matrix titled The demodulation program then utilizes the subroutine to create the variable The second demodulation program uses the PLL approach and also uses the program to create the variable. The results are as follows: Noise Correlator: Pass or Fail PLL: Pass or Fail None Pass Pass = 0.5 Pass Pass = 0.75 Pass Fail = 3 samples Pass Pass = 4 samples Fail Pass Pass Pass Fail Fail Table 4.4 QAM Demodulation Results 94

PAGE 107

16 14 a 1 01 0001 3 12 10 6 4 2 0 -4 100 200 300 400 500 600 700 BOO 900 1000 95

PAGE 108

a 18 16 14 12 10 4 2 set) 0 -4 0101 100 200 300 400 500 0001 600 700 800 900 1000 Figure 4.4.2 QAM Demodulation for the Character Q, no noise 96

PAGE 109

18 16 14 0101 o 12 10 6 4 2 a 100 200 300 400 500 a a 01 3 600 700 BOO 900 1000 Figure 4.4.3 QAM Demodulation for the Character Q, sigma=O.5 97

PAGE 110

18 16 14 0101 12 10 8 6 4 2 0 100 200 300 400 500 0001 600 700 800 900 1000 Figure 4.4.4 QAM Demodulation for the Character Q, sigma=O.75 98

PAGE 111

a 6 4 2 0 3 BOO 01 & Figure 4.4.5 QAM Demodulation for the Character Q, no noise 99

PAGE 112

18 16 14 12 10 4 2 0 0101 100 200 300 400 500 0001 3 600 700 800 900 1000 Figure 4.4.6 QAM Demodulation for the Character Q, sigma=O.5 100

PAGE 113

W 18 16 14 01 01 12 10 8 6 4 2 -4 100 200 300 400 500 0111 600 700 800 900 1000 & Figure 4.4.7 QAM Demodulation for the Character Q, sigma=O.75 101

PAGE 114

18 16 14 0100 -3 12 10 8 3 6 A A A A 2 -2 V v \ v 0001 v V V V V V V 100 200 300 400 500 600 700 800 900 1000 & Figure 4.4.8 QAM Modulation for the Character A 102

PAGE 115

18 16 Ott) 14 12 10 8 6 4 2 0100 -3 3 f1 A v v V V V 0001 v V V 100 200 300 400 500 600 700 800 900 1000 103

PAGE 116

1B 16 14 0100 -3 0001 3 12 10 8 3 1 6 4 f\. 1\ A n 2 A 0 -2 V V V -4 V v 100 200 300 400 500 600 700 BOO 900 1000 104

PAGE 117

3 B A A set) V v V V V V V v V v BOO & 105

PAGE 118

18 16 14 0100 12 10 3 6 41'\ A 2 sIt) 0 0001 3 Ann A -2 V V V V -4 V V 100 200 300 400 500 600 700 800 V V 900 1000 Figure 4.4.12 QAM Demodulation for the Character A, no noise 106

PAGE 119

16 14 0100 12 10 3 6 2 100 200 300 400 500 0001 3 600 700 BOO 900 1000 107

PAGE 120

16 14 12 10 6 2 0100 3 100 200 300 400 500 0001 3 600 700 BOO 900 1000 108

PAGE 121

18 16 14 12 10 8 6 4 2 0100 3 100 200 300 400 500 1 1 01 600 700 800 900 1000 & 109

PAGE 122

18 16 Ott) 14 0100 -3 12 10 8 3 4 2 100 200 300 400 500 1 1 01 600 700 800 900 1000

PAGE 123

18 16 14 12 10 2 0100 100 200 300 400 500 1 1 01 600 700 800 900 1000 & 111

PAGE 124

18 16 aCt) 14 12 10 6 2 set) 0 0101 100 200 300 400 500 11 01 600 700 BOO 900 1000

PAGE 125

18 16 14 0100 12 10 6 2 100 200 300 400 500 1 1 01 600 700 BOO 900 1000 & Figure 4.4.19 QAM Demodulation for the Character M, no noise

PAGE 126

18 16 14 12 10 6 4 2 0100 1 1 01 100 200 300 400 500 600 700 800 900 1000 &

PAGE 127

Figure 4.4.21 QAM Demodulation for the Character M, fade=15%

PAGE 128

5. Conclusion An examination of the three modulation techniques quickly reveals the added complexity each new method introduces. This complexity slows down both the modulation and the demodulation process. However, notice that Binary Phase Shift Keying (BPSK) method only sends one symbol per symbol period. This is contrasted by Quadrature Phase Shift Keying (QPSK) which can send 2 symbols per symbol period and Quadrature Amplitude Modulation (QAM) which can send 4 symbols per symbol period. If only given these three choices, the designer must balance the low bandwidth of the simpler modulation techniques with the complexity of the higher order modulation technique. From the outcome of the experimental results, we see that all three algorithms perform well in the presence of low amounts of noise. As was seen, with 0.5 the demodulation routines perfonned well. However, it should be noted that the correlation method (using minimum error of probability) worked better than the Phase-Locked Loop (PLL) method (using positive zero crossing detector) in the presence of noise greater than 0.75. This is due to the fact that the PLL may misinterpret and positive Additive White Gaussian Noise (A WGN) pulse as a positive zero crossing. Additionally, the correlation method uti1izes a summer that negates the noise that has a mean value of zero. 116

PAGE 129

From the outcome of the experimental results, we see that all three algorithms perform well in the presence of low amounts of phase error. However, when the channel was distorted with large amounts of lag, the PLL method worked better than the correlation method. This is due to the fact that the correlator method will begin to sum the symbol period too late and will produced an incorrect sum. The PLL method correctly detects the phase difference as long as the lag is less than 50% of the shift to the next hypothesis. Because of the added complexity of each new type of modulation, the BPSK had the widest margin of phase error and QAM had the smallest (as small as 4 samples). Both BPSK and QPSK were not effected by the presence of channel fading. This is due to the fact that both the correlator and PLL methods do not depend of the amplitude of the received signal. However, the QAM demodulation was greatly effected by channel fading. This is due to the fact that QAM uses an amplitude switch to determine its and vectors. When the amplitude is too low due to channel fading, the demodulator regardless of type compares the received signal to the wrong vector sets. The experiments revealed different types of modulation and demodulation present different challenges. A designer must choose between the robustness to noise yet low bandwidth of BPSK and the sensitivity to noise yet high bandwidth of QAM. The type of demodulator will also depend of the type of channel used. For channels with large amounts of additive noise, the designer would use the

PAGE 130

correlation method. For channel with large amounts of phase error, the designer would used the PLL method or implement some type of synchronization. For channels with large amounts of fading, the designer would avoid QAM or use a receiver amplifier. The most important result of the experiments was that the modulation and demodulation methods were demonstrated successfully. These models can be used further to experiment with new carrier frequencies and transmission media types.

PAGE 131

Acronyms ASK AWGN BPL BPSK FSK LSB MSB NRZ-L PD PLL PSD PSK PZCD QAM QPSK URZ VCO Amplitude Shift Keying Additive White Gaussian Noise Bi-Phase Level Binary Phase Shift Keying Frequency Shift Keying Least Significant Bit Most Significant Bit Non-Return to Zero Level Phase Detector Phase Locked Loop Power Spectral Density Phase Shift Keying Positive Zero Crossing Detector Quadrature Amplitude Modulation Quadrature Phase Shift Keying Unipolar Return to Zero Voltage Controlled Oscillator

PAGE 132

Source code clear; %%% This program was written on September 4th, 2000 %%% by William A. Burgess for BPSK Modulaiton %%% demonstration purposes disp('This program shall be used in conjunction with thesis titled'); disp('IIA Comparative Analysis of Modulation and Demodulation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); 1=[1 -1); Q=[O 0); periods=input('How many periods per symbol: '); for k=1:2, end for t = 1:100*periods, s(k,t)=1(k)*cos(2*pi*t/(100-Q(k)*sin(2*pi*t/(100; end figure;plot(s', 'k'); axis([1 100*periods -1 1.25]); text(90,1.1,'1(t)= 1'); text (40,1.1, I (t) = -1' ) ; title('BPSK Modulation Superimposed'); xlabel{'Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess)') j(1:100*periods)=s(1,1:100*periods); j(100*periods+1:200*periods)=s(2,1:100*periods); j(200*periods+l:300*periods)=s(1,1:100*periods); j(300*periods+1:400*periods)=s(2,1:100*periods); figure;plot(j, 'k'); axis([l 400*periods -1.25 1 .25); text(100,1.1,'1(t)= 1');line(200,-1.15:0.01:1.15); text (300, 1 .1, I (t) = -1' ) ; line ( 400, -1 .15 : 0 01 : 1 .15) ; t ext ( 500 1 1 I (t) = 1 ) ; line ( 600 -1 15 : 0 01 : 1 15) ; text(700,1.1,'1(t)= -1'); title(' BPSK Modulation Serial'); xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess)') %%% End of program %%% 120

PAGE 133

BPSK_mod.m clear; %%% I(t) is the pulse train/baseband signal to be modulated %%% sIt) is the modulated signal, only variable saved to disk %%% A is the constant amplification %%% f is the carrier frequency %%% matrix_input is the nx9 matrix contain the ASCII number and %%% 8 bit binary equivalent to be modulated %%% text_input is the character string inputted by the user disp('This program was written on August 16th by'); disp('Bill Burgess to visually demonstrate'); disp('Binary Phase Shift Keying using user input.'); disp (' ) ; disp('This program shall be used in conjunction with thesis titled'); disp('''A Comparative Analysis of Modulation and Demodulation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp ( ) ; %%% Get user input %%% lettobin; % Subroutine to converter letters to % ASCII characters and then to 8 bit % binary vectors, places information % into matrix_input A=input('Enter Amplitude: '); f=input('Enter Carrier Frequency (Hz): '); doplot=input('Enter 1 to plot: '); for k = 1:size(matrix_input,l), %%% Create pulse train, pIt) %%% for t = 1:8, end if matrix_input(k,t+1)==1, I (k, (t*125-124) : (t*125 =1; else I (k, (t*125-124) : (t*125 =-1; end

PAGE 134

%%% Create modulated signal, s(t) %%% for t = 1:1000, s(k,t)=I(k,t)*A*cos(2*pi*t/(2*pi*10)); end %%% Plot unrnodulated pulse train and modulated signal %%% if doplot==l, figure;hold on; plot (s (k, 1 : t) 0 .25, k ) ; text ( -1 0 0, 0 .25, s (t) ) ; plot(I(k,1:t)+2.25, 'k')itext(-100, 2.25,'I(t)'); title(text_input(k)) ; text(-50,3.73,'BPSK modulation for the character: '); xlabel('Comparative Analysis of Modulation & Demodulation Digital Communications (WA Burgess)') hold %%% Add text of '0' or '1' to pulse train diagram %%% for t=1:8; if matrix_input(k,t+l)==O. text.(t*125-70,2.5,'0'); else end end end text(t*125.,.70,2.5, '1'); %%% End of loop, go to next character to be modulated end save BPSK.mat s f A coherent clear; %%% End of program %%% % Saves only modulated signal and % components to disk % Clears all signals from memory 122

PAGE 135

BPSK_cor.m clear; %%% s(t) is the modulated signal, loaded from disk %%% r(t) is the received signal %%% A is the constant amplification, loaded from disk %%% f is the carrier frequency, loaded from disk %%% d(t) is the demodulated pulse train %%% matrix_output is the nx9 matrix contain the ASCII number and %%% 8 bit binary equivalent to be modulated %%% text_ouput is the character string containing the answer disp('This program was written on August 29th by'); disp('Bill Burgess to visually demonstrate'); disp('Binary Phase Shift Keying demodulation.'); disp ( ) ; disp('This program shall be used in conjuction with thesis titled'); disp('''A Comparative Analysis of Modulation and Demoudlation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp (' ) ; load bpsk.mat; h=O; for k = l:size(s,l), for i = 1:8, for t = 1:125, h=h+s(k, (i*125-124)+t-1)*A*cos(2*pi*((i*125-124)+t)/(2*pi*10; h>O; I (k, (125*i-124) : (125*i =1; matrix_output(k,i+1)=1; else I (k, (125*i-124) : (125*i =-1; matrix_output(k,i+l) =0; end end h=O; end bintolet; % Subroutine to converter 8 bit binary % vectors into ASCII charaters and then % to English letters, places information % into matrix_output and text_output

PAGE 136

%%% Plot received signal and modulated pulse train %%% figure;hold on; axi s ( [1 1000 -1. 5 3. 5] ) ; plot (s (k, 1 : 1000) 0 .25, k' ) ; text (-100, 0 .25, r (t) ) ; plot(I(k,1:1000)+2.25, 'k');text(-100, 2.25,'I(t)'); title(text_output(k; text(-50,3.73,'BPSK demodulation for the character: '); text(800,3.73, 'Correlation Method'); xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess)') hold off; %%% Add text of '0' or '1' to pulse train diagram %%% for t=1:8; end if matrix_output (k,t+1)==0, text(t*125-70,2.5, '0'); else text(t*125-70,2.5, '1'); end %%% End of loop, go to next character to be modulated end %%% End of program %%% 124

PAGE 137

clear; %%% sIt) is the modulated signal, loaded from disk %%% r(t) is the received signal %%% A is the constant amplification, loaded from disk %%% f is the carrier frequency, loaded from disk %%% u(t) is the VCO output to be compared to the received signal %%% I(t) is the demodulated pulse train %%% matrix_output is the nx9 matrix contain the ASCII number and %%% 8 bit binary equivalent to be modulated %%% text_ouput is the character string containing the answer disp('This program was written on September 13th disp('Bill Burgess to visually demonstrate'); disp('Binary Phase Shift Keying demodulation using PLL.')i disp ( ) ; disp('This program shall be used in conjuction with thesis titled'); disp('''A Comparative Analysis of Modulation and disp(' Used in Digital Communications", 2000 by WA Burgess'); disp (' ') load bpsk.mat; for k=l:size(s,l), index1=1;index2=1; for r(k, (i*125-124) )=s (k, (i*125-124)); u (k, (i*125-124)) =A*cos (2*pi* i*125-124)) / (2*pi*10)); for = 2:125, r(k, (i*125-124)+t-1)=s(k, (i*125-124)+t-1); u(k, (i*125-124)+t-1)=A*cos(2*pi*i*125-124)+t-1) / (2*pi*10)); %%% %%% Determine Positive Zero Crossing for Received Signal r(k, (i*125-124)+t-1, end r(k, (i*125-124)+t-2)<0, pzcd1(index1)=(i*125-124)+t-1; index1=index1+1i end 125

PAGE 138

%%% end %%% Determine positive Zero Crossing for H1 (1=1) %%% if u(k, (i*125-124)+t-1O, end end if u(k, pzcd2(index2)=(i*125-124)+t-1; index2=index2+1; end index1=1;index2=1; %%% Determine Max PZCD difference between received signal and H1 for y = 1:min(size(pzcd1,2) ,size(pzcd2,2, x(y)=abs(pzcd1(y)-pzcd2(y; end %%% Determine I(t) vector %%% if min(x)<=15, matrix_output(k,i+1)=1; I(k,i*125-124:i*125)=1; else matrix_output =0; I(k,i*125-124:i*125)=-1; end bintolet; % Subroutine to converter 8 bit binary % vectors into ASCII charaters and then % to English letters, places information % into matrix_output and text_output %%% Plot received signal and modulated pulse train %%% figure;hold on; plot (r (k, 1 : 1 00 0 ) 0 2 5 k' ) ; t ext ( -100 0 2 5, 'r ( t) ) ; plot(I(k,l:1000)+2.25, 'k');text(-lOO, 2.25,'I(t)'); title(text_output(k; text(-50,3.73,'BPSK demodulation for the character: '); text(900,3.73, 'PLL Method'); xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess)') hold off; %%% Add text of '0' or '1' to pulse train diagram %%% 126

PAGE 139

end for 1 = 1:8, if I(k,l*125)==l, text(1*125-124+50,2.5, '1'); else text(1*125-124+50,2.5, '0'); end %%% End of loop, go to next character to be modulated end %%% End of program 127

PAGE 140

QPSKpiot.m clearj I=[l 1 -1 -1]; Q=[l -1 1 -1]; %%% This program was written on September 4th, 2000 %%% by William A. Burgess for QPSK Modulaiton %%% demonstration purposes disp('This program shall be used in conjuction with thesis titled'); disp('IIA Comparative Analysis of Modulation and Demoudlation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp (' ') ; periods=input('How many periods per symbol: '); for k=1:4, end for t = 1:100*periods, end axis([l 100*periods -1.5 1.8J); text(80,1.6,'I(t)= 1, Q(t)= 1'); text( 5,1.5,'I(t)= 1, Q(t)= -1'); text(55,1.5,'I(t)= -1, Q(t)= 1'); text(30,1.6,'I(t)= -1, Q(t)= title('QPSK Modulation Superimposed'); xlabel('Comparative Analysis of Modulation & Demodulation in Communications (WA Burgess)') j(1:100*periods)=s(l,l:100*periods) ; j(100*periods+1:200*periods)=s(4,l:100*periods)i (j, 'k') axis([l 200*periods -1.5 1.75]); text ( 75,l.5,'I(t)= 1, Q(t)= 1.45:0.01:1.45); text (275, 1 5, I (t) -1, Q (t) -1' ) title('QPSK Modulation Serial'); xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess)') %%% End of program %%% 128

PAGE 141

QPSK_mod.m clear; %%% I(t) is the cosine portion of the modulated signal %%% Q(t) is.the sine portion of the modulated signal %%% set) is the modulated signal, SAVED TO DISK %%% A is the constant amplification, SAVED TO DISK %%% f is the carrier frequency, SAVED TO DISK %%% matrix_input is the nx9 matrix contain the ASCII number and %%% 8 bit binary equivalent to be modulated disp('This program was written on August 19th by'); disp('Bill Burgess to visually demonstrate'); disp('Quadrature Phase Shift Keying using a user input.'); disp (' ) ; disp('This program shall be used conjuction with thesis titled'); disp('''A Comparative Analysis of Modulation and Demoudlation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp ( ) ; %%% Get user input %%% lettobin; % Subroutine to converter letters to % ASCII charaters and then to 8 bit % binary vectors A=input('Enter Amplitude: '); f=input('Enter Carrier Frequency (Hz): '); doplot=input('Enter 1 to plot: '); for k = l:size(matrix_input,l), %%% Create pulse trains, I(t) and Q(t) %%% for t = 1:2:7, if matrix_input(k,t+1)==1, I (k, (t*125-124) : (t*125+125 =1; else I (k, (t*125-124): (t*12S+125) )=-1; end if matrix_input(k,t+2)==1, Q(k, (t*125-124): (t*12S+12S) )=1; else 129

PAGE 142

Q (k, (t*125-124) : (t*125+125 =-1; end end for t = 1:1000, s(k,t)=l(k,t)*A*cos(2*pi*t/(2*pi*10Q(k,t)*A*sin(2*pi*t/(2*pi*10; end %%% Plot unmodulated pulse train and modulated components %%% if doplot==l, figure;hold on; axis([l 1000 -2 7); pIot(l(k,l:1000)+5.5 ,'k');text(-100, 5.5 ,'l(t)'); pIot(Q(k,l:1000)+3 3 ,'Q(t)')i plot (s (k, 1 : 1000) 0 25, 'k' ) text ( -1 00, 0 .25, s ( t) ) titIe(text_input(k; text(-25,7.39,'QPSK modulation for the character: '); xIabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess)') hold off; %%% Add text of '0' or '1' to pulse train diagram %%% for t=1:2:7, end end end if matrix_input (k,t+l) ==0, text(t*125,5.5, '0') else text(t*125,5.5,'l') end if matrix_input (k,t+2)==O, text ( t 125 3 a ) else text (t 125,3, '1' ) ; end save QPSK.mat s A % Saves only modulated signal and coherent % components to disk clear; % Clears memory 130

PAGE 143

QPSK_cor.m clear; %%% sIt) the modulated signal, loaded from disk %%% r(t) the received signal %%% A the constant amplification, loaded from disk %%% f the carrier frequency, loaded from disk %%% I(t) and Q(t) are the demodulated pulse trains %%% matrix_output the nx9 matrix contain the ASCII number and %%% 8 bit binary equivalent to be modulated %%% text_ouput the character string containing the answer disp('This program was written on August 30th by'); disp('Bill Burgess to visually demonstrate'); disp('Quadrature Phase Shift Keying demodulations.'); disp (' ') ; disp('This program shall be used in conjuction with thesis titled'); disp('IIA Comparative Analysis of Modulation and Demoudlation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp (' ) ; load qpsk.mat; h=zeros(1,4); for k = l:size(s,l), for = 1:4, for t = 1:250, shift=(i*250-249)+t-1; h(l)=h(l) + s(k.shift)*( A*sin(2*pi*shift/(2*pi*10))); h(2)=h(2) + s(k,shift)*( A*cos(2*pi*shift/(2*pi*10)) + h(3)=h(3) + s(k,shift)*(-A*cos(2*pi*shift/(2*pi*10)) -A*sin(2*pi*shift/(2*pi*10))); h(4)=h(4) + s(k,shift)*(-A*cos(2*pi*shift/(2*pi*10)) + A*sin(2*pi*shift/(2*pi*10))); end %%% Determine I(t) and Q(t) vectors %%% h(l)==max(h), I (k, (i *250-249) : (i *250) ) =1; Q(k. 131

PAGE 144

end h (2) ==max (h) I{k, (i*250-249): (i*250=1; Q{k, (i*250-249): (i*250) )=-1; end if h(3)==max{h), end I(k, (i*250-249): (i*250=-1; Q{k, (i*250-249): (i*250) )=1; h (4) ==max (h) end I(k, (i*250-249): (i*250) )=-1; Q(k, (i*250-249): h=zeros(l,4); end for t=1:2:7, end if I(k,t*125)==l, matrix_output (k,t+1)=1; else matrix_output (k,t+1)=0; end if Q{k,t*125)==l, matrix_output (k,t+2)=1; else matrix_output (k,t+2)=0; end bintolet; % Subroutine to converter 8 bit binary % vectors into ASCII charaters and then % to English letters, places information % into matrix_output and text_output %%% Plot received signal and modulated pulse train %%% figure;hold on; axis([l 1000 -2 7]); plot(I(k,l:1000)+S.5 ,'k');text(-100, 5.5 ,'I(t)'); plot(Q(k,l:1000)+3 ,'k');text(-100,3 ,'Q(t)'); plot (s (k, 1 : 1000) 0.25, 'k' ) ; text (-100, -0.25, s (t) ) ; title(text_output(k; text(-25,7.39, 'QPSK demodulation for the character: '); text(800,7.39, 'Correlation Method'); xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess) ') hold off; %%% Add text of '0' or '1' to pulse train diagram %%% 132

PAGE 145

for t=1:2:7, end if matrix_output(k,t+l)==O, text(t'*125,5.5,'O') else text(t'*125,5.5,'l') end if matrix_output(k,t+2)==O, text(t*125,3,'O') else text(t*125,3,'l') end %%% End of loop, go to next character to be modulated end %%% End of program %%%

PAGE 146

QPSKyll.m clear; %%% sIt) is the modulated signal, loaded from disk %%% r(t) is the received signal %%% A is the constant amplification, loaded from disk %%% f is the carrier frequency, loaded from disk %%% u(t) is the VCO output to be compared to the received signal %%% d(t) is the demodulated pulse train %%% matrix_output is the nx9 matrix contain the ASCII number and %%% 8 bit binary equivalent to be modulated %%% text_ouput is the character string containing the answer disp('This program was written on September 17th by'); disp('Bill Burgess to visually demonstrate'); disp('Quadrature Phase Shift Keying demodulation using PLL.'); disp (' ) ; disp('This program shall be used in conjuction with thesis titled') ; disp(,nA Comparative Analysis of Modulation and Demoudlation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp ( ) ; load qpsk.mat; h=zeros(l,4); for k=l:size(s,l), index=1;index1=1;index2=1;index3=1;index4=1; for i=1:4, r(k, (i"'250-249) )=s(k, (i"'250-249; u1 (k, (i "'250-249) ) =A"'cos (2"'pi '" ( (i "'250-249) ) (2"'pi "'10) ) A*sin(2*pi"'i"'250-249/(2*pi*10 ; u2(k, (i"'250-249=A"'cos(2*pi*i"'250-249/(2*pi*10+A*sin(2*pi*i*250-249/(2*pi*10; u3 (k, (i*250-249 =-A"'cos (2*pi* i*250-249 (2*pi*10A*sin(2*pi*i"'250-249/(2*pi*10; u4(k, (i*250-249=-A"'cos(2*pi*i*250(2*pi*10 +A*sin(2*pi* i*250-249 (2*pi*10; for t = 2:250, r (k, (i*250-249) +t-1) =s (k, (i*250-249) +t-1); u1(k, (i*250-249)+t-1)=A"'cos(2*pi*i*250-249)+t1)/(2*pi*10)-A*sin(2*pi*i*250-249)+t-1)/(2*pi*10; u2 (k, (i *250-249) +t-1) =A*cos (2*pi '" ( (i *250-249) +t1)/(2*pi*10)+A*sin(2*pi"'i*250-249)+t-1)/(2*pi*16; 134

PAGE 147

u3(k, (i*250-249)+t-1)=-A*cos(2*pi*((i*250-249)+t-1)/(2*pi*10-A*sin(2*pi*((i*250-249)+t-1)/(2*pi*10i u4(k, (i*250-249)+t-1)=-A*cos(2*pi*((i*250-249)+t-1)/(2*pi*10+A*sin(2*pi*((i*250-249)+t-1)/(2*pi*10; %%% %%% %%% %%% %%% Determine Positive Zero Crossing for Received Signal r(k, (i*250-249)+t-1O, r (k, (i *250-249) +t-2) <0, pzcd(index)=(i*250-249)+t-1i index=index+1i end end %%% Determine positive Zero Crossing for (I=1, Q=1) %%% u1(k, (i*250-249)+t-1, if (i*250-249)+t-2)
PAGE 148

end end index4=index4+1; end index=1;indexl=1;index2=1;index3=1;index4=1; %%% Determine Max PZCD difference between received signal and Hl %%% for y = 1:min(size(pzcd,2),size(pzcd1,2, x(y)=abs(pzcd(y)-pzcd1(y; end h(l)=max(x); %%% Determine Max PZCD difference between received signal and H2 %%% for y = 1:min(size(pzcd,2),size(pzcd2,2, x(y)=abs(pzcd(y)-pzcd2(y; end h(2)=max(x); %%% Determine Max PZCD difference between received signal and H3 %%% for y = 1:min(size(pzcd,2),size(pzcd3,2, x(y)=abs(pzcd(y)-pzcd3(y; end h ( 3 ) =max (x) ; %%% Determine Max PZCD difference between received signal and H4 %%% for y = 1:min(size(pzcd,2),size(pzcd4,2 x(y)=abs(pzcd(y)-pzcd4(y; end h ( 4 ) =max (x) ; %%% Determine I(t) and Q(t) vectors %%% if h(l)==min(h), end I(k, (i*250-249): (i*250) )=1; Q(k, (i*250-249): (i*250) )=1; if h(2)==min(h), end I(k, (i*250-249): (i*250) )=1; Q(k, (i*250-249): (i*250) )=-1;

PAGE 149

if h(3)==min(h), I (k, (i*250-249): (i*250) )=-1; Q(k, (i*250-249): (i*250) )=1; end if h(4)==min(h), end I (k, (i *250-249) : (i *250) ) =-1; Q(k, (i*250-249): (i*250) )=-1; h=zeros(1,4); end %%% Fill in matrix_output so bintolet.m can use it %%% for t=1:2:7, end if I(k,t*125)==1, matrix_output (k,t+1)=1; else matrix_output(k,t+1)=0; end if Q(k,t*125)==1, matrix_output(k,t+2)=1; else matrix_output (k,t+2)=0; end bintolet; % Subroutine to converter 8 bit binary % vectors into ASCII charaters and then % to English letters, places information % into matrix_output and text_output %%% Plot received signal and modulated pulse train %%% figure;hold on; axis([l 1000 -2 7]); plot(I(k,1:1000)+5.5 ,'k');text(-100, 5.5 ,'I(t)'); plot(Q(k,1:1000)+3 ,'k');text(-100,3 ,'Q(t)'); plot(s(k,1:1000)-0.25, 'k') ;text(-100,-0.25, 's(t)'); title(text_output(k; text(-25,7.39,'QPSK demodulation for the character: '); text(900,7.39,'PLL Method'); xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess) ') %%% Add text of '0' or '1' to pulse train diagram %%% for t=1:2:7, 137

PAGE 150

end if matrix_output(k,t+1)==0, text(t*125,5.5, '0') else text(t*125,5.5, '1') end if matrix_output (k,t+2)==O, text (t*125, 3,' 0') else text(t*125,3, '1') end %%% End of loop, go to next character to be modulated end %%% End of program 138

PAGE 151

QAMplot.m clear; %%% This program was written on September 5th, 2000 %%% by William A. Burgess for QAM Modulaiton %%% demonstration purposes disp('This program shall be used in conjuction with thesis titled'); disp('IIA Comparative Analysis of Modulation and Demoudlation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp (' ') ; I=[l 1 -1 -1 Q=[l -1 1-1 3 3 -3 -3 3 -3 3-3 3 -1 -3 1 1 3 -1-3 1 -3 -1 3]; 3 1 -3 -1]; periods=input('How many periods per symbol: '); for k=1:4, for t = 1:100*periods, sl(k,t)=I(k)*cos(2*pi*t/100)-Q(k)*sin(2*pi*t/100); end end maxh(l)=max(sl(1,1:100*periods; for k=5:8, for t = 1:100*periods, s2(k-4,t)=I(k)*cos(2*pi*t/100)-Q(k)*sin(2*pi*t/100); end end maxh(2)=max(s2(1,1:100*periods; for k=9:12, for t = 1:100*periods, s3(k-8,t)=I(k)*cos(2*pi*t/100)-Q(k)*sin(2*pi*t/100); end end maxh(3)=max(s3(1,1:100*periods; for k=13:16, end for t = 1:100*periods, s4(k-12,t)=I(k)*cos(2*pi*t/100)-Q(k)*sin(2*pi*t/100); end 139

PAGE 152

maxh(4)=max(s4(1,1:100*periods figure;hold on; axis([1 100*periods -3 37]); plot(s1', 'k'); plot(s2'+10, 'k'); plot(s3'+20, 'k'); plot(s4'+30, 'k'); text (80,2.5, I (t) = 1; Q (t) = 1'); text( 5,2.5,'l(t)= 1;Q(t)=-1'); text(55,2.5,'l(t)=-1;Q(t)= 1'); text(30,2.5,'l(t)=-1;Q(t)=-1'); text(80,15, 'l(t)= 3;Q(t)= 3'); text ( 5,15, 'l(t)= 3;Q(t)=-3'); text(55,15, 'l(t)=-3;Q(t)= 3'); text(30,15, 'l(t)=-3;Q(t)=-3'); text(85,24, 'l(t)= 3;Q(t)= 1'); text(10,24, 'l(t)=-1;Q(t)= 3'); text(60,24, 'l(t)=-3;Q(t)=-1'); text(35,24, 'l(t)= 1;Q(t)=-3'); text(75,34, 'l(t)= 1;Q(t)= 3'); text ( 0,34, 'l(t)=-3;Q(t)= 1'); text(50,34, 'l(t)=-1;Q(t)=-3'); text(25,34, 'l(t)= 3;Q(t)=-1'); title('QAM Modulation Superimposed'); xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess)') hold off; j(1:100*periods)=s4(3,1:100*periods); j(100*periods+1:200*periods)=s4(2,1:100*periods); figure;plot(j, 'k') text ( 75,3.5,'l(t)= 1, Q(t)= -3');line(200,-3.45:0.01:3.45); t ex t ( 27 5 3 5, I ( t ) = -3, Q ( t ) = 1 ) ; title('QAM Modulation Serial'); xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess)') %%% End of Program %%%

PAGE 153

QAM_mod.m clear; disp('This program was written on July 25th by'); disp('Bill Burgess to visually demonstrate'); disp('Quadrature Amplitude Modulation using a user input.'); disp (' ) disp('This program shall be used in conjuction with thesis titled'); disp('''A Comparative Analysis of Modulation and Demoudlation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp (' ') ; lettobin; % Subroutine to converter letters to % ASCII charaters and then to 8 bit % binary vectors A=input('Enter Amplitude: f=input('Enter Carrier Frequency doplot=input('Enter 1 to plot: ) %%%%%%%%%%%%%%% Matrix Determined %%%%%%%%%%%%%%% QAM_compare= [ [ 0 0 0 0 3 3] [0 0 0 1 1 3] [0 0 1 0 -3 3] [0 0 1 1 -1 3] [0 1 0 0 3 -3] [0 1 0 1 1 -3] [0 1 1 0 -3 -3] [0 1 1 1 -1 -3] [1 0 0 0 3 1] [1 0 0 1 1 1] [1 0 1 0 -3 1] [1 0 1 1 -1 1] [1 1 0 0 3 -1] [1 1 0 1 1 -1] [1 1 1 0 -3 -1] [1 1 1 1 -1 -1] ] for k = l:size(matrix_input,l), %%% Create first half of I and Q signal %%% for i = 1:16,

PAGE 154

if matrix_input(k,2:5)==QAM_compare(i,l:4); I(1:500)=QAM_compare(i,5); I1=QAM_compare(i,5); Q(1:500)=QAM_compare(i,6); end end %%% Create second half of I and Q signal %%% for i = 1:16, if matrix_input(k,6:9)==QAM_compare(i,l:4); I(501:1000)=QAM_compare(i,5); 12=QAM_compare(i,5)i Q(501:1000)=QAM_compare(i,6); Q2=QAM_compare(i,6); end end %%% Create modulated output %%% for s(k,i)=I(i)*A*cos(2*pi*i/(2*pi*10Q(i)*A*sin(2*pi*i/(2*pi*10; end %%% Plot modulated output with I and Q pulse trains %%% figure;hold on; axis([l 1000 -5 18]); plot(I+8 ,'I(t)'); plot(Q+14.25 ,'k');text(-100,14.25,'Q(t)'); plot(s(k,l:1000)-O.25,'k');text(-100,-O.25 's(t) '); title(text_input(k; text(-25,19, 'QAM modulation for the character: '); xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess)') %%% Place 4-bit vector on first half of graph %%% for i = 2:5, end if matrix_input(k,i)==l; text(50+i*20,14.25,'l'); else text(50+i*20,14.25,'O') end %%% Place 4-bit vector on second half of graph %%% 142

PAGE 155

for i = 6:9, end if matrix_input(k,i)==li text ( 5 5 0 + (i -4) '" 2 0 14 2 5, l' ) else text(550+(i-4)*20,14.25,'O') end %%% Place I and Q values on graph %%% if Il==-3, if Il==-l, if Il== 1, if Il== 3, if I2==-3, if I2==-l, if I2== 1, if I2== 3, if Ql==-3, if Q1==-l, if Q1== 1, if Q1== 3, if Q2==-3, if Q2==-l, if Q2== 1, if Q2== 3, text(250,8 ,'I(t)= text(250,8 ,'I(t)= text(250,8 ,'I(t)= text(250,8 ,'I(t)= text(750,8 ,'I(t)= text(750,8 ,'I(t)= text(750,8 ,'I(t)= text(750,8 ,'I(t)= text(250,14.25, 'Q(t)= text(250,14.25,'Q(t)= text(250,14.25,'Q(t)= text(250,14.25,'Q(t)= text(750,14.25,'Q(t)= text(750,14.25,'Q(t)= text(750,14.25,'Q(t)= text(750,14.25,'Q(t)= -3') iend -l')iend l')iend 3')iend -3' ) end -l')jend l')jend 3') ; end end -l')iend l')iend 3') iend -3')iend -l')jend l');end 3') iend %%% End of loop, goto next letter %%% end save QAM.mat s f A coherent % Saves only modulated signal and % components to disk % Clears memory

PAGE 156

QAM_cor.m clear; %%% set) the modulated signal, loaded from disk %%% ret) the received signal %%% A the constant amplification, loaded from %%% f the carrier frequency, loaded from disk %%% I(t) and Q(t) are the demodulated pulse trains %%% matrix_output the nx9 matrix contain the ASCII number and %%% 8 bit binary equivalent to be modulated %%% text_ouput the character string containing the answer disp('This program was written on October 1st by'); disp('Bill Burgess to visually demonstrate'); disp('Quadrature Amplitude Modulation demodulation.'); disp (' ') ; disp('This program shall be used in conjuction with thesis titled') ; disp('IIA Comparative Analysis of Modulation and Demoudlation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp (' ') ; load qam.mat %%%%%%%%%%%%%%% Matrix Determined %%%%%%%%%%%%%%% QAM_compare=[[O 0 0 0 3 3] [0 0 0 1 1 3] [0 0 1 0 -3 3] [0 0 1 -1 3] [0 1 0 0 3 -3] [0 0 1 1 -3] [0 1 0 -3 -3] [0 1 1 1 -1 -3] [1 0 0 0 3 1] [1 0 0 1 [1 0 1 0 -3 [1 0 1 -1 1 0 0 3 1 0 -1] [1 1 1 0 -3 1 -1 for k l:size(s,l),

PAGE 157

max(s(k,1:S00>3.7, 11=3; 12=3; 13=-3; 14=-3; 15=0; 16=0; 17=0; 18=0; Q1=3; Q2=-3; Q3=3; Q4=-3; QS=O; Q6=0; Q7=0; Q8=0; elseif max(s(k,1:S00<2.3, 11=1; 12=1; 13=-1; 14=-1; 15=0; 16=0; 17=0; 18=0; Q1=1; Q2=-1; Q3=1; Q4=-1; QS=O; Q6=0; Q7=0; Q8=0; else 11=3; 12=-1; 13=-3; 14=1; 15=1; 16=-3; 17=-1; 18=3; Q1=1; Q2=3; Q3=-1; Q4=-3; QS=3; Q6=1; Q7=-3; Q8=-1; end h=zeros(1,8); for t = 1:500, h(1)=h(1)+s(k,t)*(11*A*cos(2*pi*t/(2*pi*10Q1*A*sin(2*pi*t/(2*pi*10); h(2)=h(2)+s(k,t)*(12*A*cos(2*pi*t/(2*pi*10Q2*A*sin(2*pi*t/(2*pi*10); h(3)=h(3)+s(k,t)*(13*A*cos(2*pi*t/(2*pi*10Q3*A*sin(2*pi*t/(2*pi*10); h(4)=h(4)+s(k,t)*(14*A*cos(2*pi*t/(2*pi*10Q4*A*sin(2*pi*t/(2*pi*10); h(S)=h(S)+s(k,t)*(IS*A*cos(2*pi*t/(2*pi*10QS*A*sin(2*pi*t/(2*pi*10); h(6)=h(6)+s(k,t)*(16*A*cos(2*pi*t/(2*pi*10Q6*A*sin(2*pi*t/(2*pi*10); h(7)=h(7)+s(k,t)*(17*A*cos(2*pi*t/(2*pi*10Q7*A*sin(2*pi*t/(2*pi*10); h(8)=h(8)+s(k,t)*(18*A*cos(2*pi*t/(2*pi*10Q8*A*sin(2*pi*t/(2*pi*10); %%% end %%% Determine l(t) and Q(t) vectors %%% h (1) ==max (h), 1(1:500)=11; Q(1:S00)=Q1; end h(2)==max(h) 1(1:500)=12; Q(1:500)=Q2; end h (3) ==max (h) 1(1:500)=13; Q(1:S00)=Q3; end h ( 4 ) = =max (h) 1(1:500)=14; Q(1:S00)=Q4; end h(5)==max(h) 1(1:500)=15; Q(1:S00)=Q5; end h(6)==max(h) 1(1:500)=16; Q(1:S00)=Q6; end h(7)==max(h) 1(1:500)=17; Q(1:500)=Q7; end h(8)==max(h) 1(1:500)=18; Q(1:S00)=Q8; end %%% Translate I (t) and Q(t) vectors into 4 bit binary vectors for i = 1:16, if 1(2S0)==QAM_compare(i,S); if Q(250)==QAM_cornpare(i,6); matrix_output(k,2:S)=QAM_compare(i,1:4);

PAGE 158

end end end if max(s(k,501:1000>3.7, 11=3; 12=3; 13=-3; 14=-3; 15=0; 16=0; 17=0; 18=0; Q1=3; Q2=-3; Q3=3; Q4=-3; Q5=0; Q6=0; Q7=0; Q8=0; elseif max(s(k,501:1000<2.3, 11=1; 12=1; 13=-1; 14=-1; 15=0; 16=0; 17=0; 18=0; Q1=1; Q2=-1; Q3=1; Q4=-1; Q5=0; Q6=0; Q7=0; Q8=0; else end 11=3; 12=-1; 13=-3; 14=1; 15=1; 16=-3; 17=-1; 18=3; Q1=1; Q2=3; Q3=-1; Q4=-3; Q5=3; Q6=1; Q7=-3; Q8=-1; h=zeros(l,8); for t = 501:1000, h(1)=h(1)+s(k,t)*(I1*A*cos(2*pi*t/(2*pi*10Q1*A*sin(2*pi*t/(2*pi*10); h(2)=h(2)+s(k,t)*(I2*A*cos(2*pi*t/(2*pi*10Q2*A*sin(2*pi*t/(2*pi*10); h(3)=h(3)+s(k;t)*(I3*A*cos(2*pi*t/(2*pi*10Q3*A*sin(2*pi*t/(2*pi*10); h(4)=h(4)+s(k,t)*(I4*A*cos(2*pi*t/(2*pi*10Q4*A*sin(2*pi*t/(2*pi*10); h(5)=h(5)+s(k;t)*(I5*A*cos(2*pi*t/(2*pi*10Q5*A*sin(2*pi*t/(2*pi*10); h(6)=h(6)+s(k,t)*(I6*A*cos(2*pi*t/(2*pi*10Q6*A*sin(2*pi*t/(2*pi*10); h(7)=h(7)+s(k,t)*(I7*A*cos(2*pi*t/(2*pi*10Q7*A*sin(2*pi*t/(2*pi*10); h(8)=h(8)+s(k,t)*(I8*A*cos(2*pi*t/(2*pi*10Q8*A*sin(2*pi*t/(2*pi*10); %%% end %%% Determine I(t) and Q(t) vectors %%% if h(l)==max(h), 1(501:1000)=11; Q(501:1000)=Q1; end if h(2)==max(h), 1(501:1000)=12; Q(501:1000)=Q2; end if h(3)==max(h), 1(501:1000)=13; Q(501:1000)=Q3; end if h(4)==max(h), 1(501:1000)=14; Q(501:1000)=Q4; end if h(5)==max(h), 1(501:1000)=15; Q(501:1000)=Q5; end if h(6)==max(h) 1(501:1000)=16; Q(501:1000)=Q6; end if h(7)==max(h), 1(501:1000)=17; Q(501:1000)=Q7; end if h(8)==max(h), 1(501:1000)=18; Q(501:1000)=Q8; end %%% Translate I(t) and Q(t) vectors into 4 bit binary vectors 146

PAGE 159

for i = 1:16, if I(750)==QAM_compare(i,5)j end if matrix_output(k,6:9)=QAM_compare(i,1:4)j end end bintoletj % Subroutine to converter 8 bit binary % vectors into ASCII charaters and then % to English letters, places information % into matrix_output and text_output figurejhold axis([l 1000 -5 plot(I+8 ,'k')jtext(-100,8 ,'I(t)')j plot(Q+14.25 ,'k')jtext(-100,14.25,'Q(t)')j plot(s(k,1:1000)-0.25, 'k') jtext(-100,-0.25 's(t)') title(text_output(k; text(-25,19,'QAM demodulation for the character: '); text(800,19, 'Correlation Method')j xlabel('Comparative Analysis of Modulation & Demodulation in Digital Communications (WA Burgess) ') hold off; %%% Place 4-bit vector on first half of graph %%% for i = 2 :.5, end if matrix_output (k,i)==l; text(50+i*20,14.25, '1'); else text(50+i*20,14.25,'O') ; end %%% Place 4-bit vector on second half of graph %%% for 6:9, if matrix_output(k,i)==lj t ex t ( 55 0 + ( i 4) 2 0 14 2 5, 1 ) ; else text(550+(i-4)*20,14.25,'O') ; end end %%% Place I and Q values on graph %%% if I(250)==-3, text(250,8 if I(250)==-l, text(250,8 if 1(250)== 1, text(250,8 I (t) = 3 ) end 'l(t)= -l')jend I (t) = 1 ) ; end

PAGE 160

1(250)== 3, text(250,8 ,'I(t)= end 1(750)==-3, text(750,8 ,'I(t)= end 1(750)==-1, text(750,8 'I (t) = -l')iend 1(750)== 1, text(750,8 'I (t) = 1') iend 1(750) == 3, text(750,B 'I (t) = 3')iend Q(250)==-3, text(250,14.25,'Q(t)= -3')iend Q(250)==-1, text(250,14.25,'Q(t)= -l')iend Q(250)== 1, text(250,14.25, 'Q(t)= l')iend Q(250)== 3, text(250,14.25, 'Q(t)= 3')iend Q(750)==-3, text (75 0, 14 .25, Q (t) = -3')iend Q(750)==-1, text(750,14.25,'Q(t)= -l')iend Q(750)== 1, text(750,14.25,'Q(t)= l')iend Q(750)== 3, text(750,14.25, 'Q(t)= end %%% End of loop, go to next character to be modulated end text_output clear; %%% End of program %%% % Clears memory 148

PAGE 161

clear; %%% set) the modulated signal, loaded from disk %%% ret) the received signal %%% A the constant amplification, loaded from disk %%% f the carrier frequency, loaded from disk %%% I(t) and Q(t) are the demodulated pulse trains %%% matrix_output the nx9 matrix contain the ASCII number and %%% 8 bit binary equivalent to be modulated %%% text_ouput the character string containing the answer disp('This program was written on October 3rd by'); disp('Bill Burgess to visually demonstrate'); disp('Quadrature Amplitude Modulation demodulation PLL.'); disp ( ) ; disp('This program shall be used conjuction with thesis titled'); disp('''A Comparative Analysis of Modulation and Demoudlation'); disp(' Used Digital Communications", 2000 by WA Burgess'); disp (' ') ; load gam. mat %%%%%%%%%%%%%%% Matrix Determined %%%%%%%%%%%%%%% QAM_compare=((O 0 0 0 3 3] (0 0 0 1 1 3] (0 0 1 0 -3 3] (0 0 1 1 -1 3] (0 1 0 0 3 -3] (0 1 0 1 1 -3] (0 1 1 0 -3 -3] [0 1 1 1 -1 -3] [1 0 0 0 3 1] [1 0 0 1 1 1] [1 0 1 0 -3 1] [1 0 1 1 -1 1] [1 1 0 0 3 -1] [1 1 0 1 1 -1] [1 1 1 0 -3 -1] [1 1 1 1 -1 -1] ] for k = l:size(s,l)

PAGE 162

index=1;indexl=1;index2=1;index3=1;index4=1; index5=1;index6=1;index7=1;index8=1; if max(s(k,1:500))>3.7, Il=3; I2=3; I3=-3; I4=-3; I5=0; I6=0; I7=0; I8=0; Ql=3; Q2=-3; Q3=3; Q4=-3; Q5=0; Q6=0; Q7=0; Q8=0; elseif max(s(k,1:500))<2.3, Il=l; I2=1; I3=-1; I4=-1; I5=0; I6=0; I7=0; I8=0; Ql=l; Q2=-1; Q3=1; Q4=-1; Q5=0; Q6=0; Q7=0; Q8=0; else Il=3; I2=-1; I3=-3; I4=1; I5=1; I6=-3; I7=-1; I8=3; Ql=l; Q2=3; Q3=-1; Q4=-3; Q5=3; Q6=1; Q7=-3; Q8=-1; end h=100*ones(1,8); for t = 2:500, r(t)=s(k,t) ; ul(t)=Il*A*cos(2*pi*t/(2*pi*10))-Ql*A*sin(2*pi*t/(2*pi*10)); u2(t)=I2*A*cos(2*pi*t/(2*pi*10))-Q2*A*sin(2*pi*t/(2*pi*10)); u3(t)=I3*A*cos(2*pi*t/(2*pi*10))-Q3*A*sin(2*pi*t/(2*pi*10)); u4(t)=I4*A*cos(2*pi*t/(2*pi*10))-Q4*A*sin(2*pi*t/(2*pi*10)); u5(t)=I5*A*cos(2*pi*t/(2*pi*10))-Q5*A*sin(2*pi*t/(2*pi*10)); u6(t)=I6*A*cos(2*pi*t/(2*pi*10))-Q6*A*sin(2*pi*t/(2*pi*10)); u7(t)=I7*A*cos(2*pi*t/(2*pi*10))-Q7*A*sin(2*pi*t/(2*pi*10)); u8(t)=I8*A*cos(2*pi*t/(2*pi*10))-Q8*A*sin(2*pi*t/(2*pi*10)); %%% Determine Positive Zero Crossing for Received Signal %%% r(tO, end r(t-l)
PAGE 163

end pzcd2(index2)=t; index2=index2+1; end %%% Determine positive Zero Crossing for H3 %%% u3(t, end u3(t-l)<0, pzcd3(index3)=tj index3=index3+1; end %%% Determine positive Zero Crossing for H4 %%% u4(t, end u4(t-l)<0, pzcd4(index4):::t; index4:::index4+1j end %%% Determine positive Zero Crossing for HS %%% if I5-=0, u5(t, end u5(t-l)<0, pzcd5(index5):::t; index5=index5+1; end %%% Determine positive Zero Crossing for H6 %%% u6(t, end u6(t-l)<0, pzcd6 (index6) =t; index6=index6+1; end %%% Determine positive Zero Crossing for H7 %%% u7(t, end u7(t-l)<0, pzcd7(index7)=t; index7=index7+1j end 151

PAGE 164

%%% %%% Determine positive Zero Crossing for H8 %%% end end u8(t, end u8(t-l)<0, pzcd8(index8)=t; index8=index8+1; end %%% Determine Max PZCD difference between received signal and Hl for y = 1:min(size(pzcd,2),size(pzcdl,2)), x(y)=abs(pzcd(y)-pzcdl(y)); end h(l)=max(x); %%% Determine Max PZCD difference between received signal and H2 %%% for y = 1:min(size(pzcd,2),size(pzcd2,2)), x(y)=abs(pzcd(y)-pzcd2(y)); end h(2)=max(x)i %%% Determine Max PZCD difference between received signal and H3 %%% for y = 1:min(size(pzcd,2),size(pzcd3,2)), x(y)=abs(pzcd(y)-pzcd3(y))i end h(3)=max(x); %%% Determine Max PZCD difference between received signal and H4 %%% for y = 1:min(size(pzcd,2),size(pzcd4,2)) x(y)=abs(pzcd(y)-pzcd4(y))i end h (4) =max (x) ; %%% Determine Max PZCD difference between received and H5 %%% for y = 1:min(size(pzcd,2),size(pzcd5,2)), x(y)=abs(pzcd(y)-pzcd5(y)); end h(5)=max(x); 152

PAGE 165

%%% Determine Max PZCD difference between received signal and H6 %%% for y = 1:min(size(pzcd,2),size(pzcd6,2, x(y)=abs(pzcd(y)-pzcd6(y; end h (6) =max (x) ; %%% Determine Max PZCD difference between received signal and H7 %%% for y = 1:min(size(pzcd,2),size(pzcd7,2, x(y)=abs(pzcd(y)-pzcd7(y ; end h (7) =max (x) ; %%% Determine Max PZCD difference between received signal and H8 %%% for y = 1:min(size(pzcd,2),size(pzcd8,2 x(y)=abs(pzcd(y)-pzcd8(y; end h (8) =max (x) ; end %%% Determine I(t) and Q(t) vectors %%% if h(l)==min(h), I(1:500)=I1; Q(1:500)=Q1; end if h(2)==min(h), I(1:500)=I2; Q(1:500)=Q2; end if h(3)==min(h), I(1:500)=I3; Q(1:500)=Q3; end if h(4)==min(h), I(1:500)=I4; Q(1:500)=Q4; end if h(5)==min(h), I(1:500)=I5; 153

PAGE 166

%%% Q(1:500)=Q5; end h(6) ==rnin(h) I(1:500)=I6; Q(1:500)=Q6; end if h(7)==rnin(h), I(1:500)=I7; Q(1:500)=Q7; end if h(8)==rnin(h), I(1:500)=I8; Q(1:500)=Q8; end %%% Translate I(t) and Q(t) vectors into 4 bit binary vectors for = 1:16, if I(250)==QAM_cornpare(i,5); if Q(250)==QAM_cornpare(i,6); rnatrix_output(k,2:5)=QAM_cornpare(i,1:4); end end end %%% Next 4 bits %%% index=1;indexl=1;index2=1;index3=1;index4=1; index5=1;index6=1;index7=1;index8=1; if rnax(s(k,501:1000>3.7, Il=3; 12=3; 13=-3; 14=-3; 15=0; 16=0; 17=0; 18=0; Ql=3; Q2=-3; Q3=3; Q4=-3; Q5=0; Q6=0; Q7=0; Q8=0; elseif rnax(s(k,501:1000<2.3, Il=l; 12=1; 13=-1; 14=-1; 15=0; 16=0; I7=0; I8=0; Ql=l; Q2=-1; Q3=1; Q4=-1; Q5=0; Q6=0; Q7=0; Q8=0; else Il=3; 12=-1; 13=-3; 14=1; 15=1; 16=-3; 17=-1; 18=3; Ql=l; Q2=3; Q3=-1; Q4=-3; Q5=3; Q6=1; Q7=-3; Q8=-1; end h=100*ones(1,8) ; for t = 502:1000, r(t)=s(k,t); ul(t)=Il*A*cos(2*pi*t/(2*pi*10-Ql*A*sin(2*pi*t/(2*pi*10;

PAGE 167

u2(t)=I2*A*cos(2*pi*t/(2*pi*10-Q2*A*sin(2*pi*t/(2*pi*10; u3(t)=I3*A*cos(2*pi*t/(2*pi*10-Q3*A*sin(2*pi*t/(2*pi*10; u4(t)=I4*A*cos(2*pi*t/(2*pi*10-Q4*A*sin(2*pi*t/(2*pi*10; u5(t)=I5*A*cos(2*pi*t/(2*pi*10-Q5*A*sin(2*pi*t/(2*pi*10; u6(t)=I6*A*cos(2*pi*t/(2*pi*10-Q6*A*sin(2*pi*t/(2*pi*10; u7(t)=I7*A*cos(2*pi*t/(2*pi*10-Q7*A*sin(2*pi*t/(2*pi*10; u8(t)=I8*A*cos(2*pi*t/(2*pi*10-Q8*A*sin(2*pi*t/(2*pi*10; %%% Determine positive Zero Crossing for Received Signal %%% r(tO, end r(t-l)
PAGE 168

%%% end end %%% Determine positive Zero Crossing for H5 %%% if 15-=O, u5(tO, end u5(t-l)
PAGE 169

%%% Determine Max PZCD difference between received signal and H2 %%% for y = 1:min(size(pzcd,2),size(pzcd2,2, x(y)=abs(pzcd(y)-pzcd2(yi end h(2)=max(x)i %%% Determine Max PZCD difference between signal and H3 %%% for y = 1:min(size(pzcd,2),size(pzcd3,2, x(y)=abs(pzcd(y)-pzcd3(yi end h(3)=max(x)i %%% Determine Max PZCD difference between received signal and H4 %%% for y = 1:min(size(pzcd,2) ,size(pzcd4,2 x(y)=abs(pzcd(y)-pzcd4(yi end h(4)=max(x)i %%% Determine Max PZCD difference between signal and H5 %%% if 15-=0, for y = 1:min(size(pzcd,2),size(pzcd5,2, x(y)=abs(pzcd(y)-pzcd5(yi end h(5)=max(x)i %%% Determine Max PZCD difference between received signal and H6 %%% for y = 1:min(size(pzcd,2),size(pzcd6,2, x(y)=abs(pzcd(y)-pzcd6(Yi end h(6)=max(x)i %%% Determine Max PZCD difference between received signal and H7 %%% for y = 1:min(size(pzcd,2),size(pzcd7,2, x(y)=abs(pzcd(y)-pzcd7(yi end h(7)=max(x)i %%% Determine Max PZCD difference between received signal and HS %%%

PAGE 170

for y = 1:min(size(pzcd,2),size(pzcd8,2 x(y)=abs(pzcd(y)-pzcd8(y; end h(8)=max(x); end %%% Determine l(t) and Q(t) vectors %%% if h(1)==min(h), 1(501:1000)=Il; Q(501:1000)=Q1; end if h(2)==min(h), I(501:1000)=12; Q(501:1000)=Q2; end if h(3)==min(h), 1(501:1000)=I3; Q(501:1000)=Q3; end if h(4)==min(h), I(501:1000)=I4; Q(501:1000)=Q4; end if h(5)==min(h), 1(501:1000)=I5; Q(501:1000)=Q5; end h(6)==min(h), I(501:1000)=16; Q(501:1000)=Q6; end if h(7)==min(h), I(501:1000)=I7; Q(501:1000)=Q7; end if h(8)==min(h), I(501:1000)=I8; Q(501:1000)=Q8; end 158

PAGE 171

%%% Translate I(t) and Q(t) vectors into 4 bit binary vectors %%% for i = 1:16, if I(750)==QAM_compare(i,5)i end if matrix_output(k,6:9)=QAM_compare(i,l:4); end end bintolet; % Subroutine to converter 8 bit binary % vectors into ASCII charaters and then % to English letters, places information % into matrix_output and text_output figure;hold on; axis([l 1000 -5 18]); plot (I+8 'k') text (-100, 8 I (t) ') plot(Q+14.25 ,'k')itext(-100, 14.25,'Q(t)')i plot(s(k,l:1000)-O.25,'k') itext(-100,-0.25 ,'s(t)'); title(text_output(k; text(-25,19,'QAM demodulation for the character: '); text(900,19,'PLL Method'); xlabel('Comparative Analysis of Modulation & Demodulation Digital Communications (WA Burgess)') hold %%% Place 4-bit vector on first half of graph %%% for i = 2:5, if matrix_output(k,i)==l; text(50+i*20,14.25, '1'); else end end text (50+i*20,14 .25,' 0'); %%% Place 4-bit vector on second half of graph %%% for = 6:9, end if matrix_output(k,i)==l; text(550+(i-4)*20,14.25,'l')i else t ext ( 55 0 + ( i -4 ) 2 0 14 2 5, 0 ) ; end %%% Place I and Q values on graph %%% 159

PAGE 172

1(250)==-3, text(250,B ,'I (t) = -3' ) ; end 1(250)==-1, text(250,B ,'I (t) = -l');end 1(250)== 1, text(250,B I (t) = l');end 1(250)== 3, text(250,B I (t) = 3') ; end 1(750)==-3, text(750,B ,'I(t)= -3');end 1(750)==-1, text(750,B I (t) = -1') ; end 1(750)== 1, text(750,B I (t) = 1') ; end 1(750)== 3, text(750,8 'I (t) = 3');end Q(250)==-3, text(250,14.25,'Q(t)= -3') ; end Q(250)==-1, text(250,14.25,'Q(t)= -l');end Q(250)== 1, text(250,14.25,'Q(t)= l');end Q(250)== 3, text(250,14.25, 'Q(t)= 3');end Q(750)==-3, text(750,14.25,'Q(t)= -3');end if Q(750)==-1, text(750,14.25,'Q(t)= -l');end Q(750)== 1, text(750,14.25,'Q(t)= l');end Q(750)== 3, text(750,14.25,'Q(t)= 3') ; end %%% End of loop, go to next character to be modulated end text_output clear; %%% End of program %%% Clears memory

PAGE 173

LettoBin.m %%% This subroutine will convert a string of %%% English letters to a string of ASCII %%% numbers and then into a set of 8 bit %%% binary vectors. %%% %%% Written on September 11th, 2000 by %%% WA Burgess text_input=input('Enter a text string:' 's'); length=size(text_input,2); matrix_input=zeros(length,9); for i = 1: length, bit (i) =text_input (i) *1; vector=zeros(1,8); vector_size=size(vector,2); decay=bit(i); nurn = 2A(vector_size-1); index=l; while nurn>O, end if decay>=nurn, vector (index) =1; decay=decay-numi end nurn=nurn/2 ; index=index+1; matrix_input(i,l)=bit(i); matrix_input(i,2:9)=vector; end

PAGE 174

BintoLet.m %%% This subroutine will convert the 8 bit %%% binary vector into an ASCII sum and %%% then into an English text_output(k) %%% %%% Written on September 12th, 2000 by %%% WA Burgess sum=O; demod=matrix_output(k,2:9); demod(8) ==1 sum=sum+1; end demod(7)==1 sum=sum+2; end demod(6) ==1 sum=sum+4; end demod(5)==1 sum=sum+8; end demod(4)==1 sum=sum+16; end demod(3)==1 sum=sum+32; end demod(2) ==1 sum=sum+64; end demod(1) ==1 sum=sum+128; end matrix_output(k,1) =sum; sum==OO text_output(k)='?'; end; sum==32 text_output (k)=' end; sum==33 text_output(k)='!'; end; sum==34 text_output(k)='"'; end; sum==35 text_output(k)='#' ; end; sum==36 text_output(k)='$'; end; sum==37 text_output(k)='%'; end; sum==38 text_output (k)='&' ; end; sum==40 text_output(k)=' ('; end; sum==41 text_output(k)=')' ; end; sum==42 text_output(k)='*' ; end; sum==43 text_output (k)='+' ; end; sum==44 text_output(k)=',' ; end; sum==45 text_output(k)='-'; end; sum==46 text_output(k)='.'; end; sum==47 text_output(k)='/'; end; sum==48 text_output(k)='O'; end; sum==49 text_output(k)='1'j end; sum==50 text_output(k)='2'j end; sum==51 text_output(k)='3'; end; sum==52 text_output (k)='4' ; end; sum==53 text_output(k)='5' ; end; 162

PAGE 175

sum==54 text_output(k)='6' ; end; sum==55 text_output(k)='7'; end; sum==56 text_output(k)='8' ; end; sum==57 text_output(k)='9'; end; sum==58 text_output(k)=':': end; sum==59 text_output(k)=':': end: sum==60 text_output(k)='<': end: sum==61 text_output(k)='='; end; sum==62 text_output(k)='>': end; sum==63 text_output(k)='?'; end; sum==64 text_output(k)='@': end: sum==65 text_output(k)='A': end: sum==66 text_output(k)='B': end: sum==67 text_output(k)='C': end: sum==68 text_output(k)='D': end: sum==69 text_output(k)='E': end: sum==70 text_output(k)='F': end: sum==71 text_output(k)='G': end: sum==72 text_output(k)='H': end: sum==73 text_output(k)='I': end: sum==74 text_output(k)='J': end: sum==75 text_output(k)='K': end: sum==76 text_output(k)='L': end: sum==77 text_output(k)='M': end: sum==78 text_output(k)='N': end: sum==79 text_output(k)='Q': end; sum==80 text_output(k)='P': end: sum==81 text_output(k)='Q': end; sum==82 text_output(k)='R': end; sum==83 text_output(k)='S': end: sum==84 text_output(k)='T': end: sum==85 text_output(k)='U'; end: sum==86 text_output(k)='V'; end: sum==87 text_output(k)='W'; end: sum==88 text_output(k)='X': end; sum==89 text_output(k)='Y': end; sum==90 text_output(k)='Z' ; end; sum==91 text_output(k)=' ['; end; if sum==92 text_output(k)='\': end; sum==93 text_output(k)=']' : end: sum==94 end: sum==95 text_output(k)='_': end: sum==96 text_output(k)="': end: sum==97 text_output(k)='a': end; sum==98 text_output(k)='b': end: if sum==99 text_output(k)=ic': end; surn==100, text_output(k)='d'j end; sum==101, text_output(k)='e'; end; sum==102, text_output(k)='f': end: if sum==103, text_output(k)='g'; end; 163

PAGE 176

surn==104, text_output(k)='h'; end; surn==105, text_output(k)='i'; end; surn==106, text_output(k)='j' ; end; sum==107, text_output(k)='k'; end; surn==108, text_output(k)='l'; end; surn==109, text_output (k)='rn' ; end; surn==110, text_output (k)='n' ; end; surn==lll, text_output (k)='o' ; end; if sum==112, text_output(k)='p'; end; if sum==113, text_output(k)='q'; end; surn==114, text_output (k)='r' ; end; sum==115, text_output(k)='s'; end; surn==116, text_output (k)='t' ; end; surn==117, text_output(k)='u'; end; surn==118, text_output(k)='v'; end; surn==119, text_output(k)='w'; end; surn==120, text_output(k)='x'; end; surn==121, text_output(k)='y'; end; surn==122, text_output(k)='z'; end; surn==123, text_output(k)='{'; end; surn==124, text_output(k)=' /'; end; surn==125, text_output(k)='}'; end; sum==126, text_output(k)='-'; end; 164

PAGE 177

Noise.m clear; %%% This program will add noise to the signal matrix %%% Written by Bill Burgess program shall be used conjuction with thesis titled') ; disp('''A Comparative Analysis of Modulation and Demoudlation'); disp(' Used in Digital Communications", 2000 by WA Burgess'); disp (' ') ; choice=input('Enter modulation to add noise to -1) BPSK, 2) QPSK, restore=input('Enter 1 to resore orginal matrix: '); if restore-=l, end sigma=input('Level of noise: lag=input('How much lag: '); fade=input('Percent fade: if choice==l, if restore==l, load orginal.mat save bpsk.mat else load bpsk.mat save orginal.mat for k=l:size(s,l), for t = 1:1000-lag, s(k,t)=(1-(fade/100))*s(k,t+lag) + sigma*sigma*rand; end end end save bpsk.mat s f A end if choice==2, if restore==l, load orginal.mat save qpsk.mat else load qpsk.mat 165

PAGE 178

end save orginal.mat for k=l:size(s,l), for t = l:lOOO-lag, s(k,t)=(1-(fade/100))*s(k,t+lag) + sigma*sigma*randi end end save qpsk.mat s f A end if choice==3, end if restore==l, load orginal.mat save gam.mat else load gam. mat save orginal.mat for k=l:size(s,l), for t = l:lOOO-lag, s(k,t)=(1-(fade/100))*s(k,t+lag) sigma*sigma*randi end end save gam.mat s f A end 166

PAGE 179

References [1] Ziemer, R, :peterson, Introduction to Digital Communication, Macmillan Publishing Company, New York, 1992. [2] Proakis, J, Digital Communications, McGraw-Hill Book Company, New York, NY, 1983. [3] Xiong, F, Digital Modulation Technigues, Artech House Telecommunications Library, Norwood, MA, 2000. [4] Anderson, J, Digital Transmission Engineering, Prentice Hall Publishing, New York, NY, 1999. [5] Ingle, V, J. Proakis, Digital Signal Processing using MATLAB, Brooks/Cole Publishing, Pacific Grove, [6] Proakis, J, M. Salehi, Contemporary Communication Systems using MATLAB, Brooks/Cole Publishing, Pacific Grove, [7] Stallings, W, Data and Computer Communications, Prentice Hall, Upper Saddle River, New Jersey, 2000. [8] Best, R, Phase Locked LoopsDesign, Simulation, and Applications, McGraw-Hill Book Company, New York, NY, 1999. [9] Anderson, J, Digital Phase Modulation, Plenum Press, New York, NY, 1986 [10] Srinath, M, Introduction to Statistical Signal Processing with Applications, Prentice Hall, Upper Saddle River, New Jersey, 1996. [11] Scharf, L, Statistical Signal ProcessingDetection, Estimation, and Time Series Analysis, Addison-Wesley Publishing Company, Reading, MA, 1991 [12] Couch, L, Digital and Analog Communication System, Macmillan Publishing Company, New York, NY, 1983 [13] Barkat, M, Signal Detection and Estimation, Artech House, Boston, MA, 1991 167