Category : Science and Education
Archive   : EEPUB06.ZIP
Filename : FILDES.BAS

 
Output of file : FILDES.BAS contained in archive : EEPUB06.ZIP
10 FOR I=1 TO 10
20 PRINT CHR$(13)
30 NEXT I
40 PRINT " FILTER DESIGN PROGRAM FILDES.BAS"
50 PRINT:PRINT " BY TIM REGAN"
60 PRINT:PRINT " NATIONAL SEMICONDUCTOR CORPORATION"
70 PRINT " 2900 SEMICONDUCTOR DRIVE
80 PRINT " SANTA CLARA, CALIFORNIA 95051
90 PRINT:PRINT " VERSION 1.0 OCT 7, 1983
100 PRINT:PRINT
110 PRINT "This program determines all of the necessary parameters to design"
120 PRINT:PRINT "LOWPASS--HIGHPASS--BANDPASS and NOTCH filters synthesised using"
130 PRINT:PRINT "BUTTERWORTH--CHEBYSHEV or ELLIPTIC approximations.
140 PRINT:PRINT "NOTE: Lowpass and Highpass designs are limited to 10th Order..."
150 PRINT " Bandpass and Notch designs are limited to 20th Order"
160 PRINT:PRINT
170 PRINT "What response shape is to be designed:":PRINT
180 R=0:G=0:HCP=0:Z=0
190 INPUT "[L]owpass-[H]ighpass-[B]andpass-[N]otch (Enter 1 Letter)";R$
200 PRINT
210 IF R$="L" THEN R=1
220 IF R$="H" THEN R=2
230 IF R$="B" THEN R=3
240 IF R$="N" THEN R=4:IF R=0 GOTO 190
250 PRINT "Which filter type:":PRINT
260 INPUT "[B]utterworth--[C]hebyshev--[E]lliptic (Enter 1 Letter)";T$
270 IF T$="B" THEN G=1 ELSE IF T$="C" THEN G=2 ELSE IF T$="E" THEN G=3 ELSE 260
280 PRINT:INPUT "Do you want to Print Out all results (Y/N)";K$:PRINT
290 IF K$="Y" THEN HCP=1: GOTO 310
300 IF K$<>"N" GOTO 280
310 ON R GOSUB 410,410,660,660
320 OPEN "O",1,"PROTO"
330 PRINT #1,R,G,HCP,F1,F2,A1,Z
340 IF Z$="Y" THEN PRINT #1,N:GOTO 360
350 PRINT #1,A2
360 IF R<3 THEN PRINT #1,FC,FS:GOTO 380
370 PRINT #1,BW,SW,FCNTR
380 CLOSE #1
390 PRINT:PRINT "NOW LOADING THE FILTER SYNTHESIS PROGRAM...."
400 RUN "FILSYP.EXE"
410 REM ********** ENTER LOWPASS / HIGHPASS DATA **********
420 IF R=1 THEN F$="LOWPASS"
430 IF R=2 THEN F$="HIGHPASS"
440 PRINT:PRINT "What is the maximum Passband Ripple (Amax) in DB:":PRINT
450 IF G=1 THEN PRINT "For Butterworth, Amax is typically 3db":PRINT
460 INPUT "Enter in DB";A1
470 PRINT:PRINT
480 IF A1=0 THEN PRINT "Need a non-ZERO value for Amax!!!":GOTO 440
490 IF A1<0 THEN A1=-1*A1
500 INPUT "Enter the Corner Frequency (FC) in Hz";FC
510 PRINT:PRINT "Do you already know the order of this "F$" (Y/N)";:INPUT Z$
520 IF Z$="N" GOTO 560
530 IF Z$<>"Y" GOTO 510
540 PRINT:INPUT "What is the order (MUST BE LESS THAN 10)";N
550 Z=1:GOTO 590
560 PRINT:INPUT "Enter the Minimum Stopband Attenuation (Amin) in DB";A2
570 IF A2<0 THEN A2=-1*A2
580 IF A2<=A1 THEN PRINT:PRINT:PRINT "NOT MUCH OF A "F$"!!!....Amin<=Amax":GOTO 440
590 PRINT:INPUT "Enter the Stopband Frequency (FS) in Hz";FS
600 IF (FS 610 IF (FS>FC) AND (R=2) THEN PRINT:PRINT:PRINT "LOOKS LIKE A LOWPASS!!!...FS>FC":GOTO 440
620 PRINT:PRINT:IF FS=FC THEN PRINT "You're not "F$"ING ANYTHING....FS=FC!!!!!":GOTO 440
630 IF R=2 THEN F1=1:F2=FC/FS:GOTO 650
640 F1=1:F2=FS/FC
650 RETURN
660 REM ********** ENTER BANDPASS / NOTCH DATA **********
670 IF R=3 THEN F$="BANDPASS"
680 IF R=4 THEN F$="NOTCH"
690 PRINT:PRINT "For this "F$" filter which parameters do you know:"
700 PRINT "1. Upper and Lower Frequency Limits of the Passband and Stopband.
710 PRINT "2. Center Frequency, PASS Bandwidth and STOP Bandwidth.
720 INPUT "Select 1 or 2";K
730 ON K GOSUB 770,1010
740 IF R=3 THEN F1=1:F2=SW/BW
750 IF R=4 THEN F1=1:F2=BW/SW
760 RETURN
770 PRINT:INPUT "Enter the Maximum Passband Ripple (Amax) in DB";A1:PRINT
780 IF A1<0 THEN A1=-1*A1
790 IF A1=0 THEN PRINT:PRINT "Need a non-ZERO value for Amax!!!":GOTO 770
800 INPUT "Enter the Lower Frequency Edge of the Passband (FL) in Hz";FL:PRINT
810 INPUT "Enter the Higher Frequency Edge of the Passband (FH) in Hz";FH
820 IF FH 830 BW=FH-FL: FCNTR=SQR(FH*FL)
840 PRINT:PRINT "Do you know the Order of this "F$" (Y/N)";:INPUT Z$
850 IF Z$="N" GOTO 900
860 IF Z$<>"Y" GOTO 840
870 PRINT:INPUT "Enter the order (N)";N
880 Q=N MOD 2:IF Q<>0 THEN PRINT:PRINT "ORDER MUST BE EVEN":GOTO 870
890 Z=1:GOTO 930
900 PRINT:INPUT "Enter the Minimum Stopband Attenuation (Amin) in DB";A2
910 IF A2<0 THEN A2=-1*A2
920 IF A2 930 PRINT:INPUT "Enter the Lower Frequency Edge of the Stopband (FLS) in Hz";FLS
940 PRINT:INPUT "Enter the Higher Frequency Edge of the Stopband (FHS) in Hz";FHS
950 IF FHS 960 SW=FHS-FLS
970 IF (R=3) AND (SW 980 IF (R=4) AND (BW 990 IF BW=SW THEN PRINT:PRINT "You're not "F$"ing ANYTHING.....Passband=Stopband":GOTO 770
1000 RETURN
1010 PRINT:INPUT "Enter the Maximum Passband Ripple (Amax) in DB";A1
1020 IF A1<0 THEN A1=-1*A1
1030 IF A1=0 THEN PRINT:PRINT "Need a non-ZERO value for Amax!!!":GOTO 1010
1040 PRINT:INPUT "Enter the Center Frequency (FCNTR) in Hz";FCNTR
1050 PRINT:INPUT "Enter the Passband Bandwidth (BW) in Hz";BW
1060 X=BW^2+(4*FCNTR^2)
1070 Y=SQR(X)-BW
1080 IF Y<0 THEN Y=SQR(X)+BW
1090 FL=Y/2:FH=FL+BW
1100 PRINT "FCNTR="FCNTR" FL="FL" FH="FH
1110 PRINT:PRINT "Do you know the Order of this "F$" (Y/N)";:INPUT Z$
1120 IF Z$="N" GOTO 1170
1130 IF Z$<>"Y" GOTO 1110
1140 PRINT:INPUT "What is the Order (N)";N
1150 Q=N MOD 2:IF Q<>0 THEN PRINT:PRINT "ORDER MUST BE EVEN":GOTO 1140
1160 Z=1:GOTO 1200
1170 PRINT:INPUT "Enter the Minimum Stopband Attenuation (Amin) in DB";A2
1180 IF A2<0 THEN A2=-1*A2
1190 IF A2 1200 PRINT:INPUT "Enter the Stopband Bandwidth (SW) in Hz";SW
1210 IF (R=3) AND (SW 1220 IF (R=4) AND (BW 1230 X=SW^2+(4*FCNTR^2)
1240 Y=SQR(X)-SW
1250 IF Y<0 THEN Y=SQR(X)+BW
1260 FLS=Y/2:FHS=FLS+SW
1270 PRINT "FCNTR="FCNTR" FLS="FLS" FHS="FHS
1280 RETURN


  3 Responses to “Category : Science and Education
Archive   : EEPUB06.ZIP
Filename : FILDES.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/