home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
games
/
alpha.zip
/
PLEMDT27.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-01-01
|
4KB
|
116 lines
10 REM Copyright 1987, Arnold B. Krueger, Grosse Pointe Woods, MI. 48236
20 DEF FNPHLP1(W,WC,D) = ATN(W/WC)
30 DEF FNPHHP1(W,WC,D) = ATN(WC/W)
40 DEF FNPHLP2(W,WC,D) = -ATN( D*W /(WC*(1.000001-(W/WC)^2 ) ) ) + PI*(W>WC)
50 DEF FNPHHP2(W,WC,D) = ATN( D*WC/(W *(1.000001-(WC/W)^2 ) ) ) - PI*(W<WC)
60 DEF FNAMLP1(W,WC,D) = 1 / SQR(1!+(W/WC)^2)
70 DEF FNAMHP1(W,WC,D) = 1 / SQR(1!+(WC/W)^2)
80 DEF FNAMLP2(W,WC,D) = 1 / SQR(1+(W/WC)^4+(D*D-2!)*(W/WC)^2)
90 DEF FNAMHP2(W,WC,D) = 1 / SQR(1+(WC/W)^4+(D*D-2.000001)*(WC/W)^2)
100 DEF FNDBV(AMP) = 20!*LOG(AMP)*LOGCONV
110 DEF FNPHD(RAD) = 180!*RAD/PI
120 DEF FNSUMA(AA,AB,PA,PB) = SQR((AA*SIN(PA)+AB*SIN(PB))^2 + (AA*COS(PA)+AB*COS(PB))^2 )
130 DEF FNSUMPW(AA,AB,PA,PB) = SQR((AA*AA*SIN(PA)+AB*AB*SIN(PB))^2 + (AA*AA*COS(PA)+AB*AB*COS(PB))^2 )
140 DEF FNSUMPN(AA,AB,PA,PB) = AA*SIN(PA)+AB*SIN(PB)
150 DEF FNSUMPD(AA,AB,PA,PB) = AA*COS(PA)+AB*COS(PB)
160 DEF FNDIRF(AA,AB,PA,PB) = ABS((SIN((PA-PB))*(((AA >= AB)*AB/AA)+((AB > AA)*AA/AB) )))
170 PI = ATN(SQR(3!))*3
180 LOGCONV=1!/LOG(10!)
190 LOGCONV=1!/LOG(10!)
200 DIM FREQT(20)
210 FREQT(1)=20:FREQT(2)=22:FREQT(3)=25:FREQT(4)=28:FREQT(5)=32:FREQT(6)=36
220 FREQT(7)=40:FREQT(8)=44:FREQT(9)=50:FREQT(10)=56:FREQT(11)=64:FREQT(12)=72
230 FREQT(13)=80:FREQT(14)=88:FREQT(15)=100:FREQT(16)=112
240 FREQT(17)=128:FREQT(18)=144:FREQT(19)=160:FREQT(20)=180
250 SCREEN 2 : KEY OFF : CLS
260 XS = ( LOG(20000)-LOG(20) )*LOGCONV
270 REM Driver parameters:
280 N$ = "modified Equalized MDT-27"
290 F1 = 1300!
300 Q1 = 1.5
310 F2 = 14000!
320 Q2 = .7
330 F3 = 20000!
340 Q3 = 1.5
350 W1 = 2!*PI*F1
360 D1 = 1!/Q1
370 W2 = 2!*PI*F2
380 D2 = 1!/Q2
390 W3 = 2!*PI*F3
400 D3 = 1!/Q3
410 X = 1
420 LINE(52,1)-(639,1)
430 LINE(52,180)-(639,180)
440 FOR X = 52 TO 640 STEP 16
450 FOR ROW = 22.5 TO 157.5 STEP 22.5
460 LINE(X,ROW)-(X+1,ROW)
470 NEXT ROW
480 NEXT X
490 TOGGLE = 0
500 FOR OCT = 0 TO 4
510 DECADE = 10^OCT
520 XSCALE = 75!*(LOG(20!*DECADE)-2.3)
530 LINE(XSCALE,1)-(XSCALE,180)
540 XSCALE = 75!*(LOG( 50!*DECADE)-2.3)
550 LINE(XSCALE,1)-(XSCALE,180)
560 XSCALE = 75!*(LOG(100!*DECADE)-2.3)
570 LINE(XSCALE,1)-(XSCALE,180)
580 XSCALE = XSCALE + 1
590 LINE(XSCALE,1)-(XSCALE,180)
600 FOR NOTE = 1 TO 20
610 F = FREQT(NOTE)*DECADE
620 IF F > 50000! THEN GOTO 830
630 W = 2!*F*PI
640 XP = 75!*(LOG(F)-2.3)
650 Y = FNAMHP2(W,W1,D1)*FNAMLP2(W,W2,D2)*FNAMLP2(W,W3,D3)
660 YD = FNDBV(Y)
670 YP = (20!-YD)*4.5
680 IF YP<10 THEN YP = 10
690 IF YP>180 THEN YP = 180
700 IF OCT=0 THEN IF NOTE = 1 THEN GOTO 720
710 LINE(XP,YP)-(OLDX,OLDY)
720 REM OLDX = XP
730 OLDY = YP
740 Y = FNPHHP2(W,W1,D2)+FNPHLP2(W,W2,D2)+FNPHLP2(W,W3,D3)
750 YD = FNPHD(Y)
760 YQ = 90-YD/2
770 IF OCT=0 THEN IF NOTE=1 THEN GOTO 800
780 IF TOGGLE = 0 THEN TOGGLE = 1 ELSE TOGGLE = 0
790 IF TOGGLE = 0 THEN LINE(XP,YQ) - (OLDX,OLDYQ)
800 OLDYQ = YQ
810 OLDX = XP
820 NEXT NOTE
830 NEXT OCT
840 LOCATE 1,1
850 PRINT USING "#### d";180;
860 LOCATE 23,1
870 PRINT USING "#### d";-180;
880 LOCATE 12,1
890 PRINT USING "### dB";0!;
900 LOCATE 6,1
910 PRINT USING "### dB";10!;
920 LOCATE 17,1
930 PRINT USING "### dB";-10!;
940 LOCATE 24,4
950 PRINT USING "### Hz";20!;
960 LOCATE 24,19
970 PRINT USING "### Hz";100!;
980 LOCATE 24,40
990 PRINT USING " ## kHz";1!;
1000 LOCATE 24,62
1010 PRINT USING "### kHz";10!;
1020 LOCATE 24,70
1030 PRINT USING "### kHz";20!;
1040 LOCATE 2,40
1050 PRINT USING " & ";N$;
1060 LOCATE 3,40
1070 PRINT USING " &";"Amplitude: Phase: ";
1080 LINE(450,20)-(465,20)
1090 LINE(550,20)-(565,20),,,&HF0F0
1100 LOCATE 4,20
1110 PRINT USING "Fl: ##### Q1: #.## F2: ##### Q2: #.## F3: ##### Q3: #.##";F1;Q1;F2;Q2;F3;Q3;
1120 LOCATE 2,1
1130 END
1130 END