File: godsill_wolfe.c

package info (click to toggle)
gwc 0.21.17~dfsg0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,540 kB
  • sloc: ansic: 41,425; makefile: 648; sh: 166; perl: 106
file content (63 lines) | stat: -rw-r--r-- 1,133 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
calcmask
{
    double *H ;
    double *X ;

    if(!use_existing) {
	compute_xicalc()
    }

    H = current_xicalc ;

    X = vmult(H,Y) ;

    johnston_mask(X) ;
}

#define N_BANDS 26

int crit_bands[N_BANDS] = {0,100,200,300,400,510,630,770,920,1080,1270,1480,1720,2000,2320,2700,3150,3700,4400,5300,6400,7700,9500,12000,15500,1.e30};
int imax ;
double thr_hearing_val[N_BANDS] = {38,31,22,18.5,15.5,13,11,9.5,8.75,7.25,4.75,2.75,1.5,0.5,0,0,0,0,2,7,12,15.5,18,24,29} ;
double abs_thresh[N_BANDS] ;


johnston_init
{
    int i ;

    for(imax = 0 ; imax < N_BANDS ; imax++)
	if(crit_bands[imax] > max_frequency) break ;

    for(i = 0 ; i < N_BANDS ; i++)
	abs_thresh[i] = pow(10.0, thr_hearing_val[i]/10.0) ;

    OFFSET_RATIO_DB = 9+(1:imax)';

    n = fft_size ;

    lin_to_bark = (double *) calloc(n*imax, sizeof(double)) ;

    for(j = 0 ; j < n ; i++) {
	for(i = 0 ; i < imax ; i++)
	    lin_to_bark[j*n+i] = 0.0 ;
    }

    i = 0 ;

    for(j = 0 ; j < n ; i++) {
	while(! ((freq[j] >= crit_bands[i]) && (freq[j] < crit_bands[i
	for(i = 0 ; i < imax ; i++)
	    lin_to_bark[j*n+i] = 0.0 ;
    }



}


johnston_mask
{