summaryrefslogtreecommitdiff
path: root/61/CH10/EX10.1
diff options
context:
space:
mode:
Diffstat (limited to '61/CH10/EX10.1')
-rwxr-xr-x61/CH10/EX10.1/ex10_1.sce29
1 files changed, 17 insertions, 12 deletions
diff --git a/61/CH10/EX10.1/ex10_1.sce b/61/CH10/EX10.1/ex10_1.sce
index 34bdf2a4e..58371bc89 100755
--- a/61/CH10/EX10.1/ex10_1.sce
+++ b/61/CH10/EX10.1/ex10_1.sce
@@ -1,12 +1,17 @@
-//ex10.1
-//P out/P in=250;
-A_p_dB=gain_in_decibel_power(250)
-disp(A_p_dB,'Power gain when power gain is 250')
-A_p_dB=gain_in_decibel_power(100)
-disp(A_p_dB,'Power gain when power gain is 100')
-A_v_dB=gain_in_decibel_voltage(10)
-disp(A_v_dB,'Voltage gain when voltage gain is 10')
-A_v_dB=gain_in_decibel_power(0.5)
-disp(A_v_dB,'Power gain when voltage gain is 0.5')
-A_v_dB=gain_in_decibel_voltage(0.707)
-disp(A_v_dB,'Voltage gain when voltage gain is 0.707')
+function A_p_dB=gain_in_decibel_power(A_p)
+ A_p_dB=10*log10(A_p)
+endfunction
+function A_v_dB=gain_in_decibel_voltage(A_v)
+ A_v_dB=20*log10(A_v)
+endfunction//ex10.1
+//P out/P in=250;
+A_p_dB=gain_in_decibel_power(250)
+disp(A_p_dB,'Power gain when power gain is 250')
+A_p_dB=gain_in_decibel_power(100)
+disp(A_p_dB,'Power gain when power gain is 100')
+A_v_dB=gain_in_decibel_voltage(10)
+disp(A_v_dB,'Voltage gain when voltage gain is 10')
+A_v_dB=gain_in_decibel_power(0.5)
+disp(A_v_dB,'Power gain when voltage gain is 0.5')
+A_v_dB=gain_in_decibel_voltage(0.707)
+disp(A_v_dB,'Voltage gain when voltage gain is 0.707') \ No newline at end of file