home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1
/
HamRadio.cdr
/
tech
/
design1
/
fil-bpid.bas
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
6KB
|
209 lines
10 REM *********************************************
20 REM DESIGNS INTERDIGITAL BPFs
30 REM *********************************************
35 REM revision to line 970 as suggested by Krain. 22 Jan 85
40 DEF FNRJ(TA,B,C,D)=(B*C-TA*D)/(C*C+D*D)
50 REM using equal diameter rods
60 REM g values based on ripple bw . q/coup on 3-bd
70 DIM G(200) , C(200) , RK(200) , AK(200) , FR(40) , ALOSS(40)
80 DIM A(200), B(200)
90 PI=3.14159265#
100 INPUT"# OF ELEMENT $ P-P RIPPLE IN PASSBAND (DB)";N,RIP
110 REM
120 INPUT"INPUT FILTER CENTER FREQ.(GHZ),BW(MHZ)&LOAD IMPEDENCE Z0";FZGC,BWMC,R
130 REM
140 PRINT"INPUT GROUND PLANE SPACING , ROD DIAMETER"
150 INPUT"& DISTANCE TO CENTER OF FIRST AND LAST ROD";H,D,E
160 REM
170 REM
180 INPUT"NO. OF FREQ. REJECTION PTS AND STEP SIZE (MHZ)";NFR,STP
190 FOR IP=-NFR/2 TO NFR/2
200 CONTER=CONTER+1
210 FR(CONTER)=FZGC+(STP*.001*IP)
220 NEXT IP
230 IDAT=1
240 GOTO 250
250 F1=FZGC-.0005*BWMC
260 F2=FZGC+.0005*BWMC
270 IF RIP>0 THEN GOTO 330
280 BW3GC=F2-F1
290 BWRGC=0
300 BW3=1
310 GOSUB 1960
320 GOTO 390
330 B=1/SQR(10^(.1*RIP)-1)
340 CA=LOG(B+SQR(B*B-1))/(N)
350 BW3=(EXP(CA)+EXP(-CA))/2
360 GOSUB 1740
370 BWRGC=F2-F1
380 BW3GC=BWRGC*BW3
390 REM
400 W=2*(F2-F1)/(F2+F1)
410 QF=FZGC/BW3GC
420 NFM=N-1
430 QWVL=11.8028/(4*FZGC)
440 FOR K=1 TO NFM
450 AK(K)=1/(BW3*SQR(G(K)*G(K+1)))
460 RK(K)=AK(K)/QF
470 NEXT K
480 AKO=G(1)*BW3
490 AK(N)=AKO
500 AK(N+1)=0
510 QS=G(1)*BW3*QF
520 CANH=(EXP(2*PI*E/H)-1)/(EXP(2*PI*E/H)+1)
530 ZM=59.9585*LOG(4*H/(PI*D))
540 ZE=59.9585*LOG(CANH*H*4/(PI*D))
550 RKM=RK(1)*SQR(ZM/ZE)
560 Z=PI*D/(2*H)
570 COTH=(EXP(Z)+1)/(EXP(Z)-1)
580 Y=PI*RKM/4
590 T=COTH^Y
600 C(1)=(H/PI)*LOG((T+1)/(T-1))
610 MFL=N-2
620 REM IF N-3<0 THEN AG=1 ELSE IF N-3=0 THEN AG=2 ELSE AG=3
630 ON (2+SGN(N)*1) GOTO 690 , 690 , 640
640 FOR K=2 TO MFL
650 Y=PI*RK(K)/4
660 T=COTH^Y
670 C(K)=(H/PI)*LOG((T+1)/(T-1))
680 NEXT K
690 C(N-1)=C(1)
700 X=SQR(PI*R/(4*ZE*QS))
710 AQ=2*QWVL*ATN(X/SQR(1-X*X))/PI
720 QU=2200*H*SQR(FZGC)
730 SUMG=0
740 FOR J1=1 TO N
750 SUMG=SUMG+G(J1)
760 NEXT J1
770 BLOSS=4.34*FZGC*SUMG/(QU*(F2-F1))
780 DELAY=SUMG/(2*PI*(F2-F1))
790 IF RIP > 0 THEN GOTO 820
800 PRINT"DESIGN DATA FOR ";N;" POLE INTERDIGITAL FILTER. BUTTERWORTH RESPONSE"
810 GOTO 830
820 PRINT "DESIGN DATA FOR";N;"POLE INTERDIGITAL FILTER .BAND PASS RIPPLE";RIP;"DB"
830 PRINT"CENTER FREQ. ";FZGC ;"GHZ"
840 PRINT"CUTOFF FREQ. ";F1;" (GHZ) AND ";F2;" GHZ"
850 PRINT"RIPPLE BW. ";BWRGC;"GHZ"
860 PRINT"3 DB BW. ";BW3GC;"GHZ"
870 PRINT"FRACTIONAL BW.";W
880 PRINT"FILTER Q ";QF
890 PRINT"EST QU ";QU
900 PRINT"LOSS BASED ON THIS QU ";BLOSS;" DB"
910 PRINT"DELAY AT BAND CENTER ";DELAY;"NANOSECONDS"
920 FOR JK=1 TO NFR
930 IF JK=1 THEN PRINT "FREQUENCY REJECTION INFORMATION "
940 NFN=ABS(2*(FR(JK)-FZGC)/(W*FZGC))
950 IF RIP >0 THEN GOTO 980
960 ALOSS(JK)=10*LOG(1+NFN^(2*N))/LOG(10)
970 GOTO 1020
980 IF NFN<1 THEN NFN=1
990 ANG=N*LOG(NFN+SQR(NFN*NFN-1))
1000 YAK=.5*(EXP(ANG)+EXP(-ANG))
1010 ALOSS(JK)=10*LOG(1+(10^(.1*RIP)-1)*YAK*YAK)/LOG(10)
1020 IF ALOSS(JK)>65 THEN ALOSS = 65 ELSE ALOSS = ALOSS(JK)
1030 FR=INT(FR(JK)*10000)/10000 : ALOS=INT(ALOSS(JK))
1040 PRINT TAB(INT(ALOSS))"*";TAB(66)FR;TAB(73)ALOS
1050 NEXT JK
1060 WO=2*PI*FZGC*1E+09
1070 F=D/H
1080 CF=(-.0000422+.0857397*F+.0067853*F*F-9.092165E-02*F^3+.169088*F^4)*PI*H*2.54
1090 REM
1100 WW=WO*1E-12
1110 B2=PI*AQ/(2*QWVL)
1120 GG=1/R
1130 BB=-COS(B2)/(ZE*SIN(B2))
1140 EL1=.8*QWVL
1150 ANG=EL1*PI/(2*QWVL)
1160 B1=ANG-B2
1170 YL=-COS(ANG)/(ZM*SIN(ANG))
1180 CP=WW*(CF+.17655*D*D/(QWVL-EL1))
1190 Y1=CP+YL
1200 EL2=.87*QWVL
1210 ANG=EL2*PI/(2*QWVL)
1220 B4=ANG-B2
1230 YL=-COS(ANG)/(ZM*SIN(ANG))
1240 CD=WW*(CF+.17655*D*D/(QWVL-EL2))
1250 Y2=CD+YL
1260 EL3=.95*QWVL
1270 ANG=EL3*PI/(2*QWVL)
1280 B5=ANG-B2
1290 YL=-COS(ANG)/(ZM*SIN(ANG))
1300 CQ=WW*(CF+.17655*D*D/(QWVL-EL3))
1310 Y3=CQ+YL
1320 ELEM=Y3*Y2*EL1/((Y1-Y2)*(Y1-Y3))+Y1*Y3*EL2/((Y2-Y1)*(Y2-Y3))+Y1*Y2*EL3/((Y3-Y1)*(Y3-Y2))
1330 TANN=SIN(B1)/COS(B1)
1340 YL=FNRJ(GG,BB+TANN/ZE,1-ZE*BB*TANN,ZE*GG*TANN)
1350 Y1=CP+YL
1360 TANN=SIN(B4)/COS(B4)
1370 YL=FNRJ(GG,BB+TANN/ZE,1-ZE*BB*TANN,ZE*GG*TANN)
1380 Y2=CD+YL
1390 TANN=SIN(B5)/COS(B5)
1400 YL=FNRJ(GG,BB+TANN/ZE,1-ZE*BB*TANN,ZE*GG*TANN)
1410 Y3=CQ+YL
1420 ELEQ=Y3*Y2*EL1/((Y1-Y2)*(Y1-Y3))+Y1*Y3*EL2/((Y2-Y1)*(Y2-Y3))+Y1*Y2*EL3/((Y3-Y1)*(Y3-Y2))
1430 REM
1440 PRINT"QUARTER WAVELENGTH =";QWVL ;"INCHES"
1450 PRINT"THE LENGTH OF INTERIOR ELEMENTS =";ELEM;" INCHES"
1460 PRINT"LENGTH OF END ELEMENTS =";ELEQ;" INCHES"
1470 PRINT"GROUND-PLANE SPACE =";H," INCHES "
1480 PRINT"ROD DIAMETER =";D;" INCHES"
1490 PRINT"END PLATES";E;" INCHES FROM C/L OF END ROD "
1500 PRINT"TAP EXTERNAL LINES UP ";AQ;" INCHES FROM SHORTED END "
1510 PRINT"LINE IMPEDANCES: END ROD";ZE;" ,OTHER ";ZM;" , EXT. LINES ";R;"OHM"
1520 PRINT"DIMENSIONS"
1530 PRINT"EL. NO. END TO C C TO C G(K) Q/COUP"
1540 DOM=E
1550 GOO=1
1560 PRINT "0";TAB(41)GOO;TAB(55)AKO
1570 PRINT "1";TAB(16)E;TAB(41)G(1);TAB(55)AK(1)
1580 FOR K=1 TO NFM
1590 L=K+1
1600 PRINT TAB(28)C(K)
1610 DOM=DOM+C(K)
1620 PRINT L;TAB(16)DOM;TAB(41)G(L);TAB(55)AK(L)
1630 NEXT K
1640 LQ=N+1
1650 PRINT LQ;TAB(41)G(LQ)
1660 DOM=DOM+E
1670 PRINT TAB(16)DOM
1680 IF IDAT =1 THEN GOTO 2070
1690 REM
1700 REM
1710 REM DEFINE FUNCTION
1720 DEF FNRJ(TA,B,C,D)=(B*C-TA*D)/(C*C+D*D)
1730 END
1740 REM SUB CHEB
1750 REM
1760 C=2*RIP/17.37
1770 BETA=LOG((EXP(C)+1)/(EXP(C)-1))
1780 GAMMA=.5*(EXP(BETA/(2*N))-EXP(-BETA/(2*N)))
1790 FOR K=1 TO N
1800 A(K)=SIN(.5*(2*K-1)*PI/N)
1810 B(K)=GAMMA^2+SIN(K*PI/N)^2
1820 NEXT K
1830 G(1)=2*A(1)/GAMMA
1840 FOR K=2 TO N
1850 G(K)=4*A(K-1)*A(K)/(B(K-1)*G(K-1))
1860 NEXT K
1870 NN=N/2
1880 NNN=(N+1)/2
1890 REM IF NNN-NN<0 THEN AG1=1 ELSE IF NNN-NN=0 THEN AG1=2 ELSE AG1=3
1900 ON (2+SGN(NNN-NN)*1) GOTO 1910,1910,1930
1910 G(N+1)=((EXP(BETA/2)+1)/(EXP(BETA/2)-1))^2
1920 RETURN
1930 G(N+1)=1
1940 RETURN
1950 END
1960 REM SUB FOR BUTT
1970 REM
1980 REM
1990 REM
2000 REM
2010 POV2=1.57079633#
2020 FOR K=1 TO N
2030 G(K)=2*SIN(POV2*(2*K-1)/N)
2040 NEXT K
2050 G(N+1)=1
2060 RETURN
2070 END