# Digital communication simulation using matlab

5/12/16 Engineering Reference this

**Disclaimer:** This work has been submitted by a student. This is not an example of the work produced by our Essay Writing Service. You can view samples of our professional work here.

Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of UK Essays.

### Introduction On General Modulation/Demodulation And 64-QAM – AWGN Channel, Noise And Rectangular Pulse Shaping

### Modulation – Demodulation – Modem

In the area of telecommunications, modulation is the process of changing a periodic waveform (i.e. a tone), in order to use that signal to transfer a message. Normally the carrier signal (usually is a sinusoidal) has higher frequency than the input signal. Amplitude, phase and frequency are the three key parameters of a sine wave. These parameters can be modified in accordance with a low frequency information signal to obtain the modulated signal. Amplitude modulation (AM), frequency modulation (FM) and phase modulation are the most common analog modulation techniques. Radio and television broadcast stations typically use AM or FM. More complex forms of modulation are Phase Shift Keying (PSK), Amplitude Shift Keying (ASK) and Frequency Shift Keying (FSK) which are the three basic digital modulation techniques.

A device that performs modulation is known as a modulator and a device that performs the inverse operation of modulation is known as a demodulator. “A modulator converts a digital signal to an analog signal (typically a sinusoidal signal) and a demodulator converts a modulated (analog) signal back to the original unmodulated (digital) signal.” A few years ago a computer was connected to the internet through a modem (in now days a different type is being used, ADSL modem/router) over a regular analog line. “A modem converts an outgoing digital signal to an outgoing modulated signal, and converts an incoming modulated signal to an incoming digital signal.”

Modulation is used “to change the signal’s bandwidth so it can be transmitted on a limited-bandwidth communication channel (like a telephone line or a cable TV channel) without too much distortion.” It also allows more connected users on the same communication link.

### Digital modulation

Digital modulation schemes transform digital signals into waveforms that are compatible with the nature of the communications channel. There are two major categories of digital modulation. One category uses a constant amplitude carrier and the other carries the information in phase or frequency variations (FSK, PSK). The other category conveys the information in carrier amplitude variations and is known as amplitude shift keying (ASK).

“In digital communications, modulation is often expressed in terms of I and Q. This is a rectangular representation of the polar diagram. On a polar diagram, the I axis lies on the zero degree phase reference, and the Q axis is rotated by 90 degrees. The signal vector’s projection onto the I axis is its “I” component and the projection onto the Q axis is its “Q” component.”

### Main Digital Modulation Schemes – Techniques

Amplitude Shift Keying (ASK)

Amplitude shift keying represents digital data as variations in the amplitude of a carrier wave. There is an on/off transmission that represents the binary logic 1/0. ASK has poor performance cause is heavily affected by noise and interference. For binary digital modulation, BASK is the simpler form of ASK.

Frequency Shift Keying (FSK)

The carrier’s frequency is modulated by the digital signal. “1/0 represented by two different frequencies slightly offset from carrier frequency.” “That means that is a different frequency for “1” and another frequency for “0”. FSK can be expanded to a M-ary scheme, employing multiple frequencies as different states.” For binary digital modulation BFSK is the simpler form of FSK.

Phase Shift Keying (PSK)

Phase-shift keying (PSK) is a digital modulation scheme that conveys data by changing, or modulating, the phase of the carrier wave. Phases are separated by 180o. Phase modulation “can be achieved simply by defining a relative phase shift from the carrier, usually equi-distant for each required state. Therefore a two level phase modulated system, such as Binary Phase Shift Keying, has two relative phase shifts from the carrier, + or – 90o. Phase modulation requires coherent generation and as such if an IQ modulation technique is employed this filtering can be performed at baseband.”

Multi-Symbol Signalling – M-ary Signals

“Multiple-symbol signaling is the process where multiple levels are used to encode binary information into groups of two bite, four bits, etc.”

“Amplitude and phase shift keying can be combined to transmit several bits per symbol (in the above figure M=4). These modulation schemes are often refered to as linear, as they require linear amplification. 16-QAM has the largest distance between points, but requires very linear amplification. 16PSK has less stringent linearity requirements, but has less spacing between constellation points, and is therefore more affected by noise. M-ary schemes are more bandwidth efficient, but more susceptible to noise.”

Quadrature Phase Shift Key Modulation (QPSK)

Quadrauture Phase Shift Keying is a form of PSK. QPSK is a system of modulating digital signals onto a radio-frequency carrier signal using four phase states to code two digital bits.

“QPSK is effectively two independent BPSK systems (I and Q), and therefore exhibits the same performance but twice the bandwidth efficiency. QPSK can be filtered using raised cosine filters to achieve excellent out of band suppression. Large envelope variations occur during phase transitions, thus requiring linear amplification.”

Quadrature amplitude modulation (QAM)

Quadrature amplitude modulation is a combination of amplitude modulation and phase shift keying. It is a modulation scheme-technique which conveys data by modulating the amplitude of two carrier waves. That is an amplitude modulation on both quadrature carriers. These two waves, usually sinusoids, are out of phase with each other by 90 and are that is why they called quadrature carriers. QAM has extensive use in digital microwave radio links. The 16-QAM below stands for 2n discrete levelsà n=2 same as in the above QPSK.

### Additive White Gaussian Noise (AWGN)

Additive means that the sum of the transmitted signal and noise produce the received signal. White means that “its two sided power spectral density is flat for all frequencies of interest for radio communication system. The amplitude of the noise is distributed according to a normal or Gaussian distribution.” Its information gives a single impairment.

### Noise Pulse Shaping And Rectangular Pulse Shaping

In digital telecommunications, pulse shaping can be used to change the waveform of transmitted pulses, so the signal bandwidth matches that of the communication channel, reducing distortion and intersymbol interference. In other words its purpose is to make the transmitted signal suit better to the communication channel by limiting the effective bandwidth of the transmission. Modulation is often followed by pulse shaping.

“Rectangular pulse shaping repeats each output from the modulator a fixed number of times to create an up-sampled signal. Rectangular pulse shaping can be a first step or an exploratory step in algorithm development, though it is less realistic than other kinds of pulse shaping. If the transmitter up-samples the modulated signal, then the receiver should down-sample the received signal before demodulating. The “integrate and dump” operation is one way to down-sample the received signal.” Demodulation is often preceded by a filtering or an intergrate and dump-operation.

### Answers To Assignments Tasks

### Task 1

In this assignment you are required to design and implement the process of modulating a random binary data stream using 64-level QAM (quadrature amplitude modulation), transmitting it over an AWGN (Additive White Gaussian Noise) wireless communication channel, and demodulating the received signal using the 64- QAM demodulator. Your system should consist of a baseband modulator, AWGN channel, and a demodulator. The following table indicates some relevant functions from the Matlab Communications Toolbox which may be used in this assignment. The functions for 64-QAM modulator/demodulator can be taken from the Matlab Communications Toolbox, or even implemented by you.

The length of the binary data stream (i.e., the number of the rows in the column vector) is set to 5000.

### Task 1.1

Write codes to 1) Display the transmitted and received signals in different scatter plots for the following two situations: a) SNR = 40 dB; b) SNR = 14dB; 2) Compute the system’s bit error rate (BER) for the two situations.

### Answer 1.1

1a) The m-file for SNR=40dB

x=randint(4998,1); %Random binary data stream of 4998 digits

%Bits to symbols mapping

xsymbols=bi2de(reshape(x,6,length(x)/6).’,’left-msb’);

y=qammod(xsymbols,64); %Modulation using the 64-QAM

yTx=y; %Transmitted signal

scatterplot(yTx)

grid;

title(‘Transmitted Signal’)

%Transmission over an Additive White Gaussian Noise channel,SNR=40dB

ynoise=awgn(yTx,40,’measured’);

yRx=ynoise; %Received signal

scatterplot(yRx)

grid;

title(‘Received Signal, SNR=40dB’)

zsymbols=qamdemod(yRx,64); %Demodulation using the 64-QAM

z=de2bi(zsymbols,’left-msb’); %Symbols to bits mapping

z=reshape(z.’,prod(size(z)),1);

%Computation of Number of Erros and Bit Error Rate

[Number_of_errors,Bit_Error_Rate]=biterr(x,z)

1b) The m-file for SNR=14dB

x=randint(4998,1); %Random binary data stream of 4998 digits

%Bits to symbols mapping

xsymbols=bi2de(reshape(x,6,length(x)/6).’,’left-msb’);

y=qammod(xsymbols,64); %Modulation using the 64-QAM

yTx=y; %Transmitted signal

scatterplot(yTx)

grid;

title(‘Transmitted Signal’)

%Transmission over an Additive White Gaussian Noise channel,SNR=40dB

ynoise=awgn(yTx,14,’measured’);

yRx=ynoise; %Received signal

scatterplot(yRx)

grid;

title(‘Received Signal, SNR=14dB’)

zsymbols=qamdemod(yRx,64); %Demodulation using the 64-QAM

z=de2bi(zsymbols,’left-msb’); %Symbols to bits mapping

z=reshape(z.’,prod(size(z)),1);

%Computation of Number of Erros and Bit Error Rate

[Number_of_errors,Bit_Error_Rate]=biterr(x,z)

2) Computation of the system’s bit error rate for the two situations

SNR=40dB

SNR=14dB

### Task 1.2

Compare/explain in detail the results obtained in a) and b), and explain clearly how the differences come from.

### Answer 1.2

In the above code, there is a bit to symbol mapping. A bit can’t take values from 0-63 but a group of bits can.

The two transmitted signals are identical cause both signals modulated with the same modulation schemes (64-QAM) and transmitted throw the same channel (Additive White Gaussian Noise wireless channel).

Received signals have different scatter plot. This happens cause the first received signal was transmitted throw a channel with SNR=40dB and the other one was transmitted throw a channel with SNR=14dB. In the second scatter plot it is obvious that the channel is too noisy in accordance with the first scatter plot which seems that it hasn’t got any clue of noise. For example, if a ADSL line has SNR lower than 15dB then several problems occurred like frequent disconnections etc.

According to scatter plots the bit error rate and the number of errors for the first signal with SNR=40 was expected to be 0 cause the channel was clear from noise. On the contrary, for the second signal with SNR=14dB bit error rate and number of errors expected to be non zero. Both expectations verified.

The ratio of the signal strength to the noise level is called the signal to- noise ratio (SNR), . “If the SNR is high (ie. the signal power is much greater than the noise power) few errors will occur. However, as the SNR reduces, the noise may cause symbols to be demodulated incorrectly, and errors will occur.” [3]

### Task 2

Modulation is often followed by pulse shaping, and demodulation is often preceded by a filtering or an integrate-and-dump operation. In this task you are required to investigate the effect of rectangular pulse shaping by using it at the transmitter side after the 64-QAM modulation and also the effect of integrate-and-dump operation at the receiver side. Rectangular pulse shaping repeats each output from the modulator a fixed number of times to create an upsampled signal. If the transmitter upsamples the modulated signal, then the receiver should downsample the received signal before demodulation. The “integrate-and-dump” operation is one way to downsample the received signal. The following table indicates the additional relevant functions from the Matlab Communications Toolbox which may be used in this assignment.

### Task 2.1

Write codes to 1) Display the received signals in scatter plots when a) SNR = 40 dB; b) SNR = 14dB; 2) Compute the system’s bit error rate (BER) for the two situations.

### Answer 2.1

1a) The m-file for SNR=40dB

%Random binary data stream of 5004 digits

x = randint(5004,1);

%Bit to Symbol Mapping

xsymbols = bi2de(reshape(x,6,length(x)/6).’,’left-msb’);

%Modulation using the 64-QAM.

y = qammod(xsymbols,64);

%Pulse shaping, 3 samples per symbol

shaped=rectpulse(y,6);

%Transmitted Signal

yTx = shaped;

scatterplot(yTx)

title(‘Transmitted signal’)

grid;

%Transmission over an Additive White Gaussian Noise channel,SNR=14dB

ynoise = awgn(yTx,40,’measured’);

%Received Signal

yRx = ynoise ;

%Integrate and dump

deshaped=intdump(yRx,6);

scatterplot(deshaped)

title(‘Received signal,SRN=40dB’)

grid;

%Demodulation using the 64-QAM

zsymbols = qamdemod(deshaped,64);

%Symbol to bit mapping –> to perform the computation of BER

z = de2bi(zsymbols,’left-msb’);

a = reshape(z.’,prod(size(z)),1);

%Computation of Number of Erros and Bit Error Rate

[Number_of_errors,Bit_Error_Rate] = biterr(x,a)

1b) The m-file for SNR=14dB

%Random binary data stream of 5004 digits

x = randint(5004,1);

%Bit to Symbol Mapping

xsymbols = bi2de(reshape(x,6,length(x)/6).’,’left-msb’);

%Modulation using the 64-QAM.

y = qammod(xsymbols,64);

%Pulse shaping, 3 samples per symbol

shaped=rectpulse(y,6);

%Transmitted Signal

yTx = shaped;

scatterplot(yTx)

title(‘Transmitted signal’)

grid;

%Transmission over an Additive White Gaussian Noise channel,SNR=14dB

ynoise = awgn(yTx,14,’measured’);

%Received Signal

yRx = ynoise ;

%Integrate and dump

deshaped=intdump(yRx,6);

scatterplot(deshaped)

title(‘Received signal,SRN=14dB’)

grid;

%Demodulation using the 64-QAM

zsymbols = qamdemod(deshaped,64);

%Symbol to bit mapping –> to perform the computation of BER

z = de2bi(zsymbols,’left-msb’);

a = reshape(z.’,prod(size(z)),1);

%Computation of Number of Erros and Bit Error Rate

[Number_of_errors,Bit_Error_Rate] = biterr(x,a)

2) Computation of the system’s bit error rate for the two situations

SNR=40dB

SNR=14dB

### Task 2.2

Compare/explain the results with those obtained in Task 1, and explain clearly how the differences come from.

### Answer 2.2

The difference between Task1 and Task 2 are the rectangular pulse shaping and integrate and dump operation. Rectangular pulse shape upsampling the signal after modulation. It actually applies a square pulse to the signal and repeats each symbol several times (in this case symbols are repeated 6 times). The dump operation is downsampling the signal. It is actually an integral of the signal for a single period.

In this case, modulation followed by pulse shaping and demodulation preceded by integrate and dump operation. Since rectangular pulse shaping repeats each output from the modulator a fixed number of times then we expected our signals to be better than those in task1. This expectation came true since BER for SNR=40 dB is 0 and for SNR=14 dB is 0.0038. In the second case when SNR=14 dB it is obvious that BER and number of errors reduced dramatically.

The filtering on the transmitter causes intersymbol interference. “The filtering at the transmitter and the channel typically cause the received pulse sequence to suffer from interysmbol interference and this appear as an amorphous “smeared” signal, not quite ready for sampling and detection.” “When the channel bandwidth is much greater than the pulse bandwidth, the spreading of the pulse will be slight. When the channel bandwidth is close to the signal bandwidth, the spreading will exceed symbol duration and cause signal pulses to overlap. This overlapping is called intersymbol interference.” Rectangular pulse shaping was used to minimize distortion and the effect of intersymbol interference. It made the transmitted signal fit better to the communication channel by limiting the effective bandwidth of the transmission.

The BER and number of errors improvement succeeded because symbols were sent

several times. In this case, filtering made the signal better. “Without

filtering, signals would have very fast transitions between states and therefore

very wide frequency spectra – much wider than is needed for the purpose of

sending information.”

### Conclusions

Ø If the SRN value is high enough, the received signal is almost clear from noise.

Ø High SNR value stands for a value close to zero for Bit Error Rate.

Ø In the presence of noise and interference, it is necessary to increase signal power to reduce the possibility of errors.

Ø The bit error rate (BER) of a system indicates the quality of the link.

Ø Filtering is essential for good bandwidth efficiency.

Ø “High level M-array schemes (such as 64-QAM) are very bandwidth-efficient but more susceptible to noise and require linear amplification.” [3]

### References

1) http://digitalmodulation.net/

2) Data Signal Analysis – Prof.Alan Kaminsky, Department of Computer Science – Rochester Institute of Technology (NY, USA), March 2005 (page 2)

3) Principles of Digital Modulation – Dr. Mike Fitton, Telecommunications Research Lab, Toshiba Research Europe Limited (pages 5, 6, 7, 9, 15, , 22, 24)

4) Digital Modulation – Prof. Randy H.Katz, CS Division, University of California, Berkeley, CA 94720-1776, 1996 (pages 11, 12, 13, 20)

5) Digital Modulation in Communications Systems – An Introduction, Application Note 128, Agilent Technologies (Pages 6, 35)

6) Introduction to Digital Modulation Schemes – Geoff Smithson (page 5)

7) http://www.ipsi.fraunhofer.de/mobile/teaching/LaPlata/2Funk/2Funke.htm#Modu

8) Reference Materials to Advanced Digital Communications – Dr. Marios Hadjinicolaou, Brunel University 2007 (pages 85, 108)

9) Channels & Modulation: Basics – Ryszard Struzak, School on Wireless Networking for Development, The Abdus Salam International Centre for Theoretical Physics ICTP, Trieste (Italy), 6 to 24 February 2006, http://www.ryszard.struzak.com

10) http://www.mathworks.com/access/helpdesk/help/toolbox/comm/index.html?/access/helpdesk/help/toolbox/comm/ug/a1041263435.html

11) Digital Communications – Bernard Sklar, 2nd edition (Prentice Hall) (page 78)

#### Cite This Work

To export a reference to this article please select a referencing stye below:

## Related Services

View all### DMCA / Removal Request

If you are the original writer of this essay and no longer wish to have the essay published on the UK Essays website then please.