summaryrefslogtreecommitdiff
path: root/3753/CH5/EX5.14/Ex5_14.sce
blob: 9cf1347f87bba2ef00f48e51b8789c089e66acf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//Example 5.14, Page number 5.32
 
clc;clear;close

// variable declaration
P_i=100 // input 
P_o=2 // output
L=10 // in km

// Calculations
S=(10/L)*log(P_i/P_o) // dB/km
O=S*L // dB

// Result
printf("a)Signal attention per unit length = %.1f dB-km^-1",S)
printf("\nb)Overall signal attenuation = %.f dB",O)
// Answer given in the textbook is wrong