summaryrefslogtreecommitdiff
path: root/851/CH6/EX06.1/Figure06_1.sce
blob: 0f3496fb3a8a91832dabc9c05d2ab529a1e21845 (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
//clear//
//Caption:Nonreturn-to-zero polar format
//Figure 6.1(b): Discrete PAM Signals Generation
// [2].Polar NRZ
//page 235
clear;
close;
clc;
x = [0 1 0 0 0 1 0 0 1 1];
binary_negative = [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1];
binary_positive = [1 1 1 1 1 1 1 1 1 1];
L = length(x);
L1 = length(binary_negative);
total_duration = L*L1;
//plotting
a =gca();
a.data_bounds =[0 -2;L*L1 2];
for i =1:L
  if(x(i)==0)
    plot([i*L-L+1:i*L],binary_negative);
    poly1= a.children(1).children(1);
    poly1.thickness =3;
  else
    plot([i*L-L+1:i*L],binary_positive);
    poly1= a.children(1).children(1);
    poly1.thickness =3;
  end
end
xgrid(1)
title('Polar NRZ')