aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/fftease/src/pv.h
blob: 1a555ec70b90cc8dcea530035881db546d2203bc (plain)
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
64
65
/*
 *  This file is part of the pv-lib
 *
 *  The pv-lib can be used by everyone as desired
 *
 *  (c) Eric Lyon and Christopher Penrose
 */

#include <stdio.h>

/* -------------------------------------
 modifications by Thomas Grill
*/

/* #include <fts/fts.h> */
#include <math.h>

#ifdef _MSC_VER
#pragma warning(disable: 4305)
#pragma warning(disable: 4244)
#pragma warning(disable: 4101)
#endif

#ifdef __cplusplus
extern "C" {
#endif


#define PV_PI 3.141592653589793115997963468544185161590576171875
#define PV_2PI (2.*PV_PI)

/* ------------------------------------- */


#define FORWARD 1
#define INVERSE 0

typedef struct {
  float    min;
  float    max;
} Bound;

void init_rdft(int n, int *ip, float *w);
void pv_rdft(int n, int isgn, float *a, int *ip, float *w);
void fold( float *I, float *W, int Nw, float *O, int N, int n );
void overlapadd(float *I, int N, float *W, float *O, int Nw, int n );
void makehanning( float *H, float *A, float *S, int Nw, int N, int I, int osc, int odd );
void makewindows( float *H, float *A, float *S, int Nw, int N, int I, int osc );
void leanconvert( float *S, float *C, int N2 , int amp, int ph );
void leanunconvert( float *C, float *S, int N2 );
void pv_rfft( float *x, int N, int forward );
void pv_cfft( float *x, int NC, int forward );
void convert_new(float *S, float *C, int N2, float *lastphase,  float fundamental, float factor );
void convert(float *S, float *C, int N2, float *lastphase,  float fundamental, float factor );
void unconvert(float  *C, float *S, int N2, float *lastphase, float fundamental,  float factor );


/* ------------------------------------- */

#ifdef __cplusplus
}
#endif

/* ------------------------------------- */