summaryrefslogtreecommitdiff
path: root/67/CH1
diff options
context:
space:
mode:
Diffstat (limited to '67/CH1')
-rwxr-xr-x67/CH1/EX1.1.a/example11a.sce7
-rwxr-xr-x67/CH1/EX1.1.b/example11b.sce7
-rwxr-xr-x67/CH1/EX1.14.a/example114a.sce22
-rwxr-xr-x67/CH1/EX1.18.a/example118a.sce15
-rwxr-xr-x67/CH1/EX1.18.b/example118b.sce15
-rwxr-xr-x67/CH1/EX1.18.c/example118c.sce15
-rwxr-xr-x67/CH1/EX1.19.a/example119a.sce30
-rwxr-xr-x67/CH1/EX1.19.b/example119b.sce30
-rwxr-xr-x67/CH1/EX1.20.b/example120b.sce30
-rwxr-xr-x67/CH1/EX1.21/example121.sce32
-rwxr-xr-x67/CH1/EX1.22/example122.sce31
-rwxr-xr-x67/CH1/EX1.25/example125.sce32
-rwxr-xr-x67/CH1/EX1.27/example127.sce6
-rwxr-xr-x67/CH1/EX1.28/example128.sce5
-rwxr-xr-x67/CH1/EX1.30/example130.sce4
-rwxr-xr-x67/CH1/EX1.31.a/example131a.sce6
-rwxr-xr-x67/CH1/EX1.31.b/example131b.sce6
-rwxr-xr-x67/CH1/EX1.33/example133.sce14
-rwxr-xr-x67/CH1/EX1.34/example134.sce10
-rwxr-xr-x67/CH1/EX1.39.a/example139a.sce6
-rwxr-xr-x67/CH1/EX1.39.b/example139b.sce6
-rwxr-xr-x67/CH1/EX1.4/example14.sce9
-rwxr-xr-x67/CH1/EX1.43/example143.sce30
-rwxr-xr-x67/CH1/EX1.47/example147.sce17
-rwxr-xr-x67/CH1/EX1.49.a/example149a.sce7
-rwxr-xr-x67/CH1/EX1.49.b/example149b.sce9
-rwxr-xr-x67/CH1/EX1.5/example15.sce10
-rwxr-xr-x67/CH1/EX1.6/example16.sce8
-rwxr-xr-x67/CH1/EX1.8/example18.sce13
29 files changed, 432 insertions, 0 deletions
diff --git a/67/CH1/EX1.1.a/example11a.sce b/67/CH1/EX1.1.a/example11a.sce
new file mode 100755
index 000000000..592ad32ba
--- /dev/null
+++ b/67/CH1/EX1.1.a/example11a.sce
@@ -0,0 +1,7 @@
+//Example 1.1a
+//Determine whether the given signal is periodic or not
+clc;
+t=0:1/100:1
+x=sin(15*%pi*t);
+plot(x);
+disp('ploting the signal and showing that it is periodic with period=2pi/15pi'); \ No newline at end of file
diff --git a/67/CH1/EX1.1.b/example11b.sce b/67/CH1/EX1.1.b/example11b.sce
new file mode 100755
index 000000000..aa10ba752
--- /dev/null
+++ b/67/CH1/EX1.1.b/example11b.sce
@@ -0,0 +1,7 @@
+//Example 1.1b
+//Determine whether the given signal is periodic or not
+clc;
+t=0:1/100:5
+x=sin(sqrt(2)*%pi*t);
+plot(x);
+disp('ploting the signal and showing that itis periodic with period=2pi/sqrt(2)pi'); \ No newline at end of file
diff --git a/67/CH1/EX1.14.a/example114a.sce b/67/CH1/EX1.14.a/example114a.sce
new file mode 100755
index 000000000..a03938de5
--- /dev/null
+++ b/67/CH1/EX1.14.a/example114a.sce
@@ -0,0 +1,22 @@
+//Example 1.14a
+clc;
+x=[1,2,3,4,0,4,3,2,1]
+t=-length(x)/2:length(x)/2
+count=0
+mid=ceil(length(x)/2)
+y=zeros(1,length(x))
+y(mid+1:$)=x($:-1:mid+1)
+for t=-1:-1:-mid
+ y(t+1+mid)=x(-t)
+end
+for i=1:length(x)
+ if(y(i)==x(i))
+ count=count+1
+ end
+end
+if(count==length(x))
+ disp('THE GIVEN SYSTEM IS CAUSAL')
+else
+ disp('Since it depends on future values')
+ disp('THE GIVEN SYSTEM IS NON CAUSAL')
+end \ No newline at end of file
diff --git a/67/CH1/EX1.18.a/example118a.sce b/67/CH1/EX1.18.a/example118a.sce
new file mode 100755
index 000000000..3c487489a
--- /dev/null
+++ b/67/CH1/EX1.18.a/example118a.sce
@@ -0,0 +1,15 @@
+//Example 1.18a
+clc;
+t0=1;
+T=10;
+for t=1:T
+ x(t)=2*%pi*t/T;
+ y(t)=sin(x(t));
+end
+inputshift=sin(x(T-t0));
+outputshift=y(T-t0);
+if(inputshift==outputshift)
+ disp('THE GIVEN SYSTEM IS TIME INVARIANT')
+else
+ disp('THE GIVEN SYSTEM IS TIME VARIANT');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.18.b/example118b.sce b/67/CH1/EX1.18.b/example118b.sce
new file mode 100755
index 000000000..fad9bee4c
--- /dev/null
+++ b/67/CH1/EX1.18.b/example118b.sce
@@ -0,0 +1,15 @@
+//Example 1.18b
+clc;
+t0=2;
+T=10;
+for t=1:T
+ x(t)=t;
+ y(t)=t*x(t);
+end
+inputshift=x(T-t0);
+outputshift=y(T-t0);
+if(inputshift==outputshift)
+ disp('THE GIVEN SYSTEM IS TIME INVARIANT')
+else
+ disp('THE GIVEN SYSTEM IS TIME VARIANT');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.18.c/example118c.sce b/67/CH1/EX1.18.c/example118c.sce
new file mode 100755
index 000000000..9f8bbc2f3
--- /dev/null
+++ b/67/CH1/EX1.18.c/example118c.sce
@@ -0,0 +1,15 @@
+//Example 1.18c
+clc;
+t0=2;
+T=10;
+for t=1:T
+ x(t)=t;
+ y(t)=x(t)*cos(200*%pi*t);
+end
+inputshift=x(T-t0);
+outputshift=y(T-t0);
+if(inputshift==outputshift)
+ disp('THE GIVEN SYSTEM IS TIME INVARIANT')
+else
+ disp('THE GIVEN SYSTEM IS TIME VARIANT');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.19.a/example119a.sce b/67/CH1/EX1.19.a/example119a.sce
new file mode 100755
index 000000000..f26983dbc
--- /dev/null
+++ b/67/CH1/EX1.19.a/example119a.sce
@@ -0,0 +1,30 @@
+//Example 1.19a
+clc;
+x1=[1,1,1,1]
+x2=[2,2,2,2]
+a=1
+b=1
+for t=1:length(x1)
+ x3(t)=a*x1(t)+b*x2(t)
+end
+for t=1:length(x1)
+ y1(t)=t*x1(t)
+ y2(t)=t*x2(t)
+ y3(t)=t*x3(t)
+end
+for t=1:length(y1)
+ z(t)=a*y1(t)+b*y2(t)
+end
+count=0
+for n=1:length(y1)
+ if(y3(t)==z(t))
+ count=count+1;
+ end
+end
+if(count==length(y3))
+ disp('It satisfy the superposition principle');
+ disp('THE GIVEN SYSTEM IS LINEAR ');
+else
+ disp('It does not satisfy superposition principle ');
+ disp('THE GIVEN SYSTEM IS NON LINEAR');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.19.b/example119b.sce b/67/CH1/EX1.19.b/example119b.sce
new file mode 100755
index 000000000..d953773c2
--- /dev/null
+++ b/67/CH1/EX1.19.b/example119b.sce
@@ -0,0 +1,30 @@
+//Example 1.19b
+clc;
+x1=[1,1,1,1]
+x2=[2,2,2,2]
+a=1
+b=1
+for t=1:length(x1)
+ x3(t)=a*x1(t)+b*x2(t)
+end
+for t=1:length(x1)
+ y1(t)=x1(t)^2
+ y2(t)=x2(t)^2
+ y3(t)=x3(t)^2
+end
+for t=1:length(y1)
+ z(t)=a*y1(t)+b*y2(t)
+end
+count=0
+for n=1:length(y1)
+ if(y3(t)==z(t))
+ count=count+1;
+ end
+end
+if(count==length(y3))
+disp('It satisfy the superposition principle');
+disp('THE GIVEN SYSTEM IS LINEAR ');
+else
+ disp('It does not satisfy superposition principle ');
+ disp('THE GIVEN SYSTEM IS NON LINEAR');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.20.b/example120b.sce b/67/CH1/EX1.20.b/example120b.sce
new file mode 100755
index 000000000..f16107c5c
--- /dev/null
+++ b/67/CH1/EX1.20.b/example120b.sce
@@ -0,0 +1,30 @@
+//Example 1.20b
+clc;
+x1=[1,1,1,1]
+x2=[2,2,2,2]
+a=1
+b=1
+for t=1:length(x1)
+ x3(t)=a*x1(t)+b*x2(t)
+end
+for t=1:length(x1)
+ y1(t)=x1(t)^2
+ y2(t)=x2(t)^2
+ y3(t)=x3(t)^2
+end
+for t=1:length(y1)
+ z(t)=a*y1(t)+b*y2(t)
+end
+count=0
+for n=1:length(y1)
+ if(y3(t)==z(t))
+ count=count+1;
+ end
+end
+if(count==length(y3))
+disp('It satisfy the superposition principle');
+disp('THE GIVEN SYSTEM IS LINEAR ');
+else
+ disp('It does not satisfy superposition principle ');
+ disp('THE GIVEN SYSTEM IS NON LINEAR');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.21/example121.sce b/67/CH1/EX1.21/example121.sce
new file mode 100755
index 000000000..8ce87a563
--- /dev/null
+++ b/67/CH1/EX1.21/example121.sce
@@ -0,0 +1,32 @@
+//Example 1.21
+clc;
+x1=[1,1,1,1]
+x2=[2,2,2,2]
+a1=1;
+b1=1;
+a=7;
+b=5;
+for t=1:length(x1)
+ x3(t)=a1*x1(t)+b1*x2(t)
+end
+for t=1:length(x1)
+ y1(t)=a*x1(t)+b
+ y2(t)=a*x2(t)+b
+ y3(t)=a*x3(t)+b
+end
+for t=1:length(y1)
+ z(t)=a1*y1(t)+b1*y2(t)
+end
+count=0
+for n=1:length(y1)
+ if(y3(t)==z(t))
+ count=count+1;
+ end
+end
+if(count==length(y3))
+disp('It satisfy the superposition principle');
+disp('THE GIVEN SYSTEM IS LINEAR ');
+else
+ disp('It does not satisfy superposition principle ');
+ disp('THE GIVEN SYSTEM IS NON LINEAR');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.22/example122.sce b/67/CH1/EX1.22/example122.sce
new file mode 100755
index 000000000..492abd3f6
--- /dev/null
+++ b/67/CH1/EX1.22/example122.sce
@@ -0,0 +1,31 @@
+//Example 1.22
+clc;
+x1=[1,1,1,1]
+x2=[2,2,2,2]
+a1=1
+b1=1
+Wc=%pi
+for t=1:length(x1)
+ x3(t)=a1*x1(t)+b1*x2(t)
+end
+for t=1:length(x1)
+ y1(t)=x1(t)*cos(Wc*t)
+ y2(t)=x2(t)*cos(Wc*t)
+ y3(t)=x3(t)*cos(Wc*t)
+end
+for t=1:length(y1)
+ z(t)=a1*y1(t)+b1*y2(t)
+end
+count=0
+for n=1:length(y1)
+ if(y3(t)==z(t))
+ count=count+1;
+ end
+end
+if(count==length(y3))
+disp('It satisfy the superposition principle');
+disp('THE GIVEN SYSTEM IS LINEAR ');
+else
+ disp('It does not satisfy superposition principle ');
+ disp('THE GIVEN SYSTEM IS NON LINEAR');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.25/example125.sce b/67/CH1/EX1.25/example125.sce
new file mode 100755
index 000000000..c627ac2c9
--- /dev/null
+++ b/67/CH1/EX1.25/example125.sce
@@ -0,0 +1,32 @@
+//Example 1.25
+clc;
+x1=[1,1,1,1]
+x2=[2,2,2,2]
+a1=1;
+b1=1;
+a=7;
+b=3;
+for t=1:length(x1)
+ x3(t)=a1*x1(t)+b1*x2(t)
+end
+for t=1:length(x1)
+ y1(t)=a*x1(t)+b
+ y2(t)=a*x2(t)+b
+ y3(t)=a*x3(t)+b
+end
+for t=1:length(y1)
+ z(t)=a1*y1(t)+b1*y2(t)
+end
+count=0
+for n=1:length(y1)
+ if(y3(t)==z(t))
+ count=count+1;
+ end
+end
+if(count==length(y3))
+disp('It satisfy the superposition principle');
+disp('THE GIVEN SYSTEM IS LINEAR ');
+else
+ disp('It does not satisfy superposition principle ');
+ disp('THE GIVEN SYSTEM IS NON LINEAR');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.27/example127.sce b/67/CH1/EX1.27/example127.sce
new file mode 100755
index 000000000..7af90767f
--- /dev/null
+++ b/67/CH1/EX1.27/example127.sce
@@ -0,0 +1,6 @@
+//Example 1.27
+//Energy of the signal x(t)=Aexp(-a*t).u(t)
+clc;
+A=2;
+a=0.5;
+E=integrate('(A*exp(-a*t))^2','t',0,100);//Energy of the given signal \ No newline at end of file
diff --git a/67/CH1/EX1.28/example128.sce b/67/CH1/EX1.28/example128.sce
new file mode 100755
index 000000000..e6ed32d2b
--- /dev/null
+++ b/67/CH1/EX1.28/example128.sce
@@ -0,0 +1,5 @@
+//Example 1.28
+//Power of the signal x(t)=A
+clc;
+A=2;
+P=(integrate('A^2','t',0,100))/(2*100) \ No newline at end of file
diff --git a/67/CH1/EX1.30/example130.sce b/67/CH1/EX1.30/example130.sce
new file mode 100755
index 000000000..278883820
--- /dev/null
+++ b/67/CH1/EX1.30/example130.sce
@@ -0,0 +1,4 @@
+//Example 1.30
+//Detremine the energy of the signal x(n)=0.5^n for n >0
+clc;
+E=integrate('(0.5^n)','n',0,1000); \ No newline at end of file
diff --git a/67/CH1/EX1.31.a/example131a.sce b/67/CH1/EX1.31.a/example131a.sce
new file mode 100755
index 000000000..02666132b
--- /dev/null
+++ b/67/CH1/EX1.31.a/example131a.sce
@@ -0,0 +1,6 @@
+//Example 1.31a
+//Determine whether the given signal is periodic or not
+clc;
+n=0:1/100:10
+x=sin(6*%pi*n/7);
+plot(x)//plotting the signal and showing it is periodic with period 2pi/(6pi/7); \ No newline at end of file
diff --git a/67/CH1/EX1.31.b/example131b.sce b/67/CH1/EX1.31.b/example131b.sce
new file mode 100755
index 000000000..d0c043dac
--- /dev/null
+++ b/67/CH1/EX1.31.b/example131b.sce
@@ -0,0 +1,6 @@
+//Example 1.31b
+//Determine whether the given signal is periodic or not
+clc;
+n=0:1/1000:100
+x=sin(n/8);
+plot(x);//plotting the signal and showing that it is periodic with period 16pi \ No newline at end of file
diff --git a/67/CH1/EX1.33/example133.sce b/67/CH1/EX1.33/example133.sce
new file mode 100755
index 000000000..fe99d37d7
--- /dev/null
+++ b/67/CH1/EX1.33/example133.sce
@@ -0,0 +1,14 @@
+//Example 1.33
+//Find the power of the signal x(t)=Acos(Wot+theeta)
+clc;
+A=10;
+T=4;
+Wo=(2*%pi)/T;
+for i=1:T
+ x(i)=A*cos(Wo*i);
+end
+p=0;
+for i=1:T
+ p=p+(abs(x(i)^2))/T;
+end
+disp(p,'The power of the given signal is ='); \ No newline at end of file
diff --git a/67/CH1/EX1.34/example134.sce b/67/CH1/EX1.34/example134.sce
new file mode 100755
index 000000000..b705a4866
--- /dev/null
+++ b/67/CH1/EX1.34/example134.sce
@@ -0,0 +1,10 @@
+//Example 1.34
+//Find energy of x(t)=8exp(2+i4pi)t
+clc;
+E=0;
+for t=1:100
+ x(t)=8*exp((2+(%i*4*%pi))*t);
+end
+for t=1:100
+ E=E+x(t)^2;
+end \ No newline at end of file
diff --git a/67/CH1/EX1.39.a/example139a.sce b/67/CH1/EX1.39.a/example139a.sce
new file mode 100755
index 000000000..f561a72bf
--- /dev/null
+++ b/67/CH1/EX1.39.a/example139a.sce
@@ -0,0 +1,6 @@
+//Example 1.39a
+//Sketch the signal x(t)=u(t)
+clc;
+t=0:1/100:10
+x=1;
+plot(t,x); \ No newline at end of file
diff --git a/67/CH1/EX1.39.b/example139b.sce b/67/CH1/EX1.39.b/example139b.sce
new file mode 100755
index 000000000..c12228730
--- /dev/null
+++ b/67/CH1/EX1.39.b/example139b.sce
@@ -0,0 +1,6 @@
+//Example 1.39b
+//Sketch the signal x(t)=tu(t)
+clc;
+t=0:1/100:10
+x=t
+plot(t,x) \ No newline at end of file
diff --git a/67/CH1/EX1.4/example14.sce b/67/CH1/EX1.4/example14.sce
new file mode 100755
index 000000000..6f795d28b
--- /dev/null
+++ b/67/CH1/EX1.4/example14.sce
@@ -0,0 +1,9 @@
+//Example 1.4
+//Sketch the signal x(t)=Asin(t)
+clc;
+A=0.5;
+t=0:1/100:10
+x=A*sin(t);
+plot(x);
+//since it is a periodic signal so it is power signal
+P=(integrate('((0.5)^2)*(sin(t)^2)','t',0,2*%pi))/(2*%pi); \ No newline at end of file
diff --git a/67/CH1/EX1.43/example143.sce b/67/CH1/EX1.43/example143.sce
new file mode 100755
index 000000000..595fa3c2d
--- /dev/null
+++ b/67/CH1/EX1.43/example143.sce
@@ -0,0 +1,30 @@
+//Example 1.43
+clc;
+x1=[1,1,1,1]
+x2=[2,2,2,2]
+a=1
+b=1
+for t=1:length(x1)
+ x3(t)=a*x1(t)+b*x2(t)
+end
+for t=1:length(x1)
+ y1(t)=x1(t)^2
+ y2(t)=x2(t)^2
+ y3(t)=x3(t)^2
+end
+for t=1:length(y1)
+ z(t)=a*y1(t)+b*y2(t)
+end
+count=0
+for n=1:length(y1)
+ if(y3(t)==z(t))
+ count=count+1;
+ end
+end
+if(count==length(y3))
+disp('It satisfy the superposition principle');
+disp('THE GIVEN SYSTEM IS LINEAR ');
+else
+ disp('It does not satisfy superposition principle ');
+ disp('THE GIVEN SYSTEM IS NON LINEAR');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.47/example147.sce b/67/CH1/EX1.47/example147.sce
new file mode 100755
index 000000000..6bc4172e9
--- /dev/null
+++ b/67/CH1/EX1.47/example147.sce
@@ -0,0 +1,17 @@
+//Example 1.47
+clc;
+k0=2;
+n0=2;
+N=10;
+x=[1,2,3,4,5,6,7,8,9,10];
+y=zeros(1,length(x));
+for n=1:length(x)/k0
+ y(n)=x(k0*n);
+end
+inputshift=x(N-n0);
+outputshift=y(N-n0);
+if(inputshift==outputshift)
+ disp('THE GIVEN SYSTEM IS TIME INVARIANT')
+else
+ disp('THE GIVEN SYSTEM IS TIME VARIANT');
+end \ No newline at end of file
diff --git a/67/CH1/EX1.49.a/example149a.sce b/67/CH1/EX1.49.a/example149a.sce
new file mode 100755
index 000000000..15e9af5d5
--- /dev/null
+++ b/67/CH1/EX1.49.a/example149a.sce
@@ -0,0 +1,7 @@
+//Example 1.49a
+//Determine whether the signal x(n)=sin(7/9*pi*(n^2)+1)
+clc;
+n=0:1/100:5
+x=sin((7/9)*%pi*(n^2)+1)
+plot(x);
+disp('this shows that signal is NOT periodic'); \ No newline at end of file
diff --git a/67/CH1/EX1.49.b/example149b.sce b/67/CH1/EX1.49.b/example149b.sce
new file mode 100755
index 000000000..a5ac9be74
--- /dev/null
+++ b/67/CH1/EX1.49.b/example149b.sce
@@ -0,0 +1,9 @@
+//Example 1.49b
+//Determine whether the signal x(n)=cos(pi*n/2)cos(pi*n/4)
+clc;
+n=0:1/100:100
+x0=cos((%pi*n/2)+(%pi*n/4))
+x1=cos((%pi*n/2)-(%pi*n/4))
+x=(x0+x1)/2;
+plot(x);
+disp('plot shows that this is a periodic signal'); \ No newline at end of file
diff --git a/67/CH1/EX1.5/example15.sce b/67/CH1/EX1.5/example15.sce
new file mode 100755
index 000000000..1385a0e37
--- /dev/null
+++ b/67/CH1/EX1.5/example15.sce
@@ -0,0 +1,10 @@
+//Example 1.5
+//Sketch the signal x(t)=A[u(t+a)-u(t-a)]
+clc;
+A=1;
+a=2;
+t=-a:a
+x=1;
+plot(t,x)
+//this signal is a finite duration signal so it is energy signal
+E=integrate('1','t',-a,a); \ No newline at end of file
diff --git a/67/CH1/EX1.6/example16.sce b/67/CH1/EX1.6/example16.sce
new file mode 100755
index 000000000..25fef5a15
--- /dev/null
+++ b/67/CH1/EX1.6/example16.sce
@@ -0,0 +1,8 @@
+//Example 1.6
+//Sketch the signal x(t)=exp(-a*t)
+clc;
+t=0:1/100:10;
+x=exp(-0.5*t);
+plot(x)
+E=integrate('(exp(-0.5*t)^2)','t',0,10)
+//Energy of the signal \ No newline at end of file
diff --git a/67/CH1/EX1.8/example18.sce b/67/CH1/EX1.8/example18.sce
new file mode 100755
index 000000000..765ffa26a
--- /dev/null
+++ b/67/CH1/EX1.8/example18.sce
@@ -0,0 +1,13 @@
+//Example 1.8
+//Find the power of the signal x(t)=Acos(Wot+theeta)
+clc;
+A=20;
+Wo=(2*%pi)/4;
+for i=1:50
+ x(i)=A*cos(Wo*i);
+end
+p=0;
+for i=1:4
+ p=p+(abs(x(i)^2))/4;
+end
+disp(p,'The power of the given signal is ='); \ No newline at end of file