File: bloscbank.c

package info (click to toggle)
pd-fftease 2.5.2.git20121005-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,116 kB
  • ctags: 2,516
  • sloc: ansic: 17,044; makefile: 363; perl: 80
file content (34 lines) | stat: -rw-r--r-- 769 bytes parent folder | download | duplicates (5)
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

#include "fftease.h"

void bloscbank( float *S, float *O, int D, float iD, float *lf, float *la, float *index, float *tab, 
	int len, float synt, int lo, int hi )
{
  int    amp,freq,chan, i;

  float    a,ainc,f,finc,address;
  
  for ( chan = lo; chan < hi; chan++ ) {

    freq = ( amp = ( chan << 1 ) ) + 1;
    if ( S[amp] > synt ){ 
      finc = ( S[freq] - ( f = lf[chan] ) )* iD;
      ainc = ( S[amp] - ( a = la[chan] ) )* iD;
      address = index[chan];
      for ( i = 0; i < D ; i++ ) {
	O[i] += a*tab[ (int) address ];
	    
	address += f;
	while ( address >= len )
	  address -= len;
	while ( address < 0 )
	  address += len;
	a += ainc;
	f += finc;
      }
      lf[chan] = S[freq];
      la[chan] = S[amp];
      index[chan] = address;
    }    
  }
}