From f35ea80659b6a49d1bb2ce1d7d002583f3f40947 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:38:01 +0530 Subject: updated the code --- 61/CH6/EX6.12/ex6_12.sce | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to '61/CH6') diff --git a/61/CH6/EX6.12/ex6_12.sce b/61/CH6/EX6.12/ex6_12.sce index f374cccca..c4bdb477f 100755 --- a/61/CH6/EX6.12/ex6_12.sce +++ b/61/CH6/EX6.12/ex6_12.sce @@ -1,11 +1,16 @@ -//ex6.12 -A_v1=10; -A_v2=15; -A_v3=20; -A_v=A_v1*A_v2*A_v3; //overall voltage gain -disp(A_v,'overall voltage gain') -A_v1_dB=gain_in_decibel_voltage(A_v1); -A_v2_dB=gain_in_decibel_voltage(A_v2); -A_v3_dB=gain_in_decibel_voltage(A_v3); -A_v_dB=A_v1_dB+A_v2_dB+A_v3_dB; +//ex6.12 +clc +clear +function A_v_dB=gain_in_decibel_voltage(A_v) + A_v_dB=20*log10(A_v) +endfunction +A_v1=10; +A_v2=15; +A_v3=20; +A_v=A_v1*A_v2*A_v3; //overall voltage gain +disp(A_v,'overall voltage gain') +A_v1_dB=gain_in_decibel_voltage(A_v1); +A_v2_dB=gain_in_decibel_voltage(A_v2); +A_v3_dB=gain_in_decibel_voltage(A_v3); +A_v_dB=A_v1_dB+A_v2_dB+A_v3_dB; disp(A_v_dB,'total voltage gain in decibels') \ No newline at end of file -- cgit