forked from g0orx/wdsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
emnr.h
173 lines (153 loc) · 3.23 KB
/
emnr.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/* emnr.h
This file is part of a program that implements a Software-Defined Radio.
Copyright (C) 2015 Warren Pratt, NR0V
This program 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
of the License, or (at your option) any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The author can be reached by email at
*/
#ifndef _emnr_h
#define _emnr_h
typedef struct _emnr
{
int run;
int position;
int bsize;
double* in;
double* out;
int fsize;
int ovrlp;
int incr;
double* window;
int iasize;
double* inaccum;
double* forfftin;
double* forfftout;
int msize;
double* mask;
double* revfftin;
double* revfftout;
double** save;
int oasize;
double* outaccum;
double rate;
int wintype;
double ogain;
double gain;
int nsamps;
int iainidx;
int iaoutidx;
int init_oainidx;
int oainidx;
int oaoutidx;
int saveidx;
fftw_plan Rfor;
fftw_plan Rrev;
struct _g
{
int gain_method;
int npe_method;
int ae_run;
double msize;
double* mask;
double* y;
double* lambda_y;
double* lambda_d;
double* prev_mask;
double* prev_gamma;
double gf1p5;
double alpha;
double eps_floor;
double gamma_max;
double q;
double gmax;
//
double* GG;
double* GGS;
FILE* fileb;
} g;
struct _npest
{
int incr;
double rate;
int msize;
double* lambda_y;
double* lambda_d;
double* p;
double* alphaOptHat;
double alphaC;
double alphaCsmooth;
double alphaCmin;
double* alphaHat;
double alphaMax;
double* sigma2N;
double alphaMin_max_value;
double snrq;
double betamax;
double* pbar;
double* p2bar;
double invQeqMax;
double av;
double* Qeq;
int U;
double Dtime;
int V;
int D;
double MofD;
double MofV;
double* bmin;
double* bmin_sub;
int* k_mod;
double* actmin;
double* actmin_sub;
int subwc;
int* lmin_flag;
double* pmin_u;
double invQbar_points[4];
double nsmax[4];
double** actminbuff;
int amb_idx;
} np;
struct _npests
{
int incr;
double rate;
int msize;
double* lambda_y;
double* lambda_d;
double alpha_pow;
double alpha_Pbar;
double epsH1;
double epsH1r;
double* sigma2N;
double* PH1y;
double* Pbar;
double* EN2y;
} nps;
struct _ae
{
int msize;
double* lambda_y;
double zetaThresh;
double psi;
double* nmask;
} ae;
}emnr, *EMNR;
extern EMNR create_emnr (int run, int position, int size, double* in, double* out, int fsize, int ovrlp,
int rate, int wintype, double gain, int gain_method, int npe_method, int ae_run);
extern void destroy_emnr (EMNR a);
extern void flush_emnr (EMNR a);
extern void xemnr (EMNR a, int pos);
extern void setBuffers_emnr (EMNR a, double* in, double* out);
extern void setSamplerate_emnr (EMNR a, int rate);
extern void setSize_emnr (EMNR a, int size);
#endif