-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample3_08.m
More file actions
52 lines (39 loc) · 908 Bytes
/
Example3_08.m
File metadata and controls
52 lines (39 loc) · 908 Bytes
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
% File: Example3_08.m for Example 3-8 and Fig. 3-14
% Multilevel Signaling
clear;
clf
t = 0:0.05:8;
k = 0:1:3;
Tb = 1;
Ts = 2*Tb;
w = [-3 -1 3 1];
x = -5*Ts:0.05:5*Ts;
% Generating w4(t), sin(x)/x Pulse shape used
w4 = zeros(length(t),1);
for (i = 1:1:length(k))
w4 = w4 + w(i)*SA(pi/Ts * (t - (k(i)*Ts + 0.5*Ts)));
end;
% Generating w3(t), Rectangular pulse shape used.
w3 = zeros(length(t),1);
for (i = 1:1:length(k))
temp = t - (k(i)*Ts + 0.5*Ts);
% Finding positions that correspond to -Ts/2 and Ts/2.
left = INDEX(temp,-Ts/2);
right = INDEX(temp,Ts/2);
for (j = left:1:right)
w3(j) = w(i);
end;
end;
subplot(211);
plot(t,w3);
xlabel('t in msec -->');
ylabel('w3(t)');
title(['Rectangular Pulse Shape Tb =',num2str(Tb),' msec ']);
grid;
subplot(212);
plot(t,w4);
xlabel('t in msec -->');
ylabel('w4(t)');
title(['sin(x)/x Pulse Shape Tb =',num2str(Tb),' msec ']);
grid;