summaryrefslogtreecommitdiff
path: root/851/CH7/EX7.1/Example7_1.sce
blob: c9bf95c03af30d7de09efc69535e6880a83cf57d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//clear//
//Caption:Waveforms of Different Digital Modulation techniques
//Example7.1 Signal Space Diagram for coherent QPSK system
clear;
clc;
close;
M =4;
i = 1:M;
t = 0:0.001:1;
for i = 1:M
  s1(i,:) = cos(2*%pi*2*t)*cos((2*i-1)*%pi/4);
  s2(i,:) = -sin(2*%pi*2*t)*sin((2*i-1)*%pi/4);
end
S1 =[];
S2 = [];
S = [];
Input_Sequence =[0,1,1,0,1,0,0,0];
m = [3,1,1,2];
for i =1:length(m)
  S1 = [S1 s1(m(i),:)];
  S2 = [S2 s2(m(i),:)];
end
S = S1+S2;
figure
subplot(3,1,1)
a =gca();
a.x_location = "origin";
plot(S1)
title('Binary PSK wave of Odd-numbered bits of input sequence') 
subplot(3,1,2)
a =gca();
a.x_location = "origin";
plot(S2)
title('Binary PSK wave of Even-numbered bits of input sequence') 
subplot(3,1,3)
a =gca();
a.x_location = "origin";
plot(S)
title('QPSK waveform') 
//-sin((2*i-1)*%pi/4)*%i;
//annot = dec2bin([0:length(y)-1],log2(M));
//disp(y,'coordinates of message points')
//disp(annot,'dibits value')
//figure;
//a =gca();
//a.data_bounds = [-1,-1;1,1];
//a.x_location = "origin";
//a.y_location = "origin";
//plot2d(real(y(1)),imag(y(1)),-2)
//plot2d(real(y(2)),imag(y(2)),-4)
//plot2d(real(y(3)),imag(y(3)),-5)
//plot2d(real(y(4)),imag(y(4)),-9)
//xlabel('                                             In-Phase');
//ylabel('                                             Quadrature');
//title('Constellation for QPSK')
//legend(['message point 1 (dibit 10)';'message point 2 (dibit 00)';'message point 3 (dibit 01)';'message point 4 (dibit 11)'],5)