-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfreq.h
80 lines (65 loc) · 1.9 KB
/
freq.h
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
*
* postfish
*
* Copyright (C) 2002-2005 Monty and Xiph.Org
*
* Postfish is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* Postfish is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Postfish; see the file COPYING. If not, write to the
* Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
*/
#include "postfish.h"
#include <fftw3.h>
typedef struct {
float *fftwf_buffer;
fftwf_plan fftwf_forward;
fftwf_plan fftwf_backward;
int qblocksize;
int bands;
float **ho_window;
float *ho_area;
float *window;
} freq_class_setup;
typedef struct {
time_linkage out;
feedback_generic_pool feedpool;
freq_class_setup *fc;
int *activeP;
int *active1;
int *active0;
u_int32_t mutemask0;
u_int32_t mutemask1;
u_int32_t mutemaskP;
float **lap1;
float **lap0;
float **lapC;
float **cache1;
float **cache0;
int cache_samples;
int fillstate; /* 0: uninitialized
1: half-primed
2: nominal
3: eof processed */
float **peak;
float **rms;
} freq_state;
extern int pull_freq_feedback(freq_state *ff,float **peak,float **rms);
extern int freq_class_load(freq_class_setup *f,const float *frequencies, int bands);
extern int freq_load(freq_state *f,freq_class_setup *fc,int ch);
extern int freq_reset(freq_state *f);
extern time_linkage *freq_read(time_linkage *in,
freq_state *f,
int *visible, int *active,
void (*func)(float *,int i));