eem496 communication systems laboratory - report4 - digitally modulated signals using matlab, pam...

46
Instructor : Ass. Prof. Nuray AT TA : Res. Assistant. Zafer Hüseyin ERGAN ANADOLU UNIVERSITY DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EEM 496 Communication Systems Laboratory Experiment 4 DIGITALLY MODULATED SIGNALS USING MATLAB: PAM (ASK), PSK, AND QAM Date: 11.03.2010 16169230356 OSMAN GÜLERCAN

Upload: donatello84

Post on 27-Jul-2015

576 views

Category:

Documents


4 download

DESCRIPTION

Instructor : Ass. Prof. Nuray AT TA : Res. Assistant. Zafer Hüseyin ERGANANADOLU UNIVERSITY DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERINGEEM 496Communication Systems LaboratoryExperiment 4DIGITALLY MODULATED SIGNALS USING MATLAB: PAM (ASK), PSK, AND QAMDate: 11.03.201016169230356OSMAN GÜLERCAN1) PurposeThe aim of this experiment is to study digitally modulated signals which are PAM (ASK), PSK, and QAM, also construct their constellation diagrams, baseband and passband

TRANSCRIPT

Page 1: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

Instructor : Ass. Prof. Nuray AT

TA : Res. Assistant. Zafer Hüseyin ERGAN

ANADOLU UNIVERSITYDEPARTMENT OF ELECTRICAL AND ELECTRONICS

ENGINEERING

EEM 496

Communication Systems

Laboratory

Experiment 4

DIGITALLY MODULATED SIGNALS USING MATLAB:

PAM (ASK), PSK, AND QAM

Date: 11.03.2010

16169230356 OSMAN GÜLERCAN

Page 2: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

1) Purpose

The aim of this experiment is to study digitally modulated signals which are

PAM (ASK), PSK, and QAM, also construct their constellation diagrams,

baseband and passband forms using MATLAB.

2) Lab Work

The MATLAB codes, which are given in the experiment file, were

implemented by changing the modulation types; also, plotting the

waveforms, the results were observed.

In the MATLAB codes, we first set the M-ary modulation parameter ‘M’ to 8

and the number of symbol intervals ‘n’ to 2. By doing this, we observed 9

figures that show us some of waveforms of PAM(ASK), PSK, and QAM

signals.

For each modulation types, we compared the modulation constellations, input

signals as M-ary levels, also both baseband and passband signals.

Then we changed the number of symbol intervals ‘n’ to 4 and 8. We studied

the differences of signals that Matlab generated. When the M-ary modulation

parameter M=8, we also changed the carrier frequency ‘fc’ to 36 and

sampling rate of the modulated signal ‘fs’ to 10e4.

In this code, sampling rate of the message signal was constantly 1, we

couldn’t change it because some of the vector’s length had already assigned

to 1.

Lastly, we set the the M-ary modulation parameter to 16, and the number of

symbol intervals ‘n’ to 4. Then we run it and observed the modulation

waveforms again.

Page 3: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

3) Results

m=8, n=2

Page 4: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 5: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 6: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 7: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 8: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 9: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

m=8, n=4

Page 10: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 11: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 12: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 13: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 14: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 15: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

m=8, n=8

Page 16: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 17: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 18: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 19: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 20: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 21: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

m=16, n=4

Page 22: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 23: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 24: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 25: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 26: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 27: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

m=8, n=4, fc=36

Page 28: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 29: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 30: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 31: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 32: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 33: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

m=8, n=4, fs=10e4

Page 34: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 35: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 36: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 37: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 38: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam
Page 39: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

4) Matlab Code

% This program shows the illustration of PAM (ASK), PSK, and QAM signals.

% Both bandpass and passband signals are shown. Keep the n, Fs , and fc settings.

clear; clc; close all

n = 4; % Number of symbol intervals

M = 16; % Use M-ary modulation

Fd = 1; % Sampling rate of the message signal

Fs = 100; % Sampling rate of the modulated signal

fc = 18; % Carrier frequency

x = randint(n,1,M); % Random multilevel message signal (from zero to M-1)

xt = reshape(repmat(x,1,Fs)',1,n*Fs); t = 1:1:n*Fs; % Arrange time axis

% PAM (ASK) Signals

% A) Baseband ASK

sask = real(dmodce(x,Fd,Fs,'ask',M)); modmap('ask',M); set(gcf,'Color',[1 1 1])

pause

subplot(2,1,1); plot(t,xt); title('Input signal x(t) as M-ary levels')

axis ([min(t) max(t) -0.1 max(x)*1.1])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

subplot(2,1,2); plot(t,sask); title('ASK baseband signal - s_m(t)'); xlabel('Time Axis')

axis ([min(t) max(t) -1.1 1.1])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

pause; clf reset

% B) Bandpass PAM (ASK)

uask = dmod(x,fc,Fd,Fs,'ask',M);

subplot(2,1,1); plot(t,sask); set(gcf,'Color',[1 1 1])

title('ASK baseband signal - s_m(t)')

axis ([min(t) max(t) -1.1 1.1])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

Page 40: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

subplot(2,1,2); plot(t,uask); title('ASK bandpass signal - u_m(t)'); xlabel('Time Axis')

axis ([min(t) max(t) -1.1 1.1])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

pause

% PSK Signals

% A) Baseband PSK

spsk = dmodce(x,Fd,Fs,'psk',M); figure; modmap('psk',M);set(gcf,'Color',[1 1 1])

pause

subplot(2,1,1); plot(t,xt); title('Input signal x(t) as M-ary levels')

axis ([min(t) max(t) -0.1 max(x)*1.1])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

s1psk = reshape(spsk,Fs/2,2*n);smtpsk = [];

for i = 1:2:2*n-1

s3 = [real(s1psk(:,i));imag(s1psk(:,i+1))];

smtpsk = [smtpsk;s3];

end

subplot(2,1,2); plot(t,smtpsk); title('PSK baseband signal - s_m(t)'); xlabel('Time Axis')

axis ([min(t) max(t) -1.1 1.1])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

pause;clf reset

% B) Bandpass PSK

upsk = dmod(x,fc,Fd,Fs,'psk',M);

subplot(2,1,1); plot(t,smtpsk); set(gcf,'Color',[1 1 1])

title('PSK baseband signal - s_m(t)')

axis ([min(t) max(t) -1.1 1.1])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

subplot(2,1,2); plot(t,upsk); title('PSK bandpass signal - u_m(t)'); xlabel('Time Axis')

axis ([min(t) max(t) -1.1 1.1])

Page 41: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

pause

% QAM Signals

% A) Baseband QAM

sqam = dmodce(x,Fd,Fs,'qask',M); figure; modmap('qask',M); set(gcf,'Color',[1 1 1])

pause

subplot(2,1,1); plot(t,xt); title('Input signal x(t) as M-ary levels')

axis ([min(t) max(t) -0.1 max(x)*1.1])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

s1qam = reshape(sqam,Fs/2,2*n); smtqam = [];

for i = 1:2:2*n-1

s3 = [real(s1qam(:,i));imag(s1qam(:,i+1))];

smtqam = [smtqam;s3];

end

subplot(2,1,2); plot(t,smtqam); title('QAM baseband signal - s_m(t)'); xlabel('Time Axis')

axis ([min(t) max(t) -M*0.9/2 M*0.9/2])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

pause; clf reset

% B) Bandpass QAM

uqam = dmod(x,fc,Fd,Fs,'qask',M);

subplot(2,1,1); plot(t,smtqam); set(gcf,'Color',[1 1 1])

title('QAM baseband signal - s_m(t)')

axis ([min(t) max(t) -M*0.9/2 M*0.9/2])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

subplot(2,1,2); plot(t,uqam); title('QAM bandpass signal - u_m(t)'); xlabel('Time Axis')

axis ([min(t) max(t) -1.1 1.1])

set(gca,'XTick',[50 100 150 200 250 300 350 400])

set(gca,'XTickLabel',{'T/2';'T';'3T/2';'2T';'5T/2';'3T';'10T/2';'4T'},'FontWeight','bold');

Page 42: EEM496 Communication Systems Laboratory - Report4 - Digitally Modulated Signals Using Matlab, Pam (Ask), Psk, And Qam

5) Conclusion

In this experiment, we have studied digitally modulated signals PAM (ASK),

PSK, and QAM with their constellation diagrams, including baseband and

passband forms. The message signals described as digitally with changing

amplitudes so that we could easily see the M-ary levels step-up or step-down

on the figures by the values of n>2. We tested the signals when n=2, 4 and 8.

At the ASK modulation, we saw that the amplitude was changed according to

ASK baseband signal which was related to M-ary level. We can say that the

amplitude of carier frequency was changed by a digital input signal to

generate ASK. Similarly, the phase of carier signal changed at the output of

bandpass signal in order to generate PSK. When the baseband signal’s

amplitude changed, the phase of bandpass signal also changed with constant

amplitude. Lastly, we tested QAM that is a combination of ASK and PSK

and they are out of phase with each other by 90°. We also changed sampling

rate of the modulated signal to 10e4 and the carrier frequency to 36. As the fd

was increased, baseband and passband signals seemed more flat, and as the fc

was increased the passband signals seemed more fluctuated. To sum up,

some of digitally modulated signals PAM(ASK), PSK, and QAM were

analyzed using MATLAB.