%! ps %%% Best choice of bits per quadrant? (C:\\Documents and Settings\\don\\Desktop\\gonzo\\gonzo.ps) run % use internal gonzo % /realto8dstring is the high level code for the reporting conversion. It % determines the sign and then tests for values too large or too small. % It then goes to processgoodreal for actual report conversions. % A final deferencing is done to provide a unique output string. /realto8dstring {dup 0 lt % test and flag negatives /isneg exch store abs /val exch store % save real as absolute value val 100000000 ge { % report and error trap values (real is too big! )== % that are too large to process real_is_too_big! } if val 0.00000001 le % truncate small numbers to zero {(0.0000000)} {processgoodreal} ifelse % process numbers versus zeros isneg {(-)}{( )} ifelse % create leading space or minus exch mergestr % add leading space or minus 20 string cvs % dereference string to avoid % any possible rude surprises } store % /processgoodreal continues the realto8string processing after numbers too % large and too small have been dealt with. Subprocs are called for tenmillions, % unitsormore, and fractions. Note that log floor cvi tells you the decade % size and position of any positive number. /processgoodreal { val log floor cvi % evaluate decimal location /posn exch store % posn 7 eq {tenmillions} % treat ten millions special {posn 0 ge {unitsormore} % handle >1 as a class {fractions} % handle fractions as a class ifelse } ifelse } store % /tenmillions handles ten millions as a special case needing no reformatting. /tenmillions { val round cvi % use ten millions val as is. 20 string cvs } store % /unitsormore handles units through millions... /unitsormore { /workstring val % scale val as needed to 10-99 megs 1 7 posn sub {10 mul} % this may give more accuracy repeat mul round cvi 20 string cvs store % and convert to string workstring 0 posn 1 add % stuff decimal point getinterval (.) mergestr workstring % post remainder of string posn 1 add workstring length 1 sub posn sub getinterval mergestr 20 string cvs % dereference } store % /fractions handles fractional values /fractions {/workstring val % scale workstring 1 7 posn sub {10 mul} repeat % this may give more accuracy mul round cvi 20 string cvs store % and convert to string (0.) % prepend leading zero and dp posn neg 1 sub % add intermediate zeros {(0) mergestr} repeat workstring mergestr % postpend value 20 string cvs % dereference } store %%%%%%%%%%%% %%%%%%%%%%%%%%% reporting routines for 7 besteff %%%%%%%%%%% %%%%%%%%%%%% /report28 { /curdat exch store /dat28 [ % fundamental curdat 0 get cos curdat 1 get cos sub curdat 2 get cos curdat 3 get cos sub add curdat 4 get cos curdat 5 get cos sub add curdat 6 get cos curdat 7 get cos sub add curdat 8 get cos curdat 9 get cos sub add curdat 10 get cos curdat 11 get cos sub add curdat 12 get cos curdat 13 get cos sub add 4 mul pi div dup /curampl exch store curdat 0 get 3 mul cos curdat 1 get 3 mul cos sub % 3H curdat 2 get 3 mul cos curdat 3 get 3 mul cos sub add curdat 4 get 3 mul cos curdat 5 get 3 mul cos sub add curdat 6 get 3 mul cos curdat 7 get 3 mul cos sub add curdat 8 get 3 mul cos curdat 9 get 3 mul cos sub add curdat 10 get 3 mul cos curdat 11 get 3 mul cos sub add curdat 12 get 3 mul cos curdat 13 get 3 mul cos sub add 4 mul pi div curampl div 3 div curdat 0 get 5 mul cos curdat 1 get 5 mul cos sub % 5H curdat 2 get 5 mul cos curdat 3 get 5 mul cos sub add curdat 4 get 5 mul cos curdat 5 get 5 mul cos sub add curdat 6 get 5 mul cos curdat 7 get 5 mul cos sub add curdat 8 get 5 mul cos curdat 9 get 5 mul cos sub add curdat 10 get 5 mul cos curdat 11 get 5 mul cos sub add curdat 12 get 5 mul cos curdat 13 get 5 mul cos sub add 4 mul pi div curampl div 5 div curdat 0 get 7 mul cos curdat 1 get 7 mul cos sub % 7H curdat 2 get 7 mul cos curdat 3 get 7 mul cos sub add curdat 4 get 7 mul cos curdat 5 get 7 mul cos sub add curdat 6 get 7 mul cos curdat 7 get 7 mul cos sub add curdat 8 get 7 mul cos curdat 9 get 7 mul cos sub add curdat 10 get 7 mul cos curdat 11 get 7 mul cos sub add curdat 12 get 7 mul cos curdat 13 get 7 mul cos sub add 4 mul pi div curampl div 7 div curdat 0 get 9 mul cos curdat 1 get 9 mul cos sub % 9H curdat 2 get 9 mul cos curdat 3 get 9 mul cos sub add curdat 4 get 9 mul cos curdat 5 get 9 mul cos sub add curdat 6 get 9 mul cos curdat 7 get 9 mul cos sub add curdat 8 get 9 mul cos curdat 9 get 9 mul cos sub add curdat 10 get 9 mul cos curdat 11 get 9 mul cos sub add curdat 12 get 9 mul cos curdat 13 get 9 mul cos sub add 4 mul pi div curampl div 9 div curdat 0 get 11 mul cos curdat 1 get 11 mul cos sub % 11H curdat 2 get 11 mul cos curdat 3 get 11 mul cos sub add curdat 4 get 11 mul cos curdat 5 get 11 mul cos sub add curdat 6 get 11 mul cos curdat 7 get 11 mul cos sub add curdat 8 get 11 mul cos curdat 9 get 11 mul cos sub add curdat 10 get 11 mul cos curdat 11 get 11 mul cos sub add curdat 12 get 11 mul cos curdat 13 get 11 mul cos sub add 4 mul pi div curampl div 11 div curdat 0 get 13 mul cos curdat 1 get 13 mul cos sub % 13H curdat 2 get 13 mul cos curdat 3 get 13 mul cos sub add curdat 4 get 13 mul cos curdat 5 get 13 mul cos sub add curdat 6 get 13 mul cos curdat 7 get 13 mul cos sub add curdat 8 get 13 mul cos curdat 9 get 13 mul cos sub add curdat 10 get 13 mul cos curdat 11 get 13 mul cos sub add curdat 12 get 13 mul cos curdat 13 get 13 mul cos sub add 4 mul pi div curampl div 13 div curdat 0 get 15 mul cos curdat 1 get 15 mul cos sub % 15H curdat 2 get 15 mul cos curdat 3 get 15 mul cos sub add curdat 4 get 15 mul cos curdat 5 get 15 mul cos sub add curdat 6 get 15 mul cos curdat 7 get 15 mul cos sub add curdat 8 get 15 mul cos curdat 9 get 15 mul cos sub add curdat 10 get 15 mul cos curdat 11 get 15 mul cos sub add curdat 12 get 15 mul cos curdat 13 get 15 mul cos sub add 4 mul pi div curampl div 15 div curdat 0 get 17 mul cos curdat 1 get 17 mul cos sub % 17H curdat 2 get 17 mul cos curdat 3 get 17 mul cos sub add curdat 4 get 17 mul cos curdat 5 get 17 mul cos sub add curdat 6 get 17 mul cos curdat 7 get 17 mul cos sub add curdat 8 get 17 mul cos curdat 9 get 17 mul cos sub add curdat 10 get 17 mul cos curdat 11 get 17 mul cos sub add curdat 12 get 17 mul cos curdat 13 get 17 mul cos sub add 4 mul pi div curampl div 17 div curdat 0 get 19 mul cos curdat 1 get 19 mul cos sub % 19H curdat 2 get 19 mul cos curdat 3 get 19 mul cos sub add curdat 4 get 19 mul cos curdat 5 get 19 mul cos sub add curdat 6 get 19 mul cos curdat 7 get 19 mul cos sub add curdat 8 get 19 mul cos curdat 9 get 19 mul cos sub add curdat 10 get 19 mul cos curdat 11 get 19 mul cos sub add curdat 12 get 19 mul cos curdat 13 get 19 mul cos sub add 4 mul pi div curampl div 19 div curdat 0 get 21 mul cos curdat 1 get 21 mul cos sub % 21H curdat 2 get 21 mul cos curdat 3 get 21 mul cos sub add curdat 4 get 21 mul cos curdat 5 get 21 mul cos sub add curdat 6 get 21 mul cos curdat 7 get 21 mul cos sub add curdat 8 get 21 mul cos curdat 9 get 21 mul cos sub add curdat 10 get 21 mul cos curdat 11 get 21 mul cos sub add curdat 12 get 21 mul cos curdat 13 get 21 mul cos sub add 4 mul pi div curampl div 21 div curdat 0 get 23 mul cos curdat 1 get 23 mul cos sub % 23H curdat 2 get 23 mul cos curdat 3 get 23 mul cos sub add curdat 4 get 23 mul cos curdat 5 get 23 mul cos sub add curdat 6 get 23 mul cos curdat 7 get 23 mul cos sub add curdat 8 get 23 mul cos curdat 9 get 23 mul cos sub add curdat 10 get 23 mul cos curdat 11 get 23 mul cos sub add curdat 12 get 23 mul cos curdat 13 get 23 mul cos sub add 4 mul pi div curampl div 23 div curdat 0 get 25 mul cos curdat 1 get 25 mul cos sub % 25H curdat 2 get 25 mul cos curdat 3 get 25 mul cos sub add curdat 4 get 25 mul cos curdat 5 get 25 mul cos sub add curdat 6 get 25 mul cos curdat 7 get 25 mul cos sub add curdat 8 get 25 mul cos curdat 9 get 25 mul cos sub add curdat 10 get 25 mul cos curdat 11 get 25 mul cos sub add curdat 12 get 25 mul cos curdat 13 get 25 mul cos sub add 4 mul pi div curampl div 25 div curdat 0 get 27 mul cos curdat 1 get 27 mul cos sub % 27H curdat 2 get 27 mul cos curdat 3 get 27 mul cos sub add curdat 4 get 27 mul cos curdat 5 get 27 mul cos sub add curdat 6 get 27 mul cos curdat 7 get 27 mul cos sub add curdat 8 get 27 mul cos curdat 9 get 27 mul cos sub add curdat 10 get 27 mul cos curdat 11 get 27 mul cos sub add curdat 12 get 27 mul cos curdat 13 get 27 mul cos sub add 4 mul pi div curampl div 27 div ] store % this is presently distortion only; no amplitude weighting dat28 1 get dup mul % start with 3H dat28 2 get dup mul add dat28 3 get dup mul add dat28 4 get dup mul add dat28 5 get dup mul add dat28 6 get dup mul add dat28 7 get dup mul add dat28 8 get dup mul add dat28 9 get dup mul add dat28 10 get dup mul add dat28 11 get dup mul add dat28 12 get dup mul add % dat28 13 get dup mul add % temp no h27 for exp check sqrt 100 mul /dist28 exch store /dat28 mark dat28 aload pop dist28 ] store } store % report format is (\n\n) print flush % angslist report28 dat28 {realto8dstring ==} forall %%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%% end reporting routines %%%%%%%%%%%%%%%%% /realangsfin [ % this is the all zeros final data for .53 11.2042290591 % p1s 12.4905319207 % p1e 22.4525477004 % p2s 24.9806655448 % p2e 33.7881350824 % p3s 37.4682808414 % p3e 45.2516393413 % p4s 49.9470192811 % p4e 56.8780123572 % p5s 62.4024934519 % p5e 68.6910801478 % p6s 74.8080801604 % p6e 80.6964035956 % p7s 87.1238700988 % p7e ] store realangsfin report28 dat28 {realto8dstring ==} forall % verifies as six leading zeros of distortion and ( 0.53000016) amplitude. % best bits per quadrant? 2500000 60 div 4 div == % returns 10416.7 or 10417 bits per quadrant. % but shaken28 uses 3472 which is one third for delta. Use 10416 per quadrant % and increment by threes for delta compability. /bpq 10416 store (\n\n\n\n) print flush /processonevalue { mark 3 2 27 {/curharm exch store bpq curharm div floor /curcyc exch store bpq curharm div dup floor exch sub 360 mul /curexcess exch store % curexcess curexcess curcyc div } for ] /errs exch store 0 errs {dup mul add} forall sqrt 14 div % average rms error? /curerr exch store % (\n) print flush % bpq == % errs == % curerr == } store 50 50 10 setgrid 40 20 showgrid 9999 1 12000 {/bpq exch store processonevalue bpq 10000 sub 1000 div 20 mul curerr 160 mul dup /val exch store mt dot val 7 le {bpq ==} if } for /bpq 10416 store 1 0 0 setrgbcolor processonevalue bpq 10000 sub 1000 div 20 mul curerr 160 mul dup /val exch store mt dot /bpq 11550 store 0 0 1 setrgbcolor processonevalue bpq 10000 sub 1000 div 20 mul curerr 160 mul dup /val exch store mt dot /bpq 11781 store 1 0 1 setrgbcolor processonevalue bpq 10000 sub 1000 div 20 mul curerr 160 mul dup /val exch store mt dot /bpq 10395 store 1 0.7 0 setrgbcolor processonevalue bpq 10000 sub 1000 div 20 mul curerr 160 mul dup /val exch store mt dot % returns 10101 10375 10584 10881 % 10101 factors 3 for 3367 7 for 481 13 for 37 % 10375 factors NO THREE 5 for 2075 5 again for 415 5 again for 83 % 10584 factors 3 for 3528 3 again for 1176 7 for 168 7 again for 24 3 again for 8 % 3 5 7 11 is 11550 % 11781 is a minimum with factor 3 but higher sample rate % 11781 factors 3 for 3927 3 again (no 9th) for 1309 7 for 187 11 and 17. showpage % EOF