From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 3812/CH1/EX1.14.a/1_14_a.sce | 8 ++++++++ 3812/CH1/EX1.14.b/1_14_b.sce | 8 ++++++++ 3812/CH1/EX1.14.c/1_14_c.sce | 8 ++++++++ 3812/CH1/EX1.15.a/1_15_a.sce | 8 ++++++++ 3812/CH1/EX1.18.c/1_18_c.sce | 11 +++++++++++ 3812/CH1/EX1.18.d/1_18_d.sce | 12 ++++++++++++ 3812/CH1/EX1.19.a/1_19_a.sce | 11 +++++++++++ 3812/CH1/EX1.19.b/1_19_d.sce | 10 ++++++++++ 3812/CH1/EX1.19.e/1_19_e.sce | 9 +++++++++ 3812/CH1/EX1.2.a/1_2_a.sce | 16 ++++++++++++++++ 3812/CH1/EX1.2.b/1_2_b.sce | 16 ++++++++++++++++ 3812/CH1/EX1.2.c/1_2_c.sce | 16 ++++++++++++++++ 3812/CH1/EX1.23/1_23.sce | 15 +++++++++++++++ 3812/CH1/EX1.25.a/1_25_a.sce | 32 ++++++++++++++++++++++++++++++++ 3812/CH1/EX1.25.b/1_25_b.sce | 20 ++++++++++++++++++++ 3812/CH1/EX1.25.d/1_25_d.sce | 32 ++++++++++++++++++++++++++++++++ 3812/CH1/EX1.27.a/1_27_a.sce | 17 +++++++++++++++++ 3812/CH1/EX1.29.a/1_29_a.sce | 16 ++++++++++++++++ 3812/CH1/EX1.31.d/1_31_d.sce | 7 +++++++ 3812/CH1/EX1.35.a/1_35_a.sce | 16 ++++++++++++++++ 3812/CH1/EX1.36.f/1_36_f.sce | 16 ++++++++++++++++ 3812/CH1/EX1.6.a/1_6_a.sce | 14 ++++++++++++++ 3812/CH1/EX1.6.b/1_6_b.sce | 14 ++++++++++++++ 3812/CH1/EX1.6.c/1_6_c.sce | 13 +++++++++++++ 3812/CH1/EX1.6.d/1_6_d.sce | 13 +++++++++++++ 3812/CH1/EX1.6.e/1_6_e.sce | 14 ++++++++++++++ 3812/CH1/EX1.6.f/1_6_f.sce | 16 ++++++++++++++++ 3812/CH1/EX1.6.g/1_6_g.sce | 16 ++++++++++++++++ 3812/CH1/EX1.7.a/1_7_a.sce | 14 ++++++++++++++ 3812/CH1/EX1.7.b/1_7_b.sce | 14 ++++++++++++++ 3812/CH1/EX1.7.c/1_7_c.sce | 15 +++++++++++++++ 3812/CH1/EX1.7.d/1_7_d.sce | 15 +++++++++++++++ 3812/CH1/EX1.7.e/1_7_e.sce | 15 +++++++++++++++ 3812/CH1/EX1.7.f/1_7_f.sce | 15 +++++++++++++++ 3812/CH1/EX1.8.a/1_8_a.sce | 14 ++++++++++++++ 35 files changed, 506 insertions(+) create mode 100644 3812/CH1/EX1.14.a/1_14_a.sce create mode 100644 3812/CH1/EX1.14.b/1_14_b.sce create mode 100644 3812/CH1/EX1.14.c/1_14_c.sce create mode 100644 3812/CH1/EX1.15.a/1_15_a.sce create mode 100644 3812/CH1/EX1.18.c/1_18_c.sce create mode 100644 3812/CH1/EX1.18.d/1_18_d.sce create mode 100644 3812/CH1/EX1.19.a/1_19_a.sce create mode 100644 3812/CH1/EX1.19.b/1_19_d.sce create mode 100644 3812/CH1/EX1.19.e/1_19_e.sce create mode 100644 3812/CH1/EX1.2.a/1_2_a.sce create mode 100644 3812/CH1/EX1.2.b/1_2_b.sce create mode 100644 3812/CH1/EX1.2.c/1_2_c.sce create mode 100644 3812/CH1/EX1.23/1_23.sce create mode 100644 3812/CH1/EX1.25.a/1_25_a.sce create mode 100644 3812/CH1/EX1.25.b/1_25_b.sce create mode 100644 3812/CH1/EX1.25.d/1_25_d.sce create mode 100644 3812/CH1/EX1.27.a/1_27_a.sce create mode 100644 3812/CH1/EX1.29.a/1_29_a.sce create mode 100644 3812/CH1/EX1.31.d/1_31_d.sce create mode 100644 3812/CH1/EX1.35.a/1_35_a.sce create mode 100644 3812/CH1/EX1.36.f/1_36_f.sce create mode 100644 3812/CH1/EX1.6.a/1_6_a.sce create mode 100644 3812/CH1/EX1.6.b/1_6_b.sce create mode 100644 3812/CH1/EX1.6.c/1_6_c.sce create mode 100644 3812/CH1/EX1.6.d/1_6_d.sce create mode 100644 3812/CH1/EX1.6.e/1_6_e.sce create mode 100644 3812/CH1/EX1.6.f/1_6_f.sce create mode 100644 3812/CH1/EX1.6.g/1_6_g.sce create mode 100644 3812/CH1/EX1.7.a/1_7_a.sce create mode 100644 3812/CH1/EX1.7.b/1_7_b.sce create mode 100644 3812/CH1/EX1.7.c/1_7_c.sce create mode 100644 3812/CH1/EX1.7.d/1_7_d.sce create mode 100644 3812/CH1/EX1.7.e/1_7_e.sce create mode 100644 3812/CH1/EX1.7.f/1_7_f.sce create mode 100644 3812/CH1/EX1.8.a/1_8_a.sce (limited to '3812/CH1') diff --git a/3812/CH1/EX1.14.a/1_14_a.sce b/3812/CH1/EX1.14.a/1_14_a.sce new file mode 100644 index 000000000..1cde65ccd --- /dev/null +++ b/3812/CH1/EX1.14.a/1_14_a.sce @@ -0,0 +1,8 @@ +//Example 1.14 +//check the given signL is PERIODIC OR NOT// +clc ; +t=-10:.01:10; +x=%i*(exp(%i*10*t)); +subplot (311) +plot (t,x); +disp ('(a) this shows that the given signal is periodic with period (.2*%pi)'); diff --git a/3812/CH1/EX1.14.b/1_14_b.sce b/3812/CH1/EX1.14.b/1_14_b.sce new file mode 100644 index 000000000..5ce4cffe1 --- /dev/null +++ b/3812/CH1/EX1.14.b/1_14_b.sce @@ -0,0 +1,8 @@ +//Example 1.14 +//check the given signL is PERIODIC OR NOT e^(-1+j)*t +clc ; +t=-1:.01:1; +x=(exp(-1+%i)*t); +f=1/2*%pi; +N=1/f; +disp (N,'this shows that the given signal is not periodic'); diff --git a/3812/CH1/EX1.14.c/1_14_c.sce b/3812/CH1/EX1.14.c/1_14_c.sce new file mode 100644 index 000000000..d25dcad50 --- /dev/null +++ b/3812/CH1/EX1.14.c/1_14_c.sce @@ -0,0 +1,8 @@ +//Example 1.14 +// Find wheather the following signal is periodic or not x3(n)=e^(i*7*pi*n) +clc; +n=-21:21; +x=exp(%i *7* %pi *n); +f=(7*%pi)/(2*%pi); +N=1/f; +disp(N,'the given signal is periodic'); diff --git a/3812/CH1/EX1.15.a/1_15_a.sce b/3812/CH1/EX1.15.a/1_15_a.sce new file mode 100644 index 000000000..c5c7892ba --- /dev/null +++ b/3812/CH1/EX1.15.a/1_15_a.sce @@ -0,0 +1,8 @@ +//Example 1.15 +// Find wheather the following signal is periodic or not x3(n)=2*e^(%i*(t+%pi/4)) +clc; +t=-21:21; +x=2*exp(%i*(t+%pi/4)); +f=1/(2*%pi); +N=1/f; +disp('samples',N,'(b)the given signal is not periodic'); diff --git a/3812/CH1/EX1.18.c/1_18_c.sce b/3812/CH1/EX1.18.c/1_18_c.sce new file mode 100644 index 000000000..f56349128 --- /dev/null +++ b/3812/CH1/EX1.18.c/1_18_c.sce @@ -0,0 +1,11 @@ +// example 1.18 +//determine the values of power and energy +clc ; +t =0:0.01:100; +A=1; +x=A*cos (t); +P=(integrate('(A*cos(t))^2','t',0,2*%pi ))/(2*%pi); +disp(P,'The power of the signal is:'); +E=(integrate('(A*cos(t))^2','t',0,2*%pi)); +disp(E,'The energy is:'); +disp('As t tends to infinity energy also tends to infinity but power remains finite hence it is power signal'); diff --git a/3812/CH1/EX1.18.d/1_18_d.sce b/3812/CH1/EX1.18.d/1_18_d.sce new file mode 100644 index 000000000..693d03f07 --- /dev/null +++ b/3812/CH1/EX1.18.d/1_18_d.sce @@ -0,0 +1,12 @@ +//Example 1.18 +//determine the values of power and energy +clc ; +E=0; +for n=0:200 +x(n+1)=(1/2)^n; +end +for n=0:200 +E=E+x(n +1)^2; +end +disp(E,'The energy of the signal is; ' ); +disp ('since the energy is finite, hence it is energy signal'); diff --git a/3812/CH1/EX1.19.a/1_19_a.sce b/3812/CH1/EX1.19.a/1_19_a.sce new file mode 100644 index 000000000..967a0c326 --- /dev/null +++ b/3812/CH1/EX1.19.a/1_19_a.sce @@ -0,0 +1,11 @@ +// example 1.19 +//determine whether the following signals are power or energy signal +clc ; +t =0:0.01:100; +A=1; +x=A*sin(t); +P=(integrate('(A*sin(t))^2','t',-%pi,%pi))/(2*%pi); +disp(P,'The power of the signal is:'); +E=(integrate('(A*sin(t))^2','t',-%pi,%pi)); +disp(E,'The energy is:'); +disp('As t tends to infinity energy also tends to infinity but power remains finite hence it is power signal'); diff --git a/3812/CH1/EX1.19.b/1_19_d.sce b/3812/CH1/EX1.19.b/1_19_d.sce new file mode 100644 index 000000000..0e693e692 --- /dev/null +++ b/3812/CH1/EX1.19.b/1_19_d.sce @@ -0,0 +1,10 @@ +//example 1.19 +//determine whether the following signals are power or energy signal +clc ; +t=0:0.01:100; +x=1; +P=(integrate('1^2','t',0,1))/2; +disp(P,'The power of the signal is:'); +E=(integrate('1^2','t',0,1)); +disp(E,'The energy is:'); +disp('As t tends to infinity energy also tends to infinity but power remains finite hence it is power signal'); diff --git a/3812/CH1/EX1.19.e/1_19_e.sce b/3812/CH1/EX1.19.e/1_19_e.sce new file mode 100644 index 000000000..18d66be01 --- /dev/null +++ b/3812/CH1/EX1.19.e/1_19_e.sce @@ -0,0 +1,9 @@ +//example 1.19 +//determine whether the following signals are power or energy signal power and energy +clc ; +t=0:0.01:100; +x=t; +T=2; +P=(integrate('t^2','t',0,T))/(T); +disp(P,'The power of the signal is:'); +disp('As t tends to infinity energy also tends to infinity but power remains finite hence it is power signal'); diff --git a/3812/CH1/EX1.2.a/1_2_a.sce b/3812/CH1/EX1.2.a/1_2_a.sce new file mode 100644 index 000000000..14681b23a --- /dev/null +++ b/3812/CH1/EX1.2.a/1_2_a.sce @@ -0,0 +1,16 @@ +//example 1_2 +//sketch the following signal x(3t) +clc; +clear all; +t=-1/3:0.0001:1/3; +for i=1:length(t) +if t(i)<0 then +x(i)=1+3*t(i); +else +x(i)=1-3*t(i); +end +end +plot2d(t,x) +plot (t,x, 'red' ); +xtitle('required figure','t','x(3*t)'); +xgrid(); diff --git a/3812/CH1/EX1.2.b/1_2_b.sce b/3812/CH1/EX1.2.b/1_2_b.sce new file mode 100644 index 000000000..7e5d5fdff --- /dev/null +++ b/3812/CH1/EX1.2.b/1_2_b.sce @@ -0,0 +1,16 @@ +//example 1_2 +//sketch the following signal x(3t+2) +clc; +clear all; +t=-1:0.0001:-1/3; +for i=1:length(t) +if t(i)<-2/3 then +x(i)=3+3*t(i); +else +x(i)=-1-3*t(i); +end +end +plot(t,x) +plot(t,x, 'red' ); +xtitle('required figure','t','x(3*t+2)'); +xgrid(); diff --git a/3812/CH1/EX1.2.c/1_2_c.sce b/3812/CH1/EX1.2.c/1_2_c.sce new file mode 100644 index 000000000..a0febffac --- /dev/null +++ b/3812/CH1/EX1.2.c/1_2_c.sce @@ -0,0 +1,16 @@ +//example 1_2 +//sketch the following signal x(-2t-1) +clc; +clear all; +t=-1:0.0001:0; +for i=1:length(t) +if t(i)>=-1/2 then +x(i)=-2*t(i); +else +x(i)=(2*t(i))+2; +end +end +plot(t,x) +plot(t,x, 'red' ); +xtitle('required figure','t','x(-2*t-1)'); +xgrid(); diff --git a/3812/CH1/EX1.23/1_23.sce b/3812/CH1/EX1.23/1_23.sce new file mode 100644 index 000000000..e1ec469d3 --- /dev/null +++ b/3812/CH1/EX1.23/1_23.sce @@ -0,0 +1,15 @@ +//Example 1.23 +//Find the even and odd components of the signal x(t)=(e^-2t)*cos(t) +clc; +clear all; +t=-10:.1:10; +for j=1:length(t) +i=t(j); +x(j)=(exp(-2*i))*cos(i); +y(j)=(exp(2*i))*cos(i); +e(j)=(1/2)*(x(j)+y(j)); +o(j)=(1/2)*(x(j)-y(j)); +end +disp('In the plot even component is in red and odd component is in blue') +plot(t,e,'red') +plot(t,o,'blue') diff --git a/3812/CH1/EX1.25.a/1_25_a.sce b/3812/CH1/EX1.25.a/1_25_a.sce new file mode 100644 index 000000000..d992c263a --- /dev/null +++ b/3812/CH1/EX1.25.a/1_25_a.sce @@ -0,0 +1,32 @@ +//Example 1.25 +//To check whether the given discrete system is a Linear System (or) Non-Linear System y(t)= t*x(t) +clear; +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('Since It satisifies the superposition principle') +disp('The given system is a Linear system') +else +disp('Since It does not satisify the superposition principle') +disp('The given system is a Non-Linear system') +end diff --git a/3812/CH1/EX1.25.b/1_25_b.sce b/3812/CH1/EX1.25.b/1_25_b.sce new file mode 100644 index 000000000..6e081b1ad --- /dev/null +++ b/3812/CH1/EX1.25.b/1_25_b.sce @@ -0,0 +1,20 @@ +//Example 1.25 +//Check whether the following signal is linear or not. +clear ; +close ; +clc ; +T =20; //length of the signal +for n=1: T +x1(n)=n;x2(n)=2*n; +y1(n)=x1(n)*x1(n); +y2(n)=x2(n)*x2(n); +end +z=y1+y2; +for n =1: T +y3(n)=( x1(n)+x2(n)) ^2; +end +if z== y3 then +disp('The following signal is linear'); +else +disp ( 'The following signal is non linear'); +end diff --git a/3812/CH1/EX1.25.d/1_25_d.sce b/3812/CH1/EX1.25.d/1_25_d.sce new file mode 100644 index 000000000..14174bddb --- /dev/null +++ b/3812/CH1/EX1.25.d/1_25_d.sce @@ -0,0 +1,32 @@ +//Example 1.25(d) +//To check whether the given discrete system is a Linear System (or) Non-Linear System y[n])= 2*x[n]-3 +clear; +clc; +x1=[1,1,1,1]; +x2=[2,2,2,2]; +a=1; +b=1; +for n=1:length(x1) +x3(n)=a*x1(n)+b*x2(n); +end +for n=1:length(x1) +y1(n)=2*x1(n)-3; +y2(n)=2*x2(n)-3; +y3(n)=2*x3(n)-3; +end +for n=1:length(y1) +z(n)=a*y1(n)+b*y2(n); +end +count=0; +for n=1:length(y1) +if(y3(n)==z(n)) +count=count+1; +end +end +if(count==length(y3)) +disp('Since It satisifies the superposition principle') +disp('The given system is a Linear system') +else +disp('Since It does not satisify the superposition principle') +disp('The given system is a Non-Linear system') +end diff --git a/3812/CH1/EX1.27.a/1_27_a.sce b/3812/CH1/EX1.27.a/1_27_a.sce new file mode 100644 index 000000000..b7ef09bdc --- /dev/null +++ b/3812/CH1/EX1.27.a/1_27_a.sce @@ -0,0 +1,17 @@ +//Example 1.27 +//Determine whether the following system is time invariant or not +clc; +clear all; +T =20; +s =2; +for n=1:T +x(n)=n; +y(n)=n*x(n); +end +IP=x(T-s); +OP=y(T-s); +if IP == OP then +disp('The given system is time invariant'); +else +disp('The given system is time variant'); +end diff --git a/3812/CH1/EX1.29.a/1_29_a.sce b/3812/CH1/EX1.29.a/1_29_a.sce new file mode 100644 index 000000000..a3afb9caf --- /dev/null +++ b/3812/CH1/EX1.29.a/1_29_a.sce @@ -0,0 +1,16 @@ +//Example 1.29: +//Determination of stablility of a given system +clear; +clc; +x=[1,2,3,4,0,2,1,3,5,8]; +Maximum_Limit=10; +S=0; +for t=0:Maximum_Limit-1 +S=S+t*x(t+1); +end +if (S >Maximum_Limit) +disp('Eventhough input is bounded output is unbounded') +disp('The given system is unstable'); +else +disp('The given system is stable'); +end diff --git a/3812/CH1/EX1.31.d/1_31_d.sce b/3812/CH1/EX1.31.d/1_31_d.sce new file mode 100644 index 000000000..dffdf48ae --- /dev/null +++ b/3812/CH1/EX1.31.d/1_31_d.sce @@ -0,0 +1,7 @@ +//Example 1.31 +//check the given signL is PERIODIC OR NOT e^(-2*t)*u(t) +clc ; +t=-1:.01:1; +x=exp(-2*t); +plot (t,x); +disp ('(a)this shows that the given signal is not periodic which gives w0=1+j,complex no. the frequency of signal can never be complex it must have real value'); diff --git a/3812/CH1/EX1.35.a/1_35_a.sce b/3812/CH1/EX1.35.a/1_35_a.sce new file mode 100644 index 000000000..9489016e6 --- /dev/null +++ b/3812/CH1/EX1.35.a/1_35_a.sce @@ -0,0 +1,16 @@ +//Example 1.35 +//Find whether the given system is causal or not y(t)=x*sin(t). +clear all; +clc; +t=-10:10; +x=2; +for i=1:length(t) +x3(i)=x*sin(t(i)); +end +causal=%t; +for i=1:length (t) +if t(i)<0 & x3(i)~=0 then +noncausal=%f; +end +end +disp (noncausal,"The statement that the system is noncausal is"); diff --git a/3812/CH1/EX1.36.f/1_36_f.sce b/3812/CH1/EX1.36.f/1_36_f.sce new file mode 100644 index 000000000..05321f416 --- /dev/null +++ b/3812/CH1/EX1.36.f/1_36_f.sce @@ -0,0 +1,16 @@ +//Example 1.36 +//Find whether the given signal is causal or not y(n)=x(n^2). +clear all; +clc; +n=-10:10; +for i=1:length (n) +x(i)=i; +y(i)=(i.^2) ; +end +causal=%t; +for i=1: length (n) +if n(i)<0 &y(i)~=0 then +causal=%f; +end +end +disp(causal,"The statement that the system is causal is:"); diff --git a/3812/CH1/EX1.6.a/1_6_a.sce b/3812/CH1/EX1.6.a/1_6_a.sce new file mode 100644 index 000000000..b5e0b2f63 --- /dev/null +++ b/3812/CH1/EX1.6.a/1_6_a.sce @@ -0,0 +1,14 @@ +//example 1.6 +//draw the waveform of the signal x1(t)=u(t+2) +clc ; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)>=-2 then +x(i)=1; +else +x(i)=0; +end +end +plot2d(t,x); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.6.b/1_6_b.sce b/3812/CH1/EX1.6.b/1_6_b.sce new file mode 100644 index 000000000..6f6f31ac2 --- /dev/null +++ b/3812/CH1/EX1.6.b/1_6_b.sce @@ -0,0 +1,14 @@ +//draw the waveform of the signal x2(t)=u(t-2) +clc; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)>=2 then +x(i)=1; +else +x(i)=0; +end +end +//figure +plot2d(t,x); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.6.c/1_6_c.sce b/3812/CH1/EX1.6.c/1_6_c.sce new file mode 100644 index 000000000..7a7a28e98 --- /dev/null +++ b/3812/CH1/EX1.6.c/1_6_c.sce @@ -0,0 +1,13 @@ +//draw the waveform of the signal x3(t)=u(-t) +clc ; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)<=0 then +x(i)=1; +else +x(i)=0; +end +end +plot2d(t,x); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.6.d/1_6_d.sce b/3812/CH1/EX1.6.d/1_6_d.sce new file mode 100644 index 000000000..40a5cec2a --- /dev/null +++ b/3812/CH1/EX1.6.d/1_6_d.sce @@ -0,0 +1,13 @@ +//draw the waveform of the signal x4(t)=u(-2t+1) +clc ; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)<=1/2 then +x(i)=1; +else +x(i)=0; +end +end +plot2d(t,x); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.6.e/1_6_e.sce b/3812/CH1/EX1.6.e/1_6_e.sce new file mode 100644 index 000000000..4a8b9d889 --- /dev/null +++ b/3812/CH1/EX1.6.e/1_6_e.sce @@ -0,0 +1,14 @@ +clc ; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)<=-1/2 then +x(i)=1; +else +x(i)=0; +end +end +// f i g u r e +f=scf(0); +plot2d(t,x); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.6.f/1_6_f.sce b/3812/CH1/EX1.6.f/1_6_f.sce new file mode 100644 index 000000000..0a221ae08 --- /dev/null +++ b/3812/CH1/EX1.6.f/1_6_f.sce @@ -0,0 +1,16 @@ +//Example 1.6 +//draw the waveform of the signal x6(t)=u(t+2)-u(t-2) +clc ; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)>=-2 & t(i)<=2 then +x(i)=1; +else +x(i)=0; +end +end +//figure +plot2d(t,x); +xtitle('Required figure','t','x(t)') + diff --git a/3812/CH1/EX1.6.g/1_6_g.sce b/3812/CH1/EX1.6.g/1_6_g.sce new file mode 100644 index 000000000..88a8c588f --- /dev/null +++ b/3812/CH1/EX1.6.g/1_6_g.sce @@ -0,0 +1,16 @@ +//Example 1.6// +//draw the waveform of the signal x7(t)=u(t)-2*u(t-1)+u(t-2)// +clc ; +clear all; +t=-10:.001:10 +for i=1:length(t) +if t(i)>=0 & t(i)<=1 then +x(i)=1; +end +if t(i)>=1 & t(i)<=2 then +x(i)=-1 +end +end +//figure +plot2d(t,x); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.7.a/1_7_a.sce b/3812/CH1/EX1.7.a/1_7_a.sce new file mode 100644 index 000000000..edb6f693c --- /dev/null +++ b/3812/CH1/EX1.7.a/1_7_a.sce @@ -0,0 +1,14 @@ +//Example 1.7 +//draw the waveform of the signal x1(t)=r(t-1) +clc; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)>=0 then +x(i)=t(i)+1; +else +x(i)=0; +end +end +plot2d(x,t); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.7.b/1_7_b.sce b/3812/CH1/EX1.7.b/1_7_b.sce new file mode 100644 index 000000000..ddf366f22 --- /dev/null +++ b/3812/CH1/EX1.7.b/1_7_b.sce @@ -0,0 +1,14 @@ +//Example 1.7 +//draw the waveform of the signal x1(t)=r(t+1) +clc; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)>=1 then +x(i)=t(i)-1; +else +x(i)=0; +end +end +plot2d(x,t); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.7.c/1_7_c.sce b/3812/CH1/EX1.7.c/1_7_c.sce new file mode 100644 index 000000000..6431584f8 --- /dev/null +++ b/3812/CH1/EX1.7.c/1_7_c.sce @@ -0,0 +1,15 @@ +//Example 1.7 +//draw the waveform of the signal x1(t)=r(-t) +clc; +clear all; +t=-10:0.001:10; +for i=1:length(t) +if t(i)>=0 then +x(i)=-t(i); +else +x(i)=0; +end +end +//figure +plot2d(x,t); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.7.d/1_7_d.sce b/3812/CH1/EX1.7.d/1_7_d.sce new file mode 100644 index 000000000..36aa82c3b --- /dev/null +++ b/3812/CH1/EX1.7.d/1_7_d.sce @@ -0,0 +1,15 @@ +//Example 1.7 +//draw the waveform of the signal x1(t)=r(3t) +clc; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)>=0 then +x(i)=3*t(i); +else +x(i)=0; +end +end +//figure +plot2d(x,t); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.7.e/1_7_e.sce b/3812/CH1/EX1.7.e/1_7_e.sce new file mode 100644 index 000000000..38db62da2 --- /dev/null +++ b/3812/CH1/EX1.7.e/1_7_e.sce @@ -0,0 +1,15 @@ +//Example 1.7 +//draw the waveform of the signal x1(t)=r(-3t) +clc; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)>=0 then +x(i)=-3*t(i); +else +x(i)=0; +end +end +//figure +plot2d(x,t); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.7.f/1_7_f.sce b/3812/CH1/EX1.7.f/1_7_f.sce new file mode 100644 index 000000000..6dba56f02 --- /dev/null +++ b/3812/CH1/EX1.7.f/1_7_f.sce @@ -0,0 +1,15 @@ +//Example 1.7 +//draw the waveform of the signal x1(t)=r(3t+1) +clc; +clear all; +t=-10:.001:10; +for i=1:length(t) +if t(i)>=-1/3 then +x(i)=3*t(i)-1/3; +else +x(i)=0; +end +end +//figure +plot2d(x,t); +xtitle('Required figure','t','x(t)') diff --git a/3812/CH1/EX1.8.a/1_8_a.sce b/3812/CH1/EX1.8.a/1_8_a.sce new file mode 100644 index 000000000..11d820c65 --- /dev/null +++ b/3812/CH1/EX1.8.a/1_8_a.sce @@ -0,0 +1,14 @@ +//Example 1.8 +//draw the waveform of the signal x1(t)=r(t)-r(t-1)-u(t-1) +clc; +clear all; +t=-10:0.001:10; +for i=1:length(t) +if t(i)>=0 & t(i)<1 then +x(i)=t(i); +else +x(i)=0; +end +end +plot2d(t,x) +xtitle('Required figure','t','x(t)') -- cgit