doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
barkmel.c
Go to the documentation of this file.
1 /********************************************************************
2  * *
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. *
7  * *
8  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
9  * by the XIPHOPHORUS Company http://www.xiph.org/ *
10  * *
11  ********************************************************************
12 
13  function: bark scale utility
14  last mod: $Id: barkmel.c,v 1.12 2002/07/11 06:40:48 xiphmont Exp $
15 
16  ********************************************************************/
17 
18 #include <stdio.h>
19 #include "scales.h"
20 int main(){
21  int i;
22  double rate;
23  for(i=64;i<32000;i*=2){
24  rate=48000.f;
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));
27 
28  rate=44100.f;
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));
31 
32  rate=32000.f;
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));
35 
36  rate=22050.f;
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));
39 
40  rate=16000.f;
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));
43 
44  rate=11025.f;
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));
47 
48  rate=8000.f;
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));
51 
52 
53  }
54  {
55  float i;
56  int j;
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.));
60  }
61  }
62  return(0);
63 }
64 
int i
Definition: process.py:33
#define fromBARK(z)
Definition: scales.h:77
#define toBARK(n)
Definition: scales.h:76
int main()
Definition: barkmel.c:20
GLint j
Definition: qgl.h:264