diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /62/CH1 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '62/CH1')
45 files changed, 752 insertions, 0 deletions
diff --git a/62/CH1/EX1.1/ex_1_1.sce b/62/CH1/EX1.1/ex_1_1.sce new file mode 100755 index 000000000..61d37b189 --- /dev/null +++ b/62/CH1/EX1.1/ex_1_1.sce @@ -0,0 +1,39 @@ +//shifting and scaling
+//example 1.1
+clear;
+clc;
+close;
+t = 0:1/100:4;
+for i = 1:length(t)
+ x(i) = (3/4)*t(i) ;
+end
+for i = length(t)+1:2*length(t)
+x(i) = 0;
+end
+figure
+a=gca();
+t1=0:1/100:8;
+plot(t1,x(1:$-1))
+xtitle('x(t)')
+figure
+a=gca();
+t2=t1+2;
+plot(t2,x(1:$-1))
+xtitle('x(t-2)')
+a.y_location='origin'
+figure
+a=gca();
+t3=0:1/200:4;
+plot(t3,x(1:$-1))
+xtitle('x(2t)')
+figure
+a=gca();
+t4=0:1/50:16;
+plot(t4,x(1:$-1))
+xtitle('x(t/2)')
+figure
+a=gca();
+t5=-8:1/100:0;
+plot(t5,x($:-1:2))
+xtitle('x(-t)')
+a.y_location = "right";
\ No newline at end of file diff --git a/62/CH1/EX1.1/ex_1_1_1.png b/62/CH1/EX1.1/ex_1_1_1.png Binary files differnew file mode 100755 index 000000000..04cda88dc --- /dev/null +++ b/62/CH1/EX1.1/ex_1_1_1.png diff --git a/62/CH1/EX1.1/ex_1_1_2.png b/62/CH1/EX1.1/ex_1_1_2.png Binary files differnew file mode 100755 index 000000000..dafae5998 --- /dev/null +++ b/62/CH1/EX1.1/ex_1_1_2.png diff --git a/62/CH1/EX1.10/ex_1_10.sce b/62/CH1/EX1.10/ex_1_10.sce new file mode 100755 index 000000000..e376d2dab --- /dev/null +++ b/62/CH1/EX1.10/ex_1_10.sce @@ -0,0 +1,14 @@ +clear;
+clc;
+close;
+t=0:1/100:10;
+w=1;
+theta=%pi/3;
+T=2*%pi/w;
+x=cos(t*w+theta);
+y=cos((t+T)*w+theta);
+if ceil(x)==ceil(y) then
+ disp('cos(wo*t+theta) is periodic with T=2*pi/W0')
+else
+ disp('nonperiodic')
+end
\ No newline at end of file diff --git a/62/CH1/EX1.11/ex_1_11.sce b/62/CH1/EX1.11/ex_1_11.sce new file mode 100755 index 000000000..509bbf954 --- /dev/null +++ b/62/CH1/EX1.11/ex_1_11.sce @@ -0,0 +1,13 @@ +clear;
+clc;
+close;
+n=0:100;
+w0=1;
+N=2*%pi/w0;
+x=exp(%i*w0*n);
+y=exp(%i*w0*(n+N));
+if ceil(x)==ceil(y) then
+ disp('e^iwn is periodic with N=2*pi/W0')
+else
+ disp('nonperiodic')
+end
\ No newline at end of file diff --git a/62/CH1/EX1.16/ex_1_16.sce b/62/CH1/EX1.16/ex_1_16.sce new file mode 100755 index 000000000..6ef62693c --- /dev/null +++ b/62/CH1/EX1.16/ex_1_16.sce @@ -0,0 +1,75 @@ +//ex_16 to check if a function is periodic
+clear;
+clc;
+close;
+//x(t)=cos(t+pi/4)
+w=1
+t=2*%pi;//t=2*pi/w
+disp(t,'a')
+//x(t)=sin(2pi*t/3)
+w=2*%pi/3;
+t=2*%pi/w;//check if t is rational
+if t==ceil(t) then
+ disp(t,'b');
+else
+ disp('non periodic','b')
+end
+//x(t)=cos(pi*t/3)+sin(pi*t/4)
+w1=%pi/3;
+w2=%pi/4;
+t1=2*%pi/w1;
+t2=2*%pi/w2;
+t=lcm([t1 t2/2]);
+
+if t==ceil(t) then
+ disp(t,'c');
+else
+ disp('non periodic')
+end
+//x(t)=cos(t)+sin(sqrt(2)*t)
+w1=1;
+w2=sqrt(2);
+t1=2*%pi/w1;
+t2=2*%pi/w2;
+t=lcm([t1 t2]);
+if t==ceil(t) then
+ disp(t,'d');
+else
+ disp('non periodic')
+end
+//x(t)=(sin(t))^2=(1-cos(2*t))/2
+w=2;
+t=2*%pi/w;
+disp(t,'e')
+//x(t)=e^(%i*(%pi/2)*t-1)
+w=%pi/2;
+t=2*%pi/w;
+disp(t,'f')
+//x[n]=e^(%i*(%pi/4))
+w=%pi/4;
+N=2*%pi/w;
+disp(N,'g')
+//x[n]=cos(1*n/4)
+w=1/4;
+N=2*%pi/w;
+if N==ceil(N) then
+ disp(N,'h');
+else
+ disp('non periodic','h')
+end
+//x[n]=cos(%pi*n/3)+sin(%pi*n/4)
+w1=%pi/3;
+w2=%pi/4;
+N1=2*%pi/w1;
+N2=2*%pi/w2;
+N=lcm([N1 N2/2]);
+if N==ceil(N) then
+ disp(N,'i');
+else
+ disp('non periodic','i')
+end
+//x[n]=(cos(%pi*n/8))^2=(1+cos(%pi*n/4))/2
+w=%pi/4;
+N=2*%pi/w;
+disp(N,'j')
+
diff --git a/62/CH1/EX1.2/ex_1_2.sce b/62/CH1/EX1.2/ex_1_2.sce new file mode 100755 index 000000000..4f2f5c9a1 --- /dev/null +++ b/62/CH1/EX1.2/ex_1_2.sce @@ -0,0 +1,47 @@ +//example 1.2
+//shifting and scaling discrete signals
+clear ;
+clc;
+close;
+t=-2:6;
+x(1:3)=0;
+for i = 3:(length(t)-3)
+ x(i) =i-3;
+end
+x(i+1)=x(i);
+x(i+2:9)=0;
+figure
+a=gca();
+plot2d3(t,x)
+plot(t,x,'r.')
+xtitle('x[n]')
+t1=t+2;
+figure
+a=gca();
+plot2d3(t1,x)
+plot(t1,x,'r.')
+xtitle('x[n-2]')
+a.thickness=2;
+t2=-1:1/2:3;
+figure
+a=gca()
+plot2d3(ceil(t2),x)
+plot(ceil(t2),x,'r.')
+xtitle('x[2n]')
+a.thickness=2;
+t3=-6:2;
+figure
+a=gca();
+plot2d3(t3,x($:-1:1))
+plot(t3,x($:-1:1),'r.')
+xtitle('x[-n]')
+a.y_location='right';
+a.thickness=2;
+t4=t3+2;
+figure
+a=gca();
+plot2d3(t4,x($:-1:1))
+plot(t4,x($:-1:1),'r.')
+xtitle('x[-n+2]')
+a.y_location='right';
+a.thickness=2;
\ No newline at end of file diff --git a/62/CH1/EX1.2/ex_2_1.png b/62/CH1/EX1.2/ex_2_1.png Binary files differnew file mode 100755 index 000000000..e7720ff30 --- /dev/null +++ b/62/CH1/EX1.2/ex_2_1.png diff --git a/62/CH1/EX1.2/ex_2_2.png b/62/CH1/EX1.2/ex_2_2.png Binary files differnew file mode 100755 index 000000000..86afc3d60 --- /dev/null +++ b/62/CH1/EX1.2/ex_2_2.png diff --git a/62/CH1/EX1.21/ex_1_21.sce b/62/CH1/EX1.21/ex_1_21.sce new file mode 100755 index 000000000..fd67e2668 --- /dev/null +++ b/62/CH1/EX1.21/ex_1_21.sce @@ -0,0 +1,22 @@ +//ex_21 to check if u(-t)={1 for t<0 and 0 for t>0}
+clear;
+clc;
+close;
+t=-10:1/100:10;
+for i = 1:(length(t))
+ if t(i)<0 then
+ x(i)=0
+ else
+ x(i)=1
+ end
+end
+figure
+a=gca();
+plot(t,x)
+xtitle('u(t)','t')
+a.data_bounds=[-10,-1;10,2];
+figure
+a=gca();
+plot(t,x($:-1:1))
+xtitle('u(-t)','t')
+a.data_bounds=[-10,-1;10,2];
diff --git a/62/CH1/EX1.21/ex_1_21_1.png b/62/CH1/EX1.21/ex_1_21_1.png Binary files differnew file mode 100755 index 000000000..910657a2f --- /dev/null +++ b/62/CH1/EX1.21/ex_1_21_1.png diff --git a/62/CH1/EX1.21/ex_1_21_2.png b/62/CH1/EX1.21/ex_1_21_2.png Binary files differnew file mode 100755 index 000000000..31084bc16 --- /dev/null +++ b/62/CH1/EX1.21/ex_1_21_2.png diff --git a/62/CH1/EX1.22/ex_1_22.sce b/62/CH1/EX1.22/ex_1_22.sce new file mode 100755 index 000000000..6728e510c --- /dev/null +++ b/62/CH1/EX1.22/ex_1_22.sce @@ -0,0 +1,63 @@ +//ex_22 product of x(t) and unit step function
+clear x;
+clear t;
+clear;
+clear y;
+clc;
+close;
+t=-1:1/100:2
+for i=1:(length(t))
+ if t(i)<0 then
+ x(i)=t(i)+1;
+ elseif t(i)<1
+ x(i)=1
+ else
+ x(i)=2
+ end
+end
+figure
+a=gca();
+plot2d(t,x)
+a.y_location='origin'
+xtitle('x(t)','t')
+//a.x(t)*u(1-t)
+for i = 1:(length(t))
+ if t(i)<1 then
+ u1(i)=1
+ else
+ u1(i)=0
+ end
+end
+y=x.*u1
+figure
+a=gca();
+plot2d(t,y)
+a.y_location='origin'
+xtitle('x(t)*u(1-t)','t')
+for i = 1:(length(t))
+ if t(i)<1 & t(i)>0 then
+ u2(i)=1
+ else
+ u2(i)=0
+ end
+end
+y=x.*u2;
+figure
+a=gca();
+plot2d(t,y)
+a.y_location='origin'
+xtitle('x(t)*u(t-1)','t')
+for i = 1:(length(t))
+ if t(i)==3/2 then
+ z(i)=x(i)
+ else
+ z(i)=0
+ end
+end
+figure
+a=gca();
+plot2d3(t,z)
+poly_1=a.children.children;
+poly_1.thickness=3;
+a.y_location='origin'
+xtitle('x(t)*delta(t-3/2)','t')
diff --git a/62/CH1/EX1.22/ex_1_22_1.png b/62/CH1/EX1.22/ex_1_22_1.png Binary files differnew file mode 100755 index 000000000..f5f873bd2 --- /dev/null +++ b/62/CH1/EX1.22/ex_1_22_1.png diff --git a/62/CH1/EX1.22/ex_1_22_2.png b/62/CH1/EX1.22/ex_1_22_2.png Binary files differnew file mode 100755 index 000000000..34f538bb7 --- /dev/null +++ b/62/CH1/EX1.22/ex_1_22_2.png diff --git a/62/CH1/EX1.23/ex_1_23.png b/62/CH1/EX1.23/ex_1_23.png Binary files differnew file mode 100755 index 000000000..b5c8c583a --- /dev/null +++ b/62/CH1/EX1.23/ex_1_23.png diff --git a/62/CH1/EX1.23/ex_1_23.sce b/62/CH1/EX1.23/ex_1_23.sce new file mode 100755 index 000000000..2eafa8ae5 --- /dev/null +++ b/62/CH1/EX1.23/ex_1_23.sce @@ -0,0 +1,52 @@ +//ex_23 product of discrete signal and unit step function
+clear;
+clc;
+close;
+t=-3:3;
+x=[3 2 1 0 1 2 3];
+//u[1-n]
+for i=1:length(t);
+ if t(i)<=1 then
+ u1(i)=1;
+ else
+ u1(i)=0;
+ end
+end
+y=x.*u1';
+figure
+a=gca();
+plot2d3(t,y)
+plot(t,y,'r.')
+xtitle('y[n]','n')
+a.y_location='origin'
+//u[n+2]-u[n]
+for i=1:length(t);
+ if t(i)<1 & t(i)>=-2 then
+ u2(i)=1;
+ else
+ u2(i)=0;
+ end
+end
+z=x.*u2';
+figure
+a=gca();
+plot2d3(t,z)
+plot(t,z,'r.')
+xtitle('z[n]','n')
+a.y_location='origin'
+//$[n-1]
+for i=1:length(t);
+ if t(i)==1 then
+ del(i)=1;
+ else
+ del(i)=0;
+ end
+end
+p=x.*del';
+figure
+a=gca();
+plot2d3(t,p)
+plot(t,p,'r.')
+xtitle('y[n]','n')
+a.y_location='origin'
+
diff --git a/62/CH1/EX1.3/ex_1_3.sce b/62/CH1/EX1.3/ex_1_3.sce new file mode 100755 index 000000000..391361305 --- /dev/null +++ b/62/CH1/EX1.3/ex_1_3.sce @@ -0,0 +1,47 @@ +//example_1.3
+// sampling of continuos function
+clear;
+clc;
+close;
+t=-1:1/100:1;
+for i=1:length(t)
+ x(i)=1-abs(t(i))
+end
+figure
+a=gca();
+plot2d(t,x)
+xtitle('x(t)')
+a.y_location='middle'
+figure
+a=gca();
+for i=1:length(t)
+ if t(i)<0 then
+ t1(i)=ceil(t(i)*4)
+ else
+ t1(i)=floor(t(i)*4)
+ end
+end
+plot2d3(ceil(t1),x)
+xtitle('x[n]=x[n/4]')
+figure
+a=gca();
+for i=1:length(t)
+ if t(i)<0 then
+ t2(i)=ceil(t(i)*2)
+ else
+ t2(i)=floor(t(i)*2)
+ end
+end
+plot2d3(ceil(t2),x)
+xtitle('x[n]=x[n/2]')
+figure
+a=gca();
+for i=1:length(t)
+ if t(i)<0 then
+ t3(i)=ceil(t(i))
+ else
+ t3(i)=floor(t(i))
+ end
+end
+plot2d3(ceil(t3),x)
+xtitle('x[n]')
\ No newline at end of file diff --git a/62/CH1/EX1.3/ex_3_1.png b/62/CH1/EX1.3/ex_3_1.png Binary files differnew file mode 100755 index 000000000..af496df98 --- /dev/null +++ b/62/CH1/EX1.3/ex_3_1.png diff --git a/62/CH1/EX1.3/ex_3_2.png b/62/CH1/EX1.3/ex_3_2.png Binary files differnew file mode 100755 index 000000000..16863ab70 --- /dev/null +++ b/62/CH1/EX1.3/ex_3_2.png diff --git a/62/CH1/EX1.31/ex_1_31.sce b/62/CH1/EX1.31/ex_1_31.sce new file mode 100755 index 000000000..e98937720 --- /dev/null +++ b/62/CH1/EX1.31/ex_1_31.sce @@ -0,0 +1,31 @@ +clear;
+close;
+clc;
+t=-10:0.1:10;
+a=2;
+//x(t)=u(t)-u(t-a)
+x=[zeros(1,find(t==0)-1) ones(1,find(t==a)-find(t==0)+1) zeros(1,length(t)-find(t==a))];
+subplot(2,1,1)
+plot(t,x)
+xtitle('x(t)','t')
+subplot(2,1,2)
+plot2d3(t(1:$-1),diff(x))
+xtitle('diff(x(t))','t')
+//x(t)=t*(u(t)-u(t-a))
+xb=t.*x;
+figure
+subplot(2,1,1)
+plot(t,xb)
+xtitle('x(t)','t')
+subplot(2,1,2)
+plot2d(t(1:$-1),diff(xb))
+xtitle('diff(x(t))','t')
+//x(t)=sgn(t)
+x=[-ones(1,find(t==0)-1) ones(1,length(t)-find(t==0)+1)];
+figure
+subplot(2,1,1)
+plot(t,x)
+xtitle('x(t)','t')
+subplot(2,1,2)
+plot2d(t(1:$-1),diff(x))
+xtitle('diff(x(t))','t')
\ No newline at end of file diff --git a/62/CH1/EX1.31/ex_1_31_2.png b/62/CH1/EX1.31/ex_1_31_2.png Binary files differnew file mode 100755 index 000000000..cc7699f8c --- /dev/null +++ b/62/CH1/EX1.31/ex_1_31_2.png diff --git a/62/CH1/EX1.31/ex_1_31a.png b/62/CH1/EX1.31/ex_1_31a.png Binary files differnew file mode 100755 index 000000000..7f6dec604 --- /dev/null +++ b/62/CH1/EX1.31/ex_1_31a.png diff --git a/62/CH1/EX1.35/ex_1_35.sce b/62/CH1/EX1.35/ex_1_35.sce new file mode 100755 index 000000000..fbd2aeda0 --- /dev/null +++ b/62/CH1/EX1.35/ex_1_35.sce @@ -0,0 +1,15 @@ +//ex_35 to check if a system is linear or non-linear
+clear;
+clc;
+close;
+x1=2;
+x2=3;
+y1=x1*x1;
+y2=x2*x2;
+y=y1+y2;
+z=(x1+x2)*(x1+x2);
+if z==y then
+ disp('the system is linear')
+else
+ disp("the system is nonlinear")
+end
\ No newline at end of file diff --git a/62/CH1/EX1.36/ex_1_36.sce b/62/CH1/EX1.36/ex_1_36.sce new file mode 100755 index 000000000..8837dd21c --- /dev/null +++ b/62/CH1/EX1.36/ex_1_36.sce @@ -0,0 +1,56 @@ +// ex_36 check if y[n] = x[n-1] memoryless ,causal, linear, time variant
+clear;
+clc;
+s = 2;//shift
+T = 20; //lenght of signal
+x(1)=1;
+for n = 2:T
+ x(n) = n;
+ y(n) = x(n-1);
+end
+if y(2)==x(2) then
+ disp("memoryless")
+else
+ disp("not memoryless")
+end
+//causal if it does'nt depend on future
+if y(2)==x(2) | y(2)==x(1) then
+ disp('causal')
+else
+ disp('non casual')
+end
+x1=x;
+y1=y;
+x2(1)=2;
+for n = 2:T
+ x2(n) = 2;
+ y2(n) = x2(n-1);
+end
+z=y1+y2;
+for n = 2:T
+ y3(n) = (x2(n-1)+x1(n-1));
+end
+if z==y3 then
+ disp('linear')
+else
+ disp("nonlinear")
+end
+Ip = x(T-s);
+Op = y(T-s);
+if(Ip == Op)
+ disp(' Time In-variant system');
+else
+ disp('Time Variant system');
+end
+Max =20;
+dd=1;
+for n=2:T
+ if y(n)>Max then
+ dd=0
+ end
+end
+if dd==0
+ disp('unstable')
+ else
+ disp('stable');
+end
\ No newline at end of file diff --git a/62/CH1/EX1.38/ex_1_38.sce b/62/CH1/EX1.38/ex_1_38.sce new file mode 100755 index 000000000..fdde9164f --- /dev/null +++ b/62/CH1/EX1.38/ex_1_38.sce @@ -0,0 +1,46 @@ +// ex_38 check if y[n] = n.x[n] is memoryless, causal, linear, time-varaint
+clear;
+clc;
+s = 2;//shift
+T = 20; //lenght of signal
+for n = 1:T
+ x(n) = n;
+ y(n) = n*x(n);
+end
+if y(1)==x(1) then
+ disp("memoryless and causal")
+else
+ disp("noncausal")
+end
+x1=x;
+y1=y;
+for n = 1:T
+ x2(n) = 2;
+ y2(n) = n*x2(n);
+end
+z=y1+y2;
+for n = 1:T
+ y3(n) = n*(x2(n)+x1(n));
+end
+if z==y3 then
+ disp('linear')
+else
+ disp("nonlinear")
+end
+Ip = x(T-s);
+Op = y(T-s);
+if(Ip == Op)
+ disp(' Time In-variant system');
+else
+ disp('Time Variant system');
+end
+Max = 50;
+S = 0;
+for n=1:T
+ S = S+y(n);
+end
+if (S >Max)
+ disp('unstable')
+ else
+ disp('stable');
+end
\ No newline at end of file diff --git a/62/CH1/EX1.39/ex_1_39.sce b/62/CH1/EX1.39/ex_1_39.sce new file mode 100755 index 000000000..b7c5f0d2a --- /dev/null +++ b/62/CH1/EX1.39/ex_1_39.sce @@ -0,0 +1,18 @@ +//ex_39check if y[n]=x[k*n] is time invariant
+clear;
+clc;
+s = 2;//shift
+x=[1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9];
+T=length(x);
+k=3;
+for n=1:T/k
+ y(n)=x(k*n);
+end
+T=5;
+Ip = x(T-s);
+Op = y(T-s);
+if(Ip == Op)
+ disp(' Time In-variant system');
+else
+ disp('Time Variant system');
+end
\ No newline at end of file diff --git a/62/CH1/EX1.4/ex_1_4.sce b/62/CH1/EX1.4/ex_1_4.sce new file mode 100755 index 000000000..26cf28d87 --- /dev/null +++ b/62/CH1/EX1.4/ex_1_4.sce @@ -0,0 +1,36 @@ +//ex_4 combining two discrete signals
+clear;
+clc;
+close;
+t1=-2:7
+t2=-3:4
+x1=[0 0 0 1 2 3 0 0 2 2 0];
+x2=[0 -2 -2 2 2 0 -2 0 0 0 0];
+t3=min(t1(1),t2(1)):max(t1(length(t1)),t2(length(t2)));
+figure
+a=gca();
+plot2d3(t3,x1)
+plot(t3,x1,'r.')
+xtitle('x1[n]')
+figure
+a=gca();
+plot2d3(t3,x2)
+plot(t3,x2,'r.')
+xtitle('x2[n]')
+a.x_location='middle'
+figure
+a=gca();
+plot2d3(t3,x1+x2)
+plot(t3,x1+x2,'r.')
+xtitle('y1[n]=x1[n]+x2[n]')
+a.x_location='origin'
+figure
+a=gca();
+plot2d3(t3,2.*x1)
+plot(t3,2.*x1,'r.')
+xtitle('y2[n]=2 * x1[n]')
+figure
+a=gca();
+plot2d3(t3,x1.*x2)
+plot(t3,x1.*x2,'r.')
+xtitle('y2[n]=x2[n] * x1[n]')
\ No newline at end of file diff --git a/62/CH1/EX1.4/ex_1_4_1.png b/62/CH1/EX1.4/ex_1_4_1.png Binary files differnew file mode 100755 index 000000000..b8d38aee3 --- /dev/null +++ b/62/CH1/EX1.4/ex_1_4_1.png diff --git a/62/CH1/EX1.4/ex_1_4_2.png b/62/CH1/EX1.4/ex_1_4_2.png Binary files differnew file mode 100755 index 000000000..8d56ecfd1 --- /dev/null +++ b/62/CH1/EX1.4/ex_1_4_2.png diff --git a/62/CH1/EX1.41/ex_1_41.sce b/62/CH1/EX1.41/ex_1_41.sce new file mode 100755 index 000000000..461143d80 --- /dev/null +++ b/62/CH1/EX1.41/ex_1_41.sce @@ -0,0 +1,23 @@ +clear;
+close;
+clc;
+n=-2:4;
+x1=[0 0 0 0 2 0 0];
+y1=[0 0 0 0 1 2 0];
+x2=[0 1 0 0 0 0 0];
+y2=[0 2 1 0 0 0 0];
+x3=[0 0 0 1 2 0 0];
+y3=[0 0 0 2 3 1 0];
+subplot(3,2,1);plot2d3(n,x1);plot(n,x1,'r.');xtitle('x1')
+subplot(3,2,2);plot2d3(n,y1);plot(n,y1,'r.');xtitle('y1')
+subplot(3,2,3);plot2d3(n,x2);plot(n,x2,'r.');xtitle('x2')
+subplot(3,2,4);plot2d3(n,y2);plot(n,y2,'r.');xtitle('y2')
+subplot(3,2,5);plot2d3(n,x3);plot(n,x3,'r.');xtitle('x3')
+subplot(3,2,6);plot2d3(n,y3);plot(n,y3,'r.');xtitle('y3')
+disp("it can be seen that x3[n]=x1[n]+x2[n-2] therefore for linear system y3[n]=y1[n]+y2[n-2]")
+figure
+subplot(4,1,1);plot2d3(n,y1);plot(n,y1,'r.');xtitle('y1')
+subplot(4,1,2);plot2d3(n+2,y2);plot(n+2,y2,'r.');xtitle('y2[n-2]')
+subplot(4,1,3);plot2d3(n,y1+[0 0 y2(1:find(n+2==4))]);plot(n,y1+[0 0 y2(1:find(n+2==4))],'r.');xtitle('y1[n]+y2[n-2]')
+subplot(4,1,4);plot2d3(n,y3);plot(n,y3,'r.');xtitle('y3[n]')
+disp("from the figure y3[n]<>y1[n]+y2[n-2] therefore the system is not linear")
diff --git a/62/CH1/EX1.41/ex_1_41_1.png b/62/CH1/EX1.41/ex_1_41_1.png Binary files differnew file mode 100755 index 000000000..f3b6b4243 --- /dev/null +++ b/62/CH1/EX1.41/ex_1_41_1.png diff --git a/62/CH1/EX1.41/ex_1_41_2.png b/62/CH1/EX1.41/ex_1_41_2.png Binary files differnew file mode 100755 index 000000000..eef9e877e --- /dev/null +++ b/62/CH1/EX1.41/ex_1_41_2.png diff --git a/62/CH1/EX1.5.a/ex_1_5_a.png b/62/CH1/EX1.5.a/ex_1_5_a.png Binary files differnew file mode 100755 index 000000000..42340bc13 --- /dev/null +++ b/62/CH1/EX1.5.a/ex_1_5_a.png diff --git a/62/CH1/EX1.5.a/ex_1_5a.sce b/62/CH1/EX1.5.a/ex_1_5a.sce new file mode 100755 index 000000000..344f5d238 --- /dev/null +++ b/62/CH1/EX1.5.a/ex_1_5a.sce @@ -0,0 +1,35 @@ +//ex_5 even and odd signals of x(t)
+clear ;
+clear x;
+clear t;
+clc;
+close;
+t = 0:1/100:5;
+for i = 1:length(t)
+ x(i) = (4/5)*t(i) ;
+end
+for i = length(t)+1:2*length(t)
+x(i) = 0;
+end
+figure
+a=gca();
+t1=0:1/100:10;
+plot(t1,x(1:$-1))
+xtitle('x(t)')
+figure
+a=gca();
+t3=0:1/100:10;
+plot(t3,x(1:$-1)/2)
+xtitle('[x(t)+x(-t)]/2=even')
+t2=-10:1/100:0;
+plot(t2,x($:-1:2)/2)
+a.y_location='origin'
+figure
+a=gca();
+t4=0:1/100:10;
+plot(t3,x(1:$-1)/2)
+xtitle('[x(t)-x(-t)]/2=odd')
+t5=-10:1/100:0;
+plot(t5,-x($:-1:2)/2)
+a.y_location='origin'
+a.x_location='origin'
\ No newline at end of file diff --git a/62/CH1/EX1.5.b/ex_1_5_b.png b/62/CH1/EX1.5.b/ex_1_5_b.png Binary files differnew file mode 100755 index 000000000..4617e9c04 --- /dev/null +++ b/62/CH1/EX1.5.b/ex_1_5_b.png diff --git a/62/CH1/EX1.5.b/ex_1_5b.sce b/62/CH1/EX1.5.b/ex_1_5b.sce new file mode 100755 index 000000000..d007e7d8d --- /dev/null +++ b/62/CH1/EX1.5.b/ex_1_5b.sce @@ -0,0 +1,25 @@ +//ex_5 even and odd signals of x(t)
+clear;
+clc;
+close;
+t = 0:1/100:5;
+x=4*exp(-0.5.*t)
+figure
+a=gca();
+xtitle('x(t)')
+plot2d(t,x)
+figure
+a=gca();
+xtitle('even signal')
+plot2d(t,x/2)
+t1=-5:1/100:0;
+plot2d(t1,x($:-1:1)/2)
+a.y_location='origin'
+figure
+a=gca();
+xtitle('odd signal')
+plot2d(t,x/2)
+t1=-5:1/100:0;
+plot2d(t1,-x($:-1:1)/2)
+a.y_location='origin'
+a.x_location='origin'
diff --git a/62/CH1/EX1.5.c/ex_1_5_c.png b/62/CH1/EX1.5.c/ex_1_5_c.png Binary files differnew file mode 100755 index 000000000..d07a6f97d --- /dev/null +++ b/62/CH1/EX1.5.c/ex_1_5_c.png diff --git a/62/CH1/EX1.5.c/ex_1_5c.sce b/62/CH1/EX1.5.c/ex_1_5c.sce new file mode 100755 index 000000000..fb4a3e1f5 --- /dev/null +++ b/62/CH1/EX1.5.c/ex_1_5c.sce @@ -0,0 +1,32 @@ +//ex_5 even and odd signals of x(t)
+clear;
+clc;
+close;
+t=0:7;
+x=[4 4 4 4 4 4 0 0];
+figure
+a=gca();
+plot2d3(t,x)
+plot(t,x,'r.')
+xtitle('x[n]')
+a.thickness=2;
+t1=-7:0;
+figure
+a=gca();
+t2=-7:7;
+y=[x($:-1:2)./2 x(1) x(2:8)./2 ]
+plot2d3(t2,y)
+plot(t2,y,'r.')
+xtitle('even')
+a.y_location='right';
+a.thickness=2;
+figure
+a=gca();
+z=[-x($:-1:2)./2 0 x(2:8)./2 ]
+plot2d3(t2,z)
+plot(t2,z,'r.')
+xtitle('odd')
+a.y_location='right';
+a.x_location='origin';
+a.thickness=2;
+
diff --git a/62/CH1/EX1.5.d/ex_1_5_d.png b/62/CH1/EX1.5.d/ex_1_5_d.png Binary files differnew file mode 100755 index 000000000..b1303a243 --- /dev/null +++ b/62/CH1/EX1.5.d/ex_1_5_d.png diff --git a/62/CH1/EX1.5.d/ex_1_5d.sce b/62/CH1/EX1.5.d/ex_1_5d.sce new file mode 100755 index 000000000..26009f1ff --- /dev/null +++ b/62/CH1/EX1.5.d/ex_1_5d.sce @@ -0,0 +1,30 @@ +//ex_5 d even and odd signals of x(t)
+clear;
+clc;
+close;
+t=0:5;
+x=[ 0 2 4 2 0 0];
+figure
+a=gca();
+plot2d3(t,x)
+plot(t,x,'r.')
+xtitle('x[n]','n')
+a.thickness=2;
+figure
+a=gca();
+t2=-5:5 ;
+y=[ x($:-1:2)./2 x(1) x(2:6)./2 ]
+plot2d3(t2,y)
+plot(t2,y,'r.')
+xtitle('even','n')
+a.y_location='right';
+a.thickness=2;
+figure
+a=gca();
+z=[ -x($:-1:2)./2 0 x(2:6)./2 ]
+plot2d3(t2,z)
+plot(t2,z,'r.')
+xtitle('odd','n')
+a.y_location='right';
+a.x_location='origin';
+a.thickness=2;
diff --git a/62/CH1/EX1.6/ex_1_6.sce b/62/CH1/EX1.6/ex_1_6.sce new file mode 100755 index 000000000..9c8a218da --- /dev/null +++ b/62/CH1/EX1.6/ex_1_6.sce @@ -0,0 +1,19 @@ +//ex_6 even and odd signal of e^jt
+clear;
+clc;
+close;
+t = 0:1/100:5;
+x=exp(%i.*t);
+y=exp(-%i.*t);
+even=x./2+y./2;
+odd=x./2-y./2;
+figure
+a=gca();
+plot2d(t,even)
+a.x_location='origin'
+xtitle('even','t')
+figure
+a=gca();
+plot2d(t,odd./%i)
+a.x_location='origin'
+xtitle('odd','t')
\ No newline at end of file diff --git a/62/CH1/EX1.6/ex_1_6even.png b/62/CH1/EX1.6/ex_1_6even.png Binary files differnew file mode 100755 index 000000000..7da50d6fb --- /dev/null +++ b/62/CH1/EX1.6/ex_1_6even.png diff --git a/62/CH1/EX1.6/ex_1_6odd.png b/62/CH1/EX1.6/ex_1_6odd.png Binary files differnew file mode 100755 index 000000000..bbd813510 --- /dev/null +++ b/62/CH1/EX1.6/ex_1_6odd.png diff --git a/62/CH1/EX1.9/ex_1_9.sce b/62/CH1/EX1.9/ex_1_9.sce new file mode 100755 index 000000000..15fbe2d95 --- /dev/null +++ b/62/CH1/EX1.9/ex_1_9.sce @@ -0,0 +1,14 @@ +//ex_9 to show that e^iwt is periodic with T=2*pi/W0
+clear;
+clc;
+close;
+t=0:1/100:10;
+w0=1;
+T=2*%pi/w0;
+x=exp(%i*w0*t);
+y=exp(%i*w0*(t+T));
+if ceil(x)==ceil(y) then
+ disp('e^iwt is periodic with T=2*pi/W0')
+else
+ disp('nonperiodic')
+end
\ No newline at end of file |