10 REM equalization curve generator for Audio Precision System One 8 May 86 20 PRINT "1 Single pole de-emphasis Note: To change de- to pre-emphasis," 30 PRINT "2 RIAA/IEC pre-emphasis or pre- to de-emphasis," 40 PRINT "3 RIAA pre-emphasis use the S1 Util Invert command." 50 PRINT "4 Your own formula at line 500" 60 PRINT 70 INPUT "Enter your choice of 1,2,3 or 4 followed by Enter key ",CHOICE 80 IF CHOICE < 1 OR CHOICE > 4 THEN 10 90 IF CHOICE <> 1 THEN 120 100 INPUT "What is the equalization time constant (in micro sec)";T1 110 T1=T1*.000001: T1=T1*T1 'saves computation inside loop 120 INPUT "How many data points of eq curve should be generated";POINTS 130 INPUT "What is the start frequency"; START 140 INPUT "What is the last frequency"; LAST 150 STEPRATIO=EXP(LOG(LAST/START)/(POINTS-1)) 'for log sweep 160 LAST=LAST*SQR(STEPRATIO) 'to make sure LAST value is calculated 170 T2=7.950001E-03: T3=.00318: T4=.000318: T5=7.500001E-05 'time constants 180 T2=T2*T2: T3=T3*T3: T4=T4*T4: T5=T5*T5 'saves computation inside loop 185 O$="eqcreate.dat" 190 OPEN O$ FOR OUTPUT AS #2 'Use S1 Load Data command on this file. 200 PRINT " HZ V OFF " 210 PRINT #2," HZ V OFF " 220 F=START: L=F ' F is frequency in Hz. L is the loop variable. 230 REM The next line is the top of the loop. 240 W=2*3.14159*F 'W is angular frequency in (rad/sec). 250 X=W*W 'X is angular frequency SQUARED in (rad*rad/sec/sec) 260 REM The following line defines the equalization curve 270 ON CHOICE GOSUB 380,400,420,500 ' Call an equalization function. 280 PRINT USING "#######.###, #####.#######";F;V 290 PRINT #2,F;",";V ' Print to disk file eqcreate.dat 300 L=L*STEPRATIO: F=L 'log sweep 310 IF L > LAST AND L < START OR L < LAST AND L > START THEN 240 320 CLOSE 330 REM "Use S1 Load Data command to load eqcreate.dat" 340 PRINT "Press Enter key to write to ";O$;", or any other key to re-calculate" 350 INPUT A$: IF A$<>"" THEN 10 360 SYSTEM 'Return to operating system. 370 END 380 V=1!/SQR(1!+T1*X) 'single pole de-emphasis 390 RETURN 400 V=SQR((1+T2*X)*(1+T3*X)*(1+T5*X)/(T2*X*(1+T4*X))) 'RIAA/IEC pre-emphasis 410 RETURN 420 V=SQR((1+T3*X)*(1+T5*X)/(1+T4*X)) 'RIAA pre-emphasis 430 RETURN 440 REM Put your own function of F(Hz),W(rad/sec) or X(=W*W) on the next line. 500 V=1000/W 'This is just an example user generated function 599 RETURN