home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1
/
HamRadio.cdr
/
ant
/
antenna
/
friis.bas
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
3KB
|
85 lines
10 REM THIS PROGRAM DOES THE FRIIS POWER TRANSMISSION FORMULA
20 REM "ANTENNA DESIGN USING PERSONAL COMPUTERS"
30 KEY OFF
40 PI=3.141593
50 DEF FNLOG10(X)=.4343*LOG(X)
60 CLS
70 COLOR 1,0
80 PRINT "THIS PROGRAM COMPUTES THE FRIIS POWER TRANSMISSION FORMULA"
90 COLOR 4,0
100 PRINT
110 INPUT "WHAT IS THE GAIN OF THE TRANSMIT ANTENNA(dB)";GTDB
120 INPUT "WHAT IS THE VSWR OF THE TRANSMIT ANTENNA";TVS
130 IF TVS<1 THEN GOTO 120
140 INPUT "WHAT IS THE GAIN OF THE RECEIVE ANTENNA(dB)";GRDB
150 INPUT "WHAT IS THE VSWR OF THE RECEIVE ANTENNA";RVS
160 IF RVS<1 THEN GOTO 150
170 INPUT "WHAT IS THE FREQUENCY(MHz)";FMC
180 INPUT "WHAT IS THE INPUT POWER(dBm)";PIDB
190 INPUT "WHAT IS THE RANGE(meters)";R
200 IF R<=0 THEN GOTO 190
210 INPUT "DO YOU WISH TO COMPUTE POLARIZATION MISMATCH(Y,N)";IP$
220 IF IP$<>"N" THEN GOSUB 430
230 INPUT "WHAT POLARIZATION MISMATCH DO YOU WISH TO USE(dB)";PMDB
240 IF PMDB>0 THEN GOTO 230
250 PRINT
260 COLOR 14,0
270 WV=300/FMC
280 RT=(TVS-1)/(TVS+1)
290 RR=(RVS-1)/(RVS+1)
300 GT=10^(GTDB/10)
310 GR=10^(GRDB/10)
320 PM=10^(PMDB/10)
330 PR=(1-RT*RT)*(1-RR*RR)*(WV/(4*PI*R))^2*GT*GR*PM
340 PRDB=10*FNLOG10(PR)+PIDB
350 PRINT USING "THE RECEIVED POWER IS ####.##dBm";PRDB
360 PRINT
370 COLOR 4,0
380 INPUT "CONTINUE(Y,N)";IP$
390 IF IP$<>"N" THEN GOTO 60
400 COLOR 7,0
410 KEY ON
420 END
430 REM COMPUTE POLARIZATION MISMATCH
440 INPUT "WHAT IS THE AXIAL RATIO OF THE TRANSMIT ANTENNA(dB)";ATDB
450 INPUT "WHAT IS THE AXIAL RATIO OF THE RECEIVE ANTENNA(dB)";ARDB
460 INPUT "WHAT IS THE ANGULAR MISMATCH BETWEEN REC. AND TRANS.(degrees)";AMD
470 INPUT "ARE THE POL. SENSES THE SAME(BOTH RH OR LH)(Y,N)";IS$
480 TH=AMD*PI/180
490 AT=10^(ATDB/20)
500 AR=10^(ARDB/20)
510 IF IS$="N" THEN AT=-AT
520 PM=1
530 PMMX=1
540 PMMN=1
550 IF AT=1 AND AR=1 THEN GOTO 740
560 IF AT=1 THEN GOTO 650
570 IF AR=1 THEN GOTO 700
580 RT=(AT+1)/(AT-1)
590 RR=(AR+1)/(AR-1)
600 PM=(1+RT*RT*RR*RR+2*RT*RR*COS(2*TH))
610 PM=PM/((1+RT*RT)*(1+RR*RR))
620 PMMX=(1-RT*RR)^2/((1+RT*RT)*(1+RR*RR))
630 PMMN=(1+RT*RR)^2/((1+RT*RT)*(1+RR*RR))
640 GOTO 740
650 RR=(AR+1)/(AR-1)
660 PM=RR*RR/(1+RR*RR)
670 PMMX=PM
680 PMMN=PM
690 GOTO 740
700 RT=(AT+1)/(AT-1)
710 PM=RT*RT/(1+RT*RT)
720 PMMX=PM
730 PMMN=PM
740 PMDB=10*FNLOG10(PM)
750 PMMXDB=10*FNLOG10(PMMX)
760 PMMNDB=10*FNLOG10(PMMN)
770 PRINT
780 COLOR 14,0
790 PRINT USING "THE POLARIZATION MISMATCH IS ###.##dB";PMDB
800 PRINT USING "THE MAX. POLARIZATION MISMATCH IS ###.##dB";PMMXDB
810 PRINT USING "THE MIN. POLARIZATION MISMATCH IS ###.##dB";PMMNDB
820 COLOR 4,0
830 RETURN
840 END