1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
9 * by the Xiph.Org Foundation http://www.xiph.org/ *
11 ********************************************************************
13 function: bark scale utility
14 last mod: $Id: barkmel.c 16037 2009-05-26 21:10:58Z xiphmont $
16 ********************************************************************/
23 for(i
=64;i
<32000;i
*=2){
25 fprintf(stderr
,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
26 rate
,i
,rate
/2 / (i
/2),toBARK(rate
/2 /(i
/2)),toBARK(rate
/2));
29 fprintf(stderr
,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
30 rate
,i
,rate
/2 / (i
/2),toBARK(rate
/2 /(i
/2)),toBARK(rate
/2));
33 fprintf(stderr
,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
34 rate
,i
,rate
/2 / (i
/2),toBARK(rate
/2 /(i
/2)),toBARK(rate
/2));
37 fprintf(stderr
,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
38 rate
,i
,rate
/2 / (i
/2),toBARK(rate
/2 /(i
/2)),toBARK(rate
/2));
41 fprintf(stderr
,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
42 rate
,i
,rate
/2 / (i
/2),toBARK(rate
/2 /(i
/2)),toBARK(rate
/2));
45 fprintf(stderr
,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n",
46 rate
,i
,rate
/2 / (i
/2),toBARK(rate
/2 /(i
/2)),toBARK(rate
/2));
49 fprintf(stderr
,"rate=%gHz, block=%d, f(1)=%.2gHz bark(1)=%.2g (of %.2g)\n\n",
50 rate
,i
,rate
/2 / (i
/2),toBARK(rate
/2 /(i
/2)),toBARK(rate
/2));
57 for(i
=0.,j
=0;i
<28;i
+=1,j
++){
58 fprintf(stderr
,"(%d) bark=%f %gHz (%d of 128)\n",
59 j
,i
,fromBARK(i
),(int)(fromBARK(i
)/22050.*128.));