1 COMMON A, AL, B, BASEONLY, C, C$, C1, CAT$, CC, CKT$, D, D$, DD, DIA, DIMN$, DMS, E, EO, EX$, F, F$, FD, FF, FQ, FRQ, G$, GO$, I, I$, L, LATLONG, LD, LL, LN, LS, LW, LX, MAX, MENU, MIN, MX, N, NN, NT, OV, P, PI, PROG$, Q, QQ, QU, R, RA, RC, T, T$, U, U$, UH, UL$, V$, VC, W, WHIP, WIRD, WW, X, X$, X1, XS, Z$, ZP, ZS
10 'L-PAD  21 APR 86 rev.12 APR 97
20 IF EX$=""THEN EX$="EXIT"
30 CLS:KEY OFF
40 COLOR 7,0,1
50 UL$=STRING$(80,205)
60 U$="####,###.#"
70 '
80 '.....start
90 CLS:Z1=0:Z2=0:R1=0:R2=0:L=0
100 COLOR 15,2
110 PRINT " L-PAD IMPEDANCE MATCHING CIRCUIT";
120 PRINT TAB(57);;"by George Murphy VE3ERP ";
130 COLOR 1,0:PRINT STRING$(80,223);
140 COLOR 7,0
150 RO=CSRLIN:CO=2:GOSUB 530 'diagram
160 COLOR 0,7:LOCATE CSRLIN,22
170 PRINT " Press 1 to continue or 0 to EXIT....."
180 COLOR 7,0
190 Z$=INKEY$:IF Z$=""THEN 190
200 IF Z$="0"THEN CLS:RUN EX$
210 IF Z$="1"THEN 230
220 GOTO 190
230 LOCATE CSRLIN-1:PRINT STRING$(80,32);:LOCATE CSRLIN-1
240 INPUT " ENTER: INPUT impedance in ohms.................";Z1
250 INPUT " ENTER: OUTPUT impedance in ohms................";Z2
260 '
270 '.....calculation
280 IF Z1<Z2 THEN X=1:SWAP Z1,Z2
290 R1=Z1*SQR(1-(Z2/Z1))
300 R2=Z2/SQR(1-(Z2/Z1))
310 M=SQR(Z1/Z2)+SQR((Z1/Z2)-1)
320 LF=1/LOG(10)       'log factor to convert natural log to log base 10
330 F1=LF*LOG(M)
340 L=20*F1            'loss in dB
350 IF X THEN X=0:SWAP Z1,Z2
360 VIEW PRINT 3 TO 23:CLS:VIEW PRINT
370 GOSUB 530
380 COLOR 0,7
390 IF Z1>Z2 THEN LOCATE RO,CO+ 3:PRINT " R1 "
400 IF Z2>Z1 THEN LOCATE RO,CO+12:PRINT " R1 "
410 COLOR 7,0
420 LOCATE RO+6
430 PRINT " Z in .....";USING U$;Z1;:PRINT " ê"
440 PRINT " Z out ....";USING U$;Z2;:PRINT " ê"
450 PRINT " R1 .......";USING U$;R1;:PRINT " ê"
460 PRINT " R2 .......";USING U$;R2;:PRINT " ê"
470 PRINT " Loss .....";USING U$;L;:PRINT " dB"
480 PRINT UL$;
490 LN=14
500 GOSUB 640
510 GOTO 80   'start
520 '
530 '.....diagram
540 COLOR 0,7
550 LOCATE RO+0,CO:PRINT " ÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ "
560 LOCATE RO+1,CO:PRINT "         ³         "
570 LOCATE RO+2,CO:PRINT " Z in   R2   Z out "
580 LOCATE RO+3,CO:PRINT "         ³         "
590 LOCATE RO+4,CO:PRINT " ÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄ "
600 COLOR 7,0
610 PRINT UL$;
620 RETURN
630 '
640 'PRT
650 KEY OFF:GOSUB 720:LOCATE 25,5:COLOR 0,2
660 PRINT " Send this page to:(1)Printer Queue? (2)Printout? ";
670 PRINT "(3)Next page? (1/2/3)";:COLOR 7,0
680 Z$=INKEY$:IF Z$<"1"OR Z$>"3"THEN 680 ELSE GOSUB 720
690 IF Z$="3"THEN RETURN
700 FOR I%=1 TO 24:FOR J%=1 TO 80:LPRINT CHR$(SCREEN(I%,J%));:NEXT J%:NEXT I%
710 IF Z$="2"THEN LPRINT CHR$(12) ELSE 650
720 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
