home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RBBS in a Box Volume 1 #2
/
RBBS_vol1_no2.iso
/
005z
/
rmbcd1.bas
< prev
next >
Wrap
BASIC Source File
|
1985-10-02
|
8KB
|
257 lines
100 REM Passive 3-way Crossover Network
110 REM Design and Sensitivity Matching.
115 REM
120 REM Speaker Builder Magazine.
121 REM "Passive Crossover Networks"
122 REM -- Part 1: Volume 6 Number 1
123 REM -- Part 2: Volume 6 Number 2
125 REM
126 REM Speaker Builder Magazine
127 REM Post Office Box 494
128 REM Peterborough, NH 03458
129 REM
130 REM by
135 REM
136 REM Robert M. Bullock III
137 REM
140 REM December, 1984
145 REM
150 P2 = 6.283185 :: TH = 1000 :: MI = 1000000!
155 PRINT
156 PRINT
160 INPUT "Crossover Frequencies FL,FH";FL,FH
165 PRINT
170 FM = SQR(FH*FL) :: W1 = P2*FL
180 W2 = P2*FM :: W3 = P2*FH
190 S = FH/FL :: R = SQR(S)
200 R3 = R*S :: R4 = S*S :: T3 = 0
210 INPUT "Loads RL,RM,RH";RL,RM,RH
215 PRINT
220 INPUT "Crossover type (1=APC or 2=CPC)";T
225 PRINT
230 INPUT "Crossover order (1, 2, 3 or 4)";O
235 PRINT
240 ON (O) GOSUB 280,460,760,1290
250 GOSUB 1980
260 END
265 REM
270 REM First-order
275 REM
280 A = R+1/R
290 IF (T = 1) THEN H = R-1/R
300 IF (T = 2) THEN H = SQR(S-1/S)
310 L1 = RL/W1*TH
320 RA = RM*(A/H-1) :: R0 = RM+RA
330 EG = 20*LOG(R0/RM)/LOG(10)
340 IF (T3 = 1) THEN R0 = RM
350 IF (T3 = 1) THEN RA = 0
360 C1 = A/R0/W2*MI :: L2 = R0/W2/A*TH
370 C2 = 1/RH/W3*MI
375 PRINT
380 PRINT "Labels refer to Figure 7 in the article:"
385 PRINT
390 PRINT USING "L11 = ###.#### mH";L1
400 PRINT USING " RA = ###.#### Ohms";RA
410 PRINT USING "C21 = ###.#### uF";C1
420 PRINT USING "L22 = ###.#### mH";L2
430 PRINT USING "C31 = ###.#### uF";C2
435 PRINT
440 RETURN
445 REM
450 REM Second-order
455 REM
460 ON (T) GOSUB 680,720
470 A = AL*(R+1/R) :: B = S+AL*AL+1/S
480 C1 = 1/AL/RL/W1*MI :: L1 = AL*RL/W1*TH
490 K = B-1 :: E = A-A/K
500 RA = RM*(K/H-1) :: R0 = RA+RM
510 EG = 20*LOG(R0/RM)/LOG(10)
520 IF (T3 = 1) THEN R0 = RM
530 IF (T3 = 1) THEN RA = 0
540 C2 = 1/A/R0/W2*MI :: L2 = A*R0/W2/K*TH
550 L3 = E*R0/W2*TH :: C3 = K/E/R0/W2*MI
560 L4 = AL*RH/W3*TH :: C4 = 1/AL/RH/W3*MI
565 PRINT
570 PRINT "Labels refer to figure 8 in the article:"
575 PRINT
580 PRINT USING "C11 = ###.#### uF";C1
590 PRINT USING "L12 = ###.#### mH";L1
600 PRINT USING " RA = ###.#### Ohms";RA
610 PRINT USING "C21 = ###.#### uF";C2
620 PRINT USING "L22 = ###.#### mH";L2
630 PRINT USING "L23 = ###.#### mH";L3
640 PRINT USING "C24 = ###.#### uF";C3
650 PRINT USING "L31 = ###.#### mH";L4
660 PRINT USING "C32 = ###.#### uF";C4
665 PRINT
670 RETURN
680 IF (S < 2.1) THEN GOTO 2170
690 AL = 2*(S-1)/SQR(S*S-2*S)
700 H = S+AL*AL-4+3/S
710 RETURN
720 AL = SQR(2)
730 H = SQR(R4-1/R4)
740 RETURN
745 REM
750 REM Third-order
755 REM
760 ON (T) GOSUB 1090,1250
770 A = BL*R+AL/R :: B = AL*S+AL*BL+BL/S
780 C = R3+AL*AL*R+BL*BL/R+1/R3
790 EL = BL-1/AL
800 L1 = RL/W1/AL*TH :: C1 = AL/EL/RL/W1*MI
810 L2 = EL*RL/W1*TH
820 E = B-C/A :: F = A-A/E :: K = C-A*(B-1)/E
830 G = B-1-K/F-E*F/K
840 RA = RM*(K/H-1) ::R0 = RA+RM
850 EG = 20*LOG(R0/RM)/LOG(10)
860 IF (T3 = 1) THEN RA = 0
870 IF (T3 = 1) THEN R0 = RM
880 C2 = A/R0/W2*MI :: L3 = E*R0/W2/A*TH
890 C3 = K/E/R0/W2*MI
900 L4 = R0/W2/F*TH :: C4 = F/G/R0/W2*MI
910 L5 = G*R0/W2/K*TH
920 C5 = AL/RH/W3*MI :: L6 = EL*RH/W3/AL*TH
930 C6 = 1/EL/RH/W3*MI
935 PRINT
940 PRINT "Labels refer to figure 9 in the article:"
945 PRINT
950 PRINT USING "L11 = ###.#### mH";L1
960 PRINT USING "C12 = ###.#### uF";C1
970 PRINT USING "L13 = ###.#### mH";L2
980 PRINT USING " RA = ###.#### Ohms";RA
990 PRINT USING "C21 = ###.#### uf";C2
1000 PRINT USING "L22 = ###.#### mH";L3
1010 PRINT USING "C23 = ###.#### uf";C3
1020 PRINT USING "L24 = ###.#### mH";L4
1030 PRINT USING "C25 = ###.#### uf";C4
1040 PRINT USING "L26 = ###.#### mH";L5
1050 PRINT USING "C31 = ###.#### uf";C5
1060 PRINT USING "L32 = ###.#### mH";L6
1070 PRINT USING "C33 = ###.#### uf";C6
1075 PRINT
1080 RETURN
1090 INPUT "BP Polarity (1 or -1)";PO
1095 PRINT
1100 IF (PO = 1) AND (S < 2) THEN GOTO 2170
1110 IF (PO = -1) AND (S < 3) THEN GOTO 2170
1120 A8 = R4+4/S :: C8 = 4*S :: D8 = -8*(R4+1/S)
1130 IF (PO = -1) THEN GOSUB 1230
1140 BL = 2
1150 FOR I = 1 TO 5
1160 B2 = BL*BL
1170 NU = 4*B2*B2*BL+2*A8*B2*BL-8*B2-D8
1180 BL = NU/(5*B2*B2+3*A8*B2-16*BL+C8)
1190 NEXT I
1200 AL = BL*BL/2
1210 H = R3+(AL*AL-2*BL)*R+PO*2*AL/R+(1-2*PO)/R3
1220 RETURN
1230 A8 = -A8 :: C8 = C8+8/R4 :: D8 = -D8
1240 RETURN
1250 AL = 2 :: BL = 2
1260 H = SQR(R3*R3-1/R3/R3)
1270 RETURN
1275 REM
1280 REM Fourth-order
1285 REM
1290 ON (T) GOSUB 1690,1950
1300 A = CL*R+AL/R :: B = BL*S+AL*CL+BL/S
1310 C = AL*R3+AL*BL*R+BL*CL/R+CL/R3
1320 D = R4+AL*AL*S+BL*BL+CL*CL/S+1/R4
1330 EL = BL-CL/AL :: FL = CL-AL/EL
1340 C1 = 1/AL/RL/W1*MI :: L1 = AL*RL/W1/EL*TH
1350 C2 = EL/FL/RL/W1*MI :: L2 = FL*RL/W1*TH
1360 E = B-C/A :: F = D-C/A :: G = C-A*F/E
1370 K = F-C*E/G+A*(B-1)/G :: M = B-1-A*E/G+A/G
1380 N = C-A*(B-1)/E-G*M/K :: P = A-A/E-G/K
1390 Q = M-N/P :: T1 = N-P*K/Q
1400 RA = RM*(K/H-1) :: R0 = RM+RA
1410 EG = 20*LOG(R0/RM)/LOG(10)
1420 IF (T3 = 1) THEN R0 = RM
1430 IF (T3 = 1) THEN RA = 0
1440 C3 = 1/A/R0/W2*MI :: L3 = A*R0/W2/E*TH
1450 C4 = E/G/R0/W2*MI :: L4 = G*R0/W2/K*TH
1460 L5 = P*R0/W2*TH :: C5 = Q/P/R0/W2*MI
1470 L6 = T1*R0/W2/Q*TH :: C6 = K/R0/W2/T1*MI
1480 L7 = AL*RH/W3*TH :: C7 = EL/AL/RH/W3*MI
1490 L8 = FL*RH/W3/EL*TH :: C8 = 1/FL/RH/W3*MI
1500 PRINT "Labels refer to figure 10 in the article:"
1510 PRINT USING "C11 = ###.#### uf";C1
1520 PRINT USING "L12 = ###.#### mH";L1
1530 PRINT USING "C13 = ###.#### uf";C2
1540 PRINT USING "L14 = ###.#### mH";L2
1550 PRINT USING " RA = ###.#### Ohms";RA
1560 PRINT USING "C21 = ###.#### uf";C3
1570 PRINT USING "L22 = ###.#### mH";L3
1580 PRINT USING "C23 = ###.#### uf";C4
1590 PRINT USING "L24 = ###.#### mH";L4
1600 PRINT USING "L25 = ###.#### mH";L5
1610 PRINT USING "C26 = ###.#### uf";C5
1620 PRINT USING "L27 = ###.#### mH";L6
1630 PRINT USING "C28 = ###.#### uf";C6
1640 PRINT USING "L31 = ###.#### mH";L7
1650 PRINT USING "C32 = ###.#### uf";C7
1660 PRINT USING "L33 = ###.#### mH";L8
1670 PRINT USING "C34 = ###.#### uf";C8
1675 PRINT
1680 RETURN
1690 IF (S < 1.5) THEN GOTO 2170
1700 Z = 1 :: H9 = .00001
1710 FOR I = 1 TO 5
1720 X = Z+H9
1730 GOSUB 1870
1740 Y3 = Y
1750 X = X-2*H9
1760 GOSUB 1870
1770 Y2 = Y
1780 X = X+H9
1790 GOSUB 1870
1800 Z = Z-Y*2*H9/(Y3-Y2)
1810 NEXT I
1820 X = Z
1830 GOSUB 1920
1840 CL = SQR(Y1) :: AL = X*CL :: BL = CL*CL/2
1850 H = (BL*BL-2*AL*CL+2)*R4/2-1/R4
1860 RETURN
1870 X2 = X*X-1
1880 GOSUB 1920
1890 Y4 = .25*Y1*Y1-2*X*Y1+2
1900 Y = X2*R4*R+(X2+.5)*Y4*R+1/R3-2*X/R4/R
1910 RETURN
1920 DU = R4*S-2*S
1930 Y1 = 4*(2*X*R4*S+2*X2*R4-4*X*S+2)/DU
1940 RETURN
1950 AL = SQR(4+2*SQR(2)) :: BL = 2+SQR(2)
1960 CL = AL :: H = SQR(R4*R4-1/R4/R4)
1970 RETURN
1980 PRINT "Do you want RA=0 circuit values?"
1990 INPUT "(1=Yes or 0=No) - ";T3
1995 PRINT
2000 IF (T3 = 0) THEN RETURN
2010 IF (O = 1) THEN GOSUB 310
2020 IF (O = 2) THEN GOSUB 500
2030 IF (O = 3) THEN GOSUB 850
2040 IF (O = 4) THEN GOSUB 1410
2050 PRINT
2060 PRINT USING"Excess gain is EG = ##.##dB.";EG
2065 PRINT
2070 PRINT
2080 INPUT "Inductor - source losses (0 if none)";RS
2090 IF (RS = 0) THEN RETURN
2100 LG = 20*LOG((RM+RS)/RM)/LOG(10)
2110 REM
2120 GG = EG-LG
2130 PRINT
2140 PRINT USING "Driver sensitivity increase is EG-LG = ##.##dB.";GG
2150 PRINT
2155 PRINT
2160 RETURN
2170 PRINT
2180 PRINT "Run again with crossover frequencies closer together."
2190 PRINT
3000 PRINT
55 PRINT
2160 RETURN
2170 PRINT
2180 PRINT "Run again with crossover frequencies closer together."
2190 PRIN