summaryrefslogtreecommitdiff
path: root/2414/CH3/EX3.2/Ex3_2.sce
blob: 3cdc027e01073c304cdfc32b1fdc83178404ab4a (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
clc;
clear all;
//chapter 3
//page no 76
//example 3.2
//plot for impulse function
t=-2:.001:2;
vt=[zeros(-2:.001:0-.001) 1 zeros(0+.001:.001:2)]     //impulse function matrix
clf
subplot(211)
plot2d(t,vt,[2],rect=[-2,0,2,2])
a=gca(); // Handle on axes entity
a.x_location = "origin"; 
a.y_location = "origin";

xtitle('(a) Unit Impulse function','t','v(t)')

//plot for amplitude spectum
f=-2:.001:2;
Vf=[ones(-2:.001:2)]
subplot(212)
plot2d(f,Vf,[5])
a=gca(); // Handle on axes entity
a.x_location = "origin"; 
a.y_location = "origin";

xtitle('(b) Amplitude spectrum','f','V(f)')
xgrid