00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <stdio.h>
00019 #include "scales.h"
00020 int main(){
00021 int i;
00022 double rate;
00023 for(i=64;i<32000;i*=2){
00024 rate=48000.f;
00025 fprintf(stderr,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
00026 rate,i,rate/2 / (i/2),toBARK(rate/2 /(i/2)),toBARK(rate/2));
00027
00028 rate=44100.f;
00029 fprintf(stderr,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
00030 rate,i,rate/2 / (i/2),toBARK(rate/2 /(i/2)),toBARK(rate/2));
00031
00032 rate=32000.f;
00033 fprintf(stderr,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
00034 rate,i,rate/2 / (i/2),toBARK(rate/2 /(i/2)),toBARK(rate/2));
00035
00036 rate=22050.f;
00037 fprintf(stderr,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
00038 rate,i,rate/2 / (i/2),toBARK(rate/2 /(i/2)),toBARK(rate/2));
00039
00040 rate=16000.f;
00041 fprintf(stderr,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
00042 rate,i,rate/2 / (i/2),toBARK(rate/2 /(i/2)),toBARK(rate/2));
00043
00044 rate=11025.f;
00045 fprintf(stderr,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
00046 rate,i,rate/2 / (i/2),toBARK(rate/2 /(i/2)),toBARK(rate/2));
00047
00048 rate=8000.f;
00049 fprintf(stderr,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n\n",
00050 rate,i,rate/2 / (i/2),toBARK(rate/2 /(i/2)),toBARK(rate/2));
00051
00052
00053 }
00054 {
00055 float i;
00056 int j;
00057 for(i=0.,j=0;i<28;i+=1,j++){
00058 fprintf(stderr,"(%d) bark=%f %gHz (%d of 128)\n",
00059 j,i,fromBARK(i),(int)(fromBARK(i)/22050.*128.));
00060 }
00061 }
00062 return(0);
00063 }
00064