summaryrefslogtreecommitdiff
path: root/2414/CH3
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2414/CH3
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '2414/CH3')
-rwxr-xr-x2414/CH3/EX3.1/Ex3_1.sce29
-rwxr-xr-x2414/CH3/EX3.2/Ex3_2.sce28
-rwxr-xr-x2414/CH3/EX3.3/Ex3_3.sce29
-rwxr-xr-x2414/CH3/EX3.4/Ex3_4.sce25
-rwxr-xr-x2414/CH3/EX3.5/Ex3_5.sce35
-rwxr-xr-x2414/CH3/EX3.6/Ex3_6.sce25
-rwxr-xr-x2414/CH3/EX3.7/Ex3_7.sce30
-rwxr-xr-x2414/CH3/EX3.8/Ex3_8.sce10
8 files changed, 211 insertions, 0 deletions
diff --git a/2414/CH3/EX3.1/Ex3_1.sce b/2414/CH3/EX3.1/Ex3_1.sce
new file mode 100755
index 000000000..ca01c39f5
--- /dev/null
+++ b/2414/CH3/EX3.1/Ex3_1.sce
@@ -0,0 +1,29 @@
+clc;
+clear all;
+//chapter 3
+//page no 75
+//example 3.1
+A=1 //arbitrary value provided
+T=10 //T represents tau (arbitrary value provided)
+//plot for non periodic pulse
+t=-2*T:.001:2*T;
+vt=[zeros(-2*T:.001:-T/2) A*ones(-T/2+.001:.001:T/2-.001) zeros(T/2:.001:2*T)]
+clf
+subplot(211)
+plot2d(t,vt,[2],rect=[-2*T,0,2*T,A+1])
+xtitle('(a) Non periodic pulse','t','v(t)')
+
+//plot for amplitude spectum
+f=-4/T:.001:4/T;
+Vf=[]
+for i=1:length(f)
+ if f(i)==0 then
+ Vf=[Vf A*T]; //according to L'Hopitals rule sin(x)/x=1 at lim x->0
+ else
+ Vf=[Vf A*T*sin(%pi*f(i)*T)/(%pi*f(i)*T)]
+end
+end
+subplot(212)
+plot2d(f,Vf,[5])
+xtitle('(b) Amplitude spectrum','f','V(f)')
+xgrid
diff --git a/2414/CH3/EX3.2/Ex3_2.sce b/2414/CH3/EX3.2/Ex3_2.sce
new file mode 100755
index 000000000..3cdc027e0
--- /dev/null
+++ b/2414/CH3/EX3.2/Ex3_2.sce
@@ -0,0 +1,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
diff --git a/2414/CH3/EX3.3/Ex3_3.sce b/2414/CH3/EX3.3/Ex3_3.sce
new file mode 100755
index 000000000..029625510
--- /dev/null
+++ b/2414/CH3/EX3.3/Ex3_3.sce
@@ -0,0 +1,29 @@
+clc;
+clear all;
+//chapter 3
+//page no 82
+//example 3.3
+A=20; //Volts
+T=1*10^-3; //second
+function Vf=Fourier_transform(f,T,A)
+ if f==0 then
+ Vf=A*T;
+ else
+ Vf=A*T*sin(%pi*f*T)/(%pi*f*T);
+
+ end
+endfunction
+mprintf('(a)Equation for fourier transform is \n V(f)=%.2f*sin(%.3f*pi*f)/(%.3f*pi*f)',A*T,T,T);
+//Part b Calculation
+f=[0 500 1000 1500];
+for i=1:4
+ Vf(i)=Fourier_transform(f(i),T,A)
+end
+//Part c calculation
+RdB=20*log10(Vf ./ .02)
+//Result Table
+mprintf('\nf(Hz) V(f)in V RdB\n')
+for i=1:4
+ mprintf('%5i %f %f \n',f(i),Vf(i),RdB(i))
+end
+//All values are precise
diff --git a/2414/CH3/EX3.4/Ex3_4.sce b/2414/CH3/EX3.4/Ex3_4.sce
new file mode 100755
index 000000000..f1dfa0b8a
--- /dev/null
+++ b/2414/CH3/EX3.4/Ex3_4.sce
@@ -0,0 +1,25 @@
+clc;
+clear all;
+//chapter 3
+//page no 85
+//example 3.4
+A=20; //Volts
+T=1*10^-3; //seconds
+f=[-3/T:3/T]; //in kHz
+Vf=[]
+for i=1:length(f)
+ if f(i)==0 then
+ Vf=[Vf A*T];
+ else
+ Vf=[Vf A*T*sin(%pi*f(i)*T)/(%pi*f(i)*T)];
+
+end
+end
+clf;
+plot2d(f,Vf,[5])
+a=gca(); // Handle on axes entity
+a.x_location = "origin";
+a.y_location = "origin";
+
+xtitle('Amplitude Spectrum','f,Hz','V(f)');
+xgrid
diff --git a/2414/CH3/EX3.5/Ex3_5.sce b/2414/CH3/EX3.5/Ex3_5.sce
new file mode 100755
index 000000000..bc0bfacc4
--- /dev/null
+++ b/2414/CH3/EX3.5/Ex3_5.sce
@@ -0,0 +1,35 @@
+clc;
+clear all;
+//chapter 3
+//page no 86
+//example 3.5
+A=20; //Volts
+T=5*10^-3; //period in seconds
+tau=1*10^-3; //pulse width in second
+d=tau/T; //duty cycle
+f1=1/T; //Fundamental frequency in Hz
+
+//for plot
+n=[-14:15]; //in Hz
+Vf=[]
+for i=1:length(n)
+ if n(i)==0 then
+ Vf(i*200)=A*d;
+ else
+ Vf(i*200)=A*d*sin(%pi*d*n(i))/(%pi*d*n(i))
+ end
+ //to get the magnitudes of components
+ if Vf(i*200)<0 then
+ Vf(i*200)=-Vf(i*200)
+ end
+
+end
+f=-3000:3000-1
+clf;
+plot2d(f,Vf,[5],rect=[-3000,0,3000,5])
+a=gca(); // Handle on axes entity
+a.x_location = "origin";
+a.y_location = "origin";
+
+xtitle('Amplitude Spectrum','f,Hz','Vn');
+xgrid
diff --git a/2414/CH3/EX3.6/Ex3_6.sce b/2414/CH3/EX3.6/Ex3_6.sce
new file mode 100755
index 000000000..919be2b0c
--- /dev/null
+++ b/2414/CH3/EX3.6/Ex3_6.sce
@@ -0,0 +1,25 @@
+clc;
+clear all;
+//chapter 3
+//page no 89
+//example 3.6
+A=1 //arbitrary value provided
+Tau=10^-3 //in seconds
+fc=30*10^6; //centre frequency in Hz
+//plot for amplitude spectum
+f=-3/Tau:3/Tau;
+Vf=[]
+for i=1:length(f)
+ if f(i)==0 then
+ Vf=[Vf A*Tau]; //according to L'Hopitals rule sin(x)/x=1 at lim x->0
+ else
+ Vf=[Vf A*Tau*sin(%pi*f(i)*Tau)/(%pi*f(i)*Tau)]
+end
+end
+f=f+fc //shifting
+f=f.*10^-6 //MHz
+clf
+plot2d(f,Vf,[5])
+
+xtitle('Amplitude spectrum','f,MHz','Vrf(f)')
+xgrid
diff --git a/2414/CH3/EX3.7/Ex3_7.sce b/2414/CH3/EX3.7/Ex3_7.sce
new file mode 100755
index 000000000..9a827eaa8
--- /dev/null
+++ b/2414/CH3/EX3.7/Ex3_7.sce
@@ -0,0 +1,30 @@
+clc;
+clear all;
+//chapter 3
+//page no 89
+//example 3.7
+A=1; //arbitrary vaule
+T=(1+4)*10^-3; //period in seconds
+tau=1*10^-3; //pulse width in second
+fc=30*10^6; //centre frequency in Hz
+d=tau/T; //duty cycle
+f1=1/T; //Fundamental frequency in Hz
+
+//for plot
+n=[-14:15]; //in Hz
+Vf=[]
+for i=1:length(n)
+ if n(i)==0 then
+ Vf(i*200)=A*d;
+ else
+ Vf(i*200)=A*d*sin(%pi*d*n(i))/(%pi*d*n(i))
+ end
+
+end
+f=-3000:3000-1
+f=f+fc; //Shifting by fc
+f=f*10^-6; //in MHz
+clf;
+plot2d(f,Vf,[5])
+xtitle('Amplitude Spectrum','f,MHz','Vn');
+xgrid
diff --git a/2414/CH3/EX3.8/Ex3_8.sce b/2414/CH3/EX3.8/Ex3_8.sce
new file mode 100755
index 000000000..6858826b3
--- /dev/null
+++ b/2414/CH3/EX3.8/Ex3_8.sce
@@ -0,0 +1,10 @@
+clc;
+clear all;
+//chapter 3
+//page no 90
+//example 3.8
+mprintf('(a) The RF burst frequency is 500 MHz\n');
+mprintf(' (b) The pulse repetition rate is 1 MHz\n');
+f0=10*10^6; //Zero crossing frequency in Hz
+tau=1/f0; //in second
+mprintf(' (c) The pulse width is %.1f micro second\n',tau*10^6);