1 #ifndef H_DSP
2 #define H_DSP
3 
4 #include <stdio.h>
5 #include <stdint.h>
6 #include <stdlib.h>
7 #include <math.h>
8 #include <fftw3.h>
9 #include <float.h>
10 #include <time.h>
11 #include <string.h>
12 
13 #include "util.h"
14 
15 #define PI_D		3.1415926535897932
16 #define LOGBASE_D	2
17 #define LOOP_SIZE_SEC_D	10.0
18 #define BMSQ_LUT_SIZE_D	16000
19 
20 double pi;
21 double LOGBASE;			// Base for log() operations. Anything other than 2 isn't really supported
22 #define TRANSITION_BW_SYNT 16.0		// defines the transition bandwidth for the low-pass filter on the envelopes during synthesisation
23 double LOOP_SIZE_SEC;		// size of the noise loops in seconds
24 int32_t BMSQ_LUT_SIZE;		// defines the number of elements in the Blackman Square look-up table. It's best to make it small enough to be entirely cached
25 
26 int32_t clocka;
27 
28 extern void fft(double *in, double *out, int32_t N, uint8_t method);
29 extern void normi(double **s, int32_t xs, int32_t ys, double ratio);
30 extern double *freqarray(double basefreq, int32_t bands, double bandsperoctave);
31 extern double *blackman_downsampling(double *in, int32_t Mi, int32_t Mo);
32 extern double *bmsq_lut(int32_t size);
33 extern void blackman_square_interpolation(double *in, double *out, int32_t Mi, int32_t Mo, double *lut, int32_t lut_size);
34 extern double **anal(double *s, int32_t samplecount, int32_t samplerate, int32_t *Xsize, int32_t bands, double bpo, double pixpersec, double basefreq);
35 extern double *wsinc_max(int32_t length, double bw);
36 extern double *synt_sine(double **d, int32_t Xsize, int32_t bands, int32_t *samplecount, int32_t samplerate, double basefreq, double pixpersec, double bpo);
37 extern double *synt_noise(double **d, int32_t Xsize, int32_t bands, int32_t *samplecount, int32_t samplerate, double basefreq, double pixpersec, double bpo);
38 extern void brightness_control(double **image, int32_t width, int32_t height, double ratio);
39 
40 #endif
41