summaryrefslogtreecommitdiff
path: root/40/CH2/EX2.3a/Exa_2_3a.sce
blob: 1cf640075dd34e7ea23fe62916655ce53109a7c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//example 2.3a pg.no.14
clear;clc;close;
n=-2:2;
x1=[4 -2 4 -6 0];
x2=0.5*x1//x[n]
x3=0.5*[x1(length(x1):-1:1)];//x[-n]
xe=(x2+x3);//even part
xo=(x2-x3);//odd part
a=gca();
a.thickness=2;
a.x_location="middle";
a.y_location="middle";
plot2d3('gnn',n,xe,rect=[-4 -6 4 6])
xtitle('graphical representation of even part of x[n]','n','x[n]')
xset('window',1)
b=gca();
b.thickness=2;
b.y_location="middle";
b.x_location="middle";
plot2d3('gnn',n,xo,rect=[-2 -4 2 4])
xtitle('graphical representation of odd part of x[n]','n','x[n]')