home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1
/
HamRadio.cdr
/
misc
/
eepd2
/
nf-ip.bas
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
3KB
|
102 lines
10 DEFDBL A-H,J-M,O-Z
20 REM intercept and noise figure program "intrcp"
30 REM W. SABIN SEP., 1980
40 REM DIM F(21),I1(21),1(21),G(20),CF(21)
50 REM DIM 12(20),2(20),P(21),D(21),C(20),BR(20)
60 PRINT "CASCADE IP(3) OR IP(2)"
70 PRINT "CASCADE NOISE FIGURE"
80 INPUT "NUMBER OF STAGES=";N
90 PRINT "TYPE 1 IF LOAD PASSIVE,2 IF ACTIVE"
100 INPUT E: IF E=2 GOTO 140
110 LET CF(N+1)=0: I1(N+1)=50
120 PRINT "PASSIVE LOAD"
130 GOTO 160
140 INPUT "N.F. (DB) OF LOAD";CF(N+1)
150 INPUT "I.P. (DBM) OF LOAD";I1(N+1)
160 PRINT "TYPE 3 FOR THIRD ORDER I.P."
170 PRINT "TYPE 2 FOR SECOND ORDER I.P."
180 INPUT X
190 LET P(N+1)=30
200 FOR I=N TO 1 STEP -1
210 PRINT: PRINT : PRINT "STAGE NUMBER";I
220 PRINT "TYPE 1 IF STAGE IS ACTIVE"
230 PRINT "TYPE 2 IF STAGE IS PASSIVE"
240 INPUT K
250 ON K GOTO 320,260
260 INPUT "INSERTION LOSS (DB)";G(I)
270 INPUT "BANDWIDTH RATIO=";BR(I)
280 IF BR(I)<1 THEN BR(I)=1
290 LET I1(I)=50: O1(I)=50: C(I)=1
300 LET F(I)=G(I):G(I)=-G(I)
310 GOTO 490
320 INPUT "AVAILABLE GAIN(DB)";G(I)
330 INPUT "STAGE NOISE FIG.";F(I)
340 INPUT "BANDWIDTH RATIO=";BR(I)
350 IF BR(I)<1 THEN BR(I)=1
360 PRINT "TYPE 1 IF INPUT I.P. IS SPECIFIED"
370 PRINT "TYPE 2 IF OUTPUT I.P. IS SPECIFIED"
380 INPUT Y
390 ON Y GOTO 450,400
400 INPUT "OUTPUT I.P. (DBM) ";O1(I)
410 LET I1(I)=O1(I)-G(I)
420 PRINT "INPUT I.P.=";I1(I)
430 INPUT "CORRELATION FACTOR";C(I)
440 GOTO 490
450 INPUT "INPUT I.P. (DBM)";I1(I)
460 LET O1(I)=I1(I)+G(I)
470 PRINT "OUTPUT I.P.=";O1(I)
480 INPUT "CORRELATION FACTOR";C(I)
490 LET P(I)=P(I+1)-G(I)
500 IF X=3 THEN D(I)=3*P(I)-2*I1(I)
510 IF X=2 THEN D(I)=2*P(I)-I1(I)
520 LET D(I)=.001*10^(D(I)/10)
530 LET U=10^(F(I)/10)
540 LET V=10^(CF(I+1)/10)
550 LET V=V*BR(I)
560 LET W=10^(G(I)/10)
570 LET CF(I)=U+(V-1)/W
580 IF CF(I)<1E-37 THEN CF(I)=1E-37
590 LET CF(I)=4.3429*LOG(CF(I))
600 NEXT I
610 IF X=3 THEN D(N+1)=3*P(N+1)-2*I1(N+1)
620 IF X=2 THEN D(N+1)=2*P(N+1)-I1(N+1)
630 LET D(N+1)=.001*10^(D(N+1)/10)
640 FOR I=N TO 1 STEP-1
650 LET B=D(I+1)/(10^(G(I)/10))
660 LET D(I)=D(I)+2*C(I)*SQR(D(I))*SQR(B)+B
670 NEXT I
680 PRINT " INTERCEPTS,N.F."
690 PRINT "STAGE INPUT I.P. N.F."
700 PRINT
710 FOR I=1 TO N
720 IF D(I)<1E-37 THEN D(I)=1E-37
730 LET D(I)=4.3429*LOG(D(I)/.001)
740 IF X=3 THEN I2(I)=1.5*P(I)-.5*D(I)
750 IF X=2 THEN I2(I)=2*P(I)-D(I)
760 NEXT I
770 FOR I=1 TO N
780 LET I2(I)=INT(I2(I)*100+.5)/100
790 LET CF(I)=INT(CF(I)*100+.5)/100
800 PRINT I,I2(I),CF(I)
810 NEXT I
820 PRINT :PRINT
850 PRINT "STAGE","OUTPUT I.P.":PRINT
860 LET D(1)=-50
870 FOR I=2 TO N+1
880 IF X=3 THEN D(I)=3*P(I)-2*O1(I-1)
890 IF X=2 THEN D(I)=2*P(I)-O1(I-1)
900 LET D(I)=.001*10^(D(I)/10)
910 LET D(I-1)=.001*10^(D(I-1)/10)
920 LET B=D(I-1)*10^(G(I-1)/10)
930 LET D(I)=D(I)+2*C(I)*SQR(D(I))*SQR(B)+B
940 IF D(I)<1E-37 THEN D(I)=1E-37
950 LET D(I)=4.3429*LOG(D(I)/.001)
960 IF X=3 THEN O2(I)=1.5*P(I)-.5*D(I)
970 IF X=2 THEN O2(I)=2*P(I)-D(I)
980 IF D(I-1)<1E-37 THEN D(I-1)=1E-37
990 LET D(I-1)=4.3429*LOG(D(I-1)/.001)
1000 LET O2(I)=INT(O2(I)*100+.5)/100
1010 PRINT I-1,O2(I)
1020 NEXT I
1030 END