summaryrefslogtreecommitdiff
path: root/2294/CH4/EX4.6/EX4_6.sce
blob: a8f932ae336dc0a831c6011ac021eb1fa2086ed3 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//Find the covolution Of the following signals.
//Example 4.6<i>
clc;
clear;
close;
a=.5;
b=.6;
t=-4:.01:4;
for i=1:length(t)
    if t(i)<0 then
        x1(i)=0;x2(i)=0;
    else
        x1(i)=exp(-a.*t(i));
        x2(i)=exp(-b.*t(i));
    end
end
y=convol(x1,x2);
f=scf(0);
subplot(3,1,1);
plot(x1,t,'red');
xtitle('x1[t]');
subplot(3,1,2);
plot(x2,t,'blue');
xtitle('x2[t]');
subplot(3,1,3);
t1=-8:.01:8;
plot(t1,y,'green');
xtitle('y[n]');
xs2jpg(0, 'EX4_6_1-plot-a.jpg');
//Find the covolution Of the following signals.
//Example 4.6<ii>
clc;
clear;
close;
t=-4:.01:4;
for i=1:length(t)
    if t(i)<0 then
        x1(i)=0;x2(i)=0;
    else
        x1(i)=1;
        x2(i)=1;
    end
end
y=convol(x1,x2);
f=scf(0);
subplot(3,1,1);
plot(x1,t,'red');
xtitle('x1[t]');
subplot(3,1,2);
plot(x2,t,'blue');
xtitle('x2[t]');
subplot(3,1,3);
t1=-8:.01:8;
plot(t1,y,'green');
xtitle('y[n]');
xs2jpg(0, 'EX4_6_2-plot-a.jpg');
//Find the covolution Of the following signals.
//Example 4.6<iii>
clc;
clear;
close;
t=-4:.01:4;
for i=1:length(t)
    if t(i)<0 then
        x1(i)=0;x2(i)=0;
    else
        x1(i)=t(i);
        x2(i)=1;
    end
end
y=convol(x1,x2);
f=scf(0);
subplot(3,1,1);
plot(x1,t,'red');
xtitle('x1[t]');
subplot(3,1,2);
plot(x2,t,'blue');
xtitle('x2[t]');
subplot(3,1,3);
t1=-8:.01:8;
plot(t1,y,'green');
xtitle('y[n]');
xs2jpg(0, 'EX4_6_3-plot-a.jpg');
//Find the covolution Of the following signals.
//Example 4.6<iv>
clc;
clear;
close;
t=-4:.01:4;
for i=1:length(t)
    if t(i)<0 then
        x1(i)=0;x2(i)=0;
    else
        x1(i)=sin(t(i));
        x2(i)=1;
    end
end
y=convol(x1,x2);
f=scf(0);
subplot(3,1,1);
plot(x1,t,'red');
xtitle('x1[t]');
subplot(3,1,2);
plot(x2,t,'blue');
xtitle('x2[t]');
subplot(3,1,3);
t1=-8:.01:8;
plot(t1,y,'green');
xtitle('y[n]');
xs2jpg(0, 'EX4_6_4-plot-a.jpg');