summaryrefslogtreecommitdiff
path: root/3809/CH8
diff options
context:
space:
mode:
Diffstat (limited to '3809/CH8')
-rw-r--r--3809/CH8/EX8.1/EX8_1.sce17
-rw-r--r--3809/CH8/EX8.2/EX8_2.sce9
-rw-r--r--3809/CH8/EX8.3/EX8_3.sce36
-rw-r--r--3809/CH8/EX8.4/EX8_4.sce34
-rw-r--r--3809/CH8/EX8.5/EX8_5.sce16
-rw-r--r--3809/CH8/EX8.6/EX8_6.sce26
-rw-r--r--3809/CH8/EX8.7/EX8_7.sce16
-rw-r--r--3809/CH8/EX8.8/EX8_8.sce16
-rw-r--r--3809/CH8/EX8.9/EX8_9.sce17
9 files changed, 187 insertions, 0 deletions
diff --git a/3809/CH8/EX8.1/EX8_1.sce b/3809/CH8/EX8.1/EX8_1.sce
new file mode 100644
index 000000000..e98301c90
--- /dev/null
+++ b/3809/CH8/EX8.1/EX8_1.sce
@@ -0,0 +1,17 @@
+//Chapter 8, Example 8.1
+clc
+//Initialisation
+vi=10 //input voltage
+vo=3 //output voltage
+ii=2*10**-3 //input current in ampere
+io=5*10**-3 //output current in ampere
+
+//Calculation
+av=vo/vi //voltage gain
+ai=io/ii //current gain
+ap=(vo*io)/(vi*ii) //power gain
+
+//Result
+printf("Voltage Gain, Av = %.1f\n",av)
+printf("Current Gain, Ai = %.1f\n",ai)
+printf("Power Gain, Ap = %.2f\n",ap)
diff --git a/3809/CH8/EX8.2/EX8_2.sce b/3809/CH8/EX8.2/EX8_2.sce
new file mode 100644
index 000000000..605ff6e2b
--- /dev/null
+++ b/3809/CH8/EX8.2/EX8_2.sce
@@ -0,0 +1,9 @@
+//Chapter 8, Example 8.2
+clc
+//Initialisation
+p=2500 //power gain
+
+//Calculation
+pdb=10*log10(p) //power gain
+//Result
+printf("Power Gain (dB) = %.1f dB\n",pdb)
diff --git a/3809/CH8/EX8.3/EX8_3.sce b/3809/CH8/EX8.3/EX8_3.sce
new file mode 100644
index 000000000..8dc730f3c
--- /dev/null
+++ b/3809/CH8/EX8.3/EX8_3.sce
@@ -0,0 +1,36 @@
+//Chapter 8, Example 8.3
+clc
+funcprot()
+//Initialisation
+p1=5 //power gain
+p2=50 //power gain
+p3=500 //power gain
+v1=5 //voltage gain
+v2=50 //voltage gain
+v3=500 //voltage gain
+
+
+//initialising a function for gain in dB
+function [x]=pgain(a)
+ x=10*log10(a)
+endfunction
+
+function [x]=vgain(a)
+ x=20*log10(a)
+endfunction
+
+//calling a functions
+[pd1]=pgain(p1)
+[pd2]=pgain(p2)
+[pd3]=pgain(p3)
+[vd1]=vgain(v1)
+[vd2]=vgain(v2)
+[vd3]=vgain(v3)
+
+//Result
+printf("Power Gain (dB) of 5 = %.1f dB\n",pd1)
+printf("Power Gain (dB) of 50 = %.1f dB\n",pd2)
+printf("Power Gain (dB) of 500 = %.1f dB\n",pd3)
+printf("Voltage Gain (dB) of 5 = %.1f dB\n",vd1)
+printf("Voltage Gain (dB) of 50 = %.1f dB\n",vd2)
+printf("Voltage Gain (dB) of 500 = %.1f dB\n",vd3)
diff --git a/3809/CH8/EX8.4/EX8_4.sce b/3809/CH8/EX8.4/EX8_4.sce
new file mode 100644
index 000000000..76dcbc22a
--- /dev/null
+++ b/3809/CH8/EX8.4/EX8_4.sce
@@ -0,0 +1,34 @@
+//Chapter 8, Example 8.4
+funcprot()
+clc
+//Initialisation
+p1=20 //gain
+p2=30 //gain
+p3=40 //gain
+
+
+
+//initialising a function for gain
+function [x]=pgain(a) //function for power gain
+ x=10**(a/10)
+endfunction
+
+function [x]=vgain(a) //function for voltage gain
+ x=10**(a/20)
+endfunction
+
+//calling a functions
+[pd1]=pgain(p1)
+[pd2]=pgain(p2)
+[pd3]=pgain(p3)
+[vd1]=vgain(p1)
+[vd2]=vgain(p2)
+[vd3]=vgain(p3)
+
+//Result
+printf("Power Gain (dB) of 20 = %.1f dB\n",pd1)
+printf("Voltage Gain (dB) of 30 = %.1f dB\n\n",vd1)
+printf("Power Gain (dB) of 40 = %.1f dB\n",pd2)
+printf("Voltage Gain (dB) of 20 = %.1f dB\n\n",vd2)
+printf("Power Gain (dB) of 30 = %.1f dB\n",pd3)
+printf("Voltage Gain (dB) of 40 = %.1f dB\n",vd3)
diff --git a/3809/CH8/EX8.5/EX8_5.sce b/3809/CH8/EX8.5/EX8_5.sce
new file mode 100644
index 000000000..f843a3a1c
--- /dev/null
+++ b/3809/CH8/EX8.5/EX8_5.sce
@@ -0,0 +1,16 @@
+//Chapter 8, Example 8.5
+clc
+//Initialisation
+c=10*10**-6 //capacitance in farad
+r=10**3 //resistance in ohm
+pi=3.14 //pi
+
+//Calculation
+t=c*r //time constant
+wc=1/t //angular frequency
+f=wc/(2*pi) //cyclic frequency
+
+//Result
+printf("Time Constant, T = %.2f s\n",t)
+printf("Angular Cut-off Frequency, F = %d rad/s \n",wc)
+printf("Cyclic Cut-off Frequency, Fc = %.1f Hz\n",f)
diff --git a/3809/CH8/EX8.6/EX8_6.sce b/3809/CH8/EX8.6/EX8_6.sce
new file mode 100644
index 000000000..a250a99c3
--- /dev/null
+++ b/3809/CH8/EX8.6/EX8_6.sce
@@ -0,0 +1,26 @@
+//Chapter 8, Example 8.6
+clc
+//Initialisation
+f1=1000 //frequency in hertz
+f2=10 //frequency in hertz
+f3=100 //frequency in hertz
+f4=20 //frequency in hertz
+f5=10**6 //frequency in hertz
+f6=50 //frequency in hertz
+
+//Calculation
+f11=f1*2 //an octave above 1 kHz
+f22=f2*2*2*2 //three octaves above 10 Hz
+f33=f3/2 //an octave below 100 Hz
+f44=f4*10 //a decade above 20 Hz
+f55=f5/10/10/10 //three decades below 1 MHz
+f66=f6*10*10 //two decades above 50 Hz
+
+
+//Result
+printf("(a) an octave above 1 kHz = %d kHz \n",f11/1000)
+printf("(b) three octaves above 10 Hz = %d Hz \n",f22)
+printf("(c) an octave below 100 Hz = %d Hz \n",f33)
+printf("(d) a decade above 20 Hz = %d Hz \n",f44)
+printf("(e) three decades below 1 MHz = %d kHz \n",f55/1000)
+printf("(f) two decades above 50 Hz = %d kHz \n",f66)
diff --git a/3809/CH8/EX8.7/EX8_7.sce b/3809/CH8/EX8.7/EX8_7.sce
new file mode 100644
index 000000000..16a45e5c4
--- /dev/null
+++ b/3809/CH8/EX8.7/EX8_7.sce
@@ -0,0 +1,16 @@
+//Chapter 8, Example 8.7
+clc
+//Initialisation
+c=10*10**-6 //capacitance in farad
+r=10**3 //resistance in ohm
+pi=3.14 //pi
+
+//Calculation
+t=c*r //time constant
+wc=1/t //angular frequency
+f=wc/(2*pi) //cyclic frequency
+
+//Result
+printf("Time Constant, T = %.2f s\n",t)
+printf("Angular Cut-off Frequency, F = %d rad/s \n",wc)
+printf("Cyclic Cut-off Frequency, Fc = %.1f Hz\n",f)
diff --git a/3809/CH8/EX8.8/EX8_8.sce b/3809/CH8/EX8.8/EX8_8.sce
new file mode 100644
index 000000000..702cff0ab
--- /dev/null
+++ b/3809/CH8/EX8.8/EX8_8.sce
@@ -0,0 +1,16 @@
+//Chapter 8, Example 8.8
+clc
+//Initialisation
+l=10*10**-3 //inductance in henry
+r=100 //resistance in ohm
+pi=3.14 //pi
+
+//Calculation
+t=l/r //time constant
+wc=1/t //angular frequency
+f=wc/(2*pi) //cyclic frequency
+
+//Result
+printf("Time Constant, T = %d ^-4 s\n",t*10**5)
+printf("Angular Cut-off Frequency, F = %d ^4 rad/s \n",wc/10**3)
+printf("Cyclic Cut-off Frequency, Fc = %.2f kHz\n",f/1000)
diff --git a/3809/CH8/EX8.9/EX8_9.sce b/3809/CH8/EX8.9/EX8_9.sce
new file mode 100644
index 000000000..7d836b5ec
--- /dev/null
+++ b/3809/CH8/EX8.9/EX8_9.sce
@@ -0,0 +1,17 @@
+//Chapter 8, Example 8.9
+clc
+//Initialisation
+l=15*10**-3 //inductance in henry
+c=30*10**-6 //capacitance in farad
+r=5 //resistance in ohm
+pi=3.14 //pi
+
+//Calculation
+fo=1/(2*pi*sqrt(l*c)) //Resonant Frequency
+q=(1/r)*sqrt(l/c) //Quality Factor
+b=r/(2*pi*l) //Bandwidth
+
+//Result
+printf("Resonant Frequency, Fo = %d Hz \n",fo)
+printf("Quality Factor, Q = %.2f\n",q)
+printf("Bandwidth, B = %d Hz\n",b)