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
5 'OMMON EX$
10 'TVCHAN - Harmonic Frequencies - 16 MAY 96 rev.17 JUN 97
20 IF EX$=""THEN EX$="EXIT"
30 
40 CLS:KEY OFF
50 COLOR 7,0,1
60 UL$=STRING$(80,205)
70 U1$="##"
80 U2$="##########.###"
90 U3$="######,###.###"
100 X$=STRING$(80,32)
110 DIM C(69,4)    'TV channels
120 DIM F(15,2)    'amateur bands
130 DATA      1.800,2.000,        3.500,4.000,         7.000,7.300
140 DATA      10.100,10.150,      14.000,14.350,       18.086,18.168
150 DATA      21.000,21.450,      24.890,24.990,       28.000,29.700
160 DATA      50.000,54.000,      144.000,148.000,     220.000,225.000
170 DATA      420.000,450.000,    902.000,928.000,     1240,1300
180  FOR Z=1 TO 15:FOR Y=1 TO 2
190  READ F(Z,Y)
200  NEXT Y:NEXT Z
210 '
220 COLOR 15,2
230 PRINT " TV CHANNELS ( North America )";TAB(57);;"by George Murphy VE3ERP ";
240 COLOR 1,0:PRINT STRING$(80,223);
250 COLOR 7,0
260 '
270 '.....start
280 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
290 FLAG=0
300 GOSUB 1550   'preface
310 PRINT UL$;
320 COLOR 0,7:LOCATE ,24
330 PRINT " Press 1 to continue or 0 to EXIT "
340 COLOR 7,0
350 Z$=INKEY$:IF Z$=""THEN 350
360 IF Z$="0"THEN CLS:RUN EX$
370 IF Z$="1"THEN 400
380 GOTO 350
390 '
400 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
410 SCAN=0
420 PRINT " Press number in < > to:";
430 PRINT UL$;
440 PRINT "   <2> Display frequencies for a specific TV channel"
450 PRINT "   <3> Scan all TV channels for ham band harmonics"
460 PRINT "   <4> Display TVI harmonics of any signal"
470 Z$=INKEY$:IF Z$=""THEN 470
480 IF Z$="2"THEN ALL=0:GOTO 530
490 IF Z$="3"THEN ALL=1:GOTO 570
500 IF Z$="4"THEN 1180
510 GOTO 470
520 '
530 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
540 INPUT " ENTER: T.V.Channel Number ( 2-69 ).........";CH
550 IF CH<2 OR CH>69 THEN BEEP:GOTO 530
560 '
570 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
580 PRINT TAB(12);"Channel";TAB(32);;"Bandwidth";TAB(55);;"Video";TAB(69);;"Audio"
590 PRINT TAB(14);"No.";TAB(28);;"MHz    to     MHz";TAB(56);;"MHz";TAB(70);;"MHz"
600 PRINT UL$;
610 IF ALL=0 THEN 650
620    FOR SCAN=2 TO 69
630    CH=SCAN:GOTO 650
640 '
650 VIEW PRINT 6 TO 24:CLS:VIEW PRINT:LOCATE 6
660 CH=INT(CH)
670 N=48
680   FOR Z=2 TO 69
690 IF Z=5 THEN N=70
700 IF Z=7 THEN N=168
710 IF Z=14 THEN N=464
720 N=N+6
730 C(Z,1)=N
740 C(Z,2)=N+6
750 C(Z,3)=N+1.250000
760 C(Z,4)=N+5.750000
770   NEXT Z
780 '
790 '.....screen print
800 K$=" UHF":IF CH<14 THEN K$=" VHF"
810 COLOR 0,7:LOCATE ,11:PRINT K$;USING "### ";CH;
820 FOR Z=1 TO 4:PRINT USING U2$;C(CH,Z);:NEXT Z
830 COLOR 7,0
840 PRINT UL$;
850 COLOR 0,7
860 LOCATE CSRLIN-1,22:PRINT " The frequencies shown above are the: "
870 COLOR 7,0
880 '
890 '......harmonics
900 FOR J=1 TO 4:HH(J)=C(CH,J):NEXT J
910 FLAG=0
920   FOR Z=2 TO 15
930 N$="th "
940 IF Z=2 THEN N$="nd "
950 IF Z=3 THEN N$="rd "
960 FOR Y=1 TO 4:H(Y)=HH(Y)/Z:NEXT Y
970 PRINT USING "###";Z;:PRINT N$;"harmonic of";TAB(19);
980 FOR X=1 TO 4:Y=H(X):GOSUB 1120:PRINT USING U2$;Y;:COLOR 7,0:NEXT X
990 PRINT ""
1000   NEXT Z
1010 IF FLAG=0 THEN 1060
1020 PRINT UL$;
1030 COLOR 15,1:LOCATE ,15
1040 PRINT " Highlighted frequencies are in amateur radio bands "
1050 COLOR 7,0
1060 IF ALL=0 THEN 1780
1070 IF SCAN=69 THEN 1780
1080 IF FLAG=1 THEN GOSUB 1830
1090 NEXT SCAN
1100 END
1110 '
1120 '.....amateur bands
1130 FOR B=1 TO 15
1140 IF Y>=F(B,1)AND Y<=F(B,2)THEN COLOR 15,1:FLAG=1
1150 NEXT B
1160 RETURN
1170 '
1180 '.....TVI harmonics
1190 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
1200 INPUT " ENTER: Frequency in MHz of transmitted signal.....";FX
1210 LOCATE CSRLIN-1:PRINT X$;:LOCATE CSRLIN-1
1220 PRINT TAB(8);"Harmonic";TAB(33);;"MHz";TAB(45);;"TV CHannel ?"
1230 PRINT UL$;
1240 COLOR 0,7
1250 PRINT " TRANSMITTED SIGNAL...";USING U3$;FX;:PRINT " "
1260 COLOR 7,0
1270 FOR Z=2 TO 19
1280 F=FX*Z
1290 N$="th "
1300 IF Z=2 THEN N$="nd "
1310 IF Z=3 THEN N$="rd "
1320 PRINT USING " ##";Z;:PRINT N$;" harmonic.......";
1330 PRINT USING U3$;F;
1340 GOSUB 1380
1350 NEXT Z
1360 GOTO 1780    'end
1370 '
1380  IF F=54 THEN H=2:GOTO 1520
1390 IF F>54 AND F<72 THEN K=7:GOTO 1510
1400  IF F=72 THEN H=4:GOTO 1520
1410  IF F=76 THEN H=5:GOTO 1520
1420 IF F>76 AND F<88 THEN K=7.666666:GOTO 1510
1430  IF F=88 THEN H=6:GOTO 1520
1440  IF F=174 THEN H=7:GOTO 1520
1450 IF F>174 AND F<216 THEN K=22:GOTO 1510
1460  IF F=216 THEN H=13:GOTO 1520
1470  IF F=470 THEN H=14:GOTO 1520
1480 IF F>470 AND F<806 THEN K=6.433332E+01:GOTO 1510
1490  IF F=806 THEN H=69:GOTO 1520
1500 LOCATE ,48:PRINT "- no -";:GOTO 1530
1510 H=INT(F/6-K)
1520 COLOR 0,7:LOCATE ,45:PRINT " Channel";H:COLOR 7,0
1530 RETURN
1540 '
1550 '.....preface
1560 T=9
1570 PRINT TAB(T);
1580 PRINT "In North America the following frequencies are reserved for"
1590 PRINT TAB(T);
1600 PRINT "commercial television broadcasting:"
1610 PRINT
1620 PRINT "                  54 MHz -  72 Mhz     VHF Channels  2 - 4"
1630 PRINT "                  76 MHz -  88 Mhz     VHF Channels  5 - 6"
1640 PRINT "                 174 MHz - 216 Mhz     VHF Channels  7 - 13"
1650 PRINT "                 470 MHz - 806 Mhz     UHF Channels 14 - 69"
1660 PRINT
1670 PRINT TAB(T);
1680 PRINT "This program lists the frequencies used by each channel, plus "
1690 PRINT TAB(T);
1700 PRINT "lower frequencies whose harmonics fall within the TV spectrum."
1710 PRINT
1720 PRINT TAB(T);
1730 PRINT "Where such frequencies are within any of the amateur radio bands,"
1740 PRINT TAB(T);
1750 PRINT "these frequencies are highlighted."
1760 RETURN
1770 '
1780 '.....end
1790 GOSUB 1830
1800 GOTO 270
1810 END
1820 '
1830 '.....PRT
1840 KEY OFF:GOSUB 1910:LOCATE 25,5:COLOR 0,2
1850 PRINT " Send this page to:(1)Printer Queue? (2)Printout? ";
1860 PRINT "(3)Next page? (1/2/3)";:COLOR 7,0
1870 Z$=INKEY$:IF Z$<"1"OR Z$>"3"THEN 1870 ELSE GOSUB 1910
1880 IF Z$="3"THEN RETURN
1890 FOR I%=1 TO 24:FOR J%=1 TO 80:LPRINT CHR$(SCREEN(I%,J%));:NEXT J%:NEXT I%
1900 IF Z$="2"THEN LPRINT CHR$(12) ELSE 1840
1910 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
