sometimes I need to estimate the losses along the coax cables in my lab. Mostly I'm using RG-58 and RG-213 for 'longer' distances and seldom RG-142 with teflon coat for HF common mode chokes or other temperature critical applications. In the latter cases the cable length is quite short and therefore there's no need to take the cable attenuation into account.

Thus I wrote a program for the attenuation calculation for RG-58 and RG-213 cables. When I find some time I'll add more cables in the future. But at the moment there's no practical benefit for me doing that.

The program is using the following approximation:

D / 100m * l = k1 + k2 * f + k3 * sqrt(f)

with the Damping D in dB, the cable length l in m and the frequency f in Hz. In the given implementation for each of the variables can be solved.

The first term on the right side of the equation stands for the damping by the DC resistance, the second takes the dielectric losses into account and the third describes the influence of the skin effect.

The parameters k1, k2 and k3 are estimated from table data by using the least square method. The table data was taken from https://www.w4rp.com/ref/coax.html.

The approximation is tending to overestimate the damping for lower frequencies in the short wave area compared to the table data. For higher frequencies it's getting more and more precise resp. it's closer to the table values. I'm not sure wether it is because of the approximation approach or the data used for the least square estimation of the equation parameters. Anyway, the 'error' is within the variation of different tables with damping measurements you find inside the web.

The python code for the computation of the parameters k1, k2 and k3 you'll find in my repo https://github.com/Kibabalu/free42.

Code: Select all

```
@ Coax Cable Attenuation
@
@ f Frequency in Hz
@ l cable length in m
@ D attenuation in dB
@
@ D * 100m / l = beta1 + beta2 * f + beta3 * sqrt(f)
@
@ cable data from https://www.w4rp.com/ref/coax.html
@
@ table for least square computation:
@ 1 f sqrt(f) D_RG-58 D_RG-213
@
@ 1 1ᴇ6 1ᴇ3 1.3123 0.65617
@ 1 10ᴇ6 3.1623ᴇ3 4.5932 1.9685
@ 1 50ᴇ6 7.0711ᴇ3 10.827 5.2493
@ 1 100ᴇ6 10ᴇ3 16.076 7.2178
@ 1 200ᴇ6 14.142ᴇ3 23,95 10,827
@ 1 400ᴇ6 20ᴇ3 36.745 15.748
@ 1 700ᴇ6 26.458ᴇ3 55.446 21,654
@ 1 900ᴇ6 30ᴇ3 65.945 25.262
@ 1 1ᴇ9 31.623ᴇ3 70.538 27.231
@
@ example python code for the computation of the beta1, beta2 and beta3 for RG-58 (for the others ist is similar):
@ import numpy as np
@ X = np.matrix('1 1ᴇ6 1ᴇ3; 1 10ᴇ6 3.1623; 1 50ᴇ6 7.0711ᴇ3; 1 100ᴇ6 10ᴇ3; 1 200ᴇ6 14.142ᴇ3; 1 400ᴇ6 20ᴇ3; 1 700ᴇ6 26.458ᴇ3; 1 900ᴇ6 30ᴇ3; 1 1e9 31.623e3')
@ y = np.matrix('1.3123; 4.5932; 10.827; 16.076; 23.95; 36.745; 55.446; 65.945; 70.538')
@ beta = np.linalg.lstsq(X, y, rcond=None)[0]
@
@ Frank Kirschbaum, frank.kirschbaumr@gmail.com
@ 2021-05-16: Initial version
@
00 { 322-Byte Prgm }
01 LBL "CoaxD"
02 CLMENU
03 "RG58" @ main Menu: choice cable type (RG58 and RG213 so far)
04 KEY 1 XEQ "RG58"
05 "RG213"
06 KEY 2 XEQ "RG213"
07 MENU
08 STOP
09 LBL "RG58" @ routine for RG-58 cable
10 MVAR "f"
11 MVAR "l"
12 MVAR "D"
13 VARMENU "RG58"
14 CF 21 @ continue program execution after a VIEW instruction
15 STOP
16 ASTO "CONTROL" @ store the name of the unknown variable in CONTROL
17 PGMSLV ".RG58" @ specify solver routine
18 SOLVE IND "CONTROL" @ Indirectly specify the variable to be solved
19 VIEW IND "CONTROL" @ View the solution
20 GTO "RG58" @ return to start
21 LBL ".RG58" @ function to be solved for RG-58
22 2.30215057 @ k1
23 ENTER
24 3.78507622ᴇ-8 @ k2
25 RCL× "f"
26 +
27 RCL "f"
28 SQRT
29 9.80038603ᴇ-4 @ k3
30 ×
31 +
32 100
33 ÷
34 RCL× "l"
35 RCL- "D"
36 RTN
37 LBL "RG213" @ Routine for RG-213 cable
38 MVAR "f"
39 MVAR "l"
40 MVAR "D"
41 VARMENU "RG213"
42 CF 21 @ continue program execution after a VIEW instruction
43 STOP
44 ASTO "CONTROL" @ store the name of the unknown variable in CONTROL
45 PGMSLV ".RG213" @ specify solver routine
46 SOLVE IND "CONTROL" @ Indirectly specify the variable to be solved
47 VIEW IND "CONTROL" @ View the solution
48 GTO "RG213" @ return to start
49 LBL ".RG213" @ function to be solved for RG-213
50 9.95992882ᴇ-1 @ k1
51 ENTER
52 8.62826348ᴇ-9 @ k2
53 RCL× "f"
54 +
55 RCL "f"
56 SQRT
57 5.54894937ᴇ-4 @ k3
58 ×
59 +
60 100
61 ÷
62 RCL× "l"
63 RCL- "D"
64 RTN
65 END
```