API
Applications
Utilities
API
Handbook
GitHub
Home
Loading...
Searching...
No Matches
cycle.cpp
Go to the documentation of this file.
1
2
3
4
5
std::vector<int>
m_regCounter
;
6
std::vector<float>
m_scale
;
7
8
m_regCounter
.resize(m_numModes);
9
m_scale
.resize(m_numModes, -999);
//maybe -1 does it. need a trigger to reset this?
10
11
int
m_nRegCycles
{60};
12
13
int
nc
= 0;
14
15
for
(
size_t
n =0; n <
m_regCounter
.size(); ++n)
16
{
17
m_regCounter
[n] =
nc
;
18
++
nc
;
19
20
if
(
nc
>=
m_nRegCycles
)
21
{
22
nc
= 0;
23
}
24
}
25
26
if
(
m_scale
[n] == -999 ||
m_regCounter
[n] >=
m_nRegCycles
)
27
{
28
float
sc;
29
//regularize
30
31
if
(
m_scale
[n] == -999)
32
{
33
m_regCounter
[n]= n %
m_nRegCycles
;
34
}
35
else
36
{
37
m_regCounter
[n]= 0;
38
}
39
40
m_scale
[n] = sc;
41
//save max-stable gain m_maxLPGain[n]
42
}
43
else
44
{
45
//use new pre-regularized version
46
realT psdReg = m_olPSDs[n][0];
47
if
( calcCoefficients( m_olPSDs[n], m_nPSDs[n], psdReg * pow( 10, -
m_scale
[n] / 10 ), m_Na ) < 0 )
48
{
49
return
-1;
50
}
51
52
go_lp.a( m_lp.m_c );
53
go_lp.b( m_lp.m_c );
54
55
56
gopt_lp
= go_lp.optGainOpenLoop( m_varLP[n], m_olPSDs[n], m_nPSDs[n], m_maxLPGain[n],
false
);
57
58
++
m_regCounter
[n];
59
}
m_regCounter
std::vector< int > m_regCounter
Definition
cycle.cpp:5
nc
int nc
Definition
cycle.cpp:13
gopt_lp
gopt_lp
Definition
cycle.cpp:56
m_nRegCycles
int m_nRegCycles
Definition
cycle.cpp:11
m_scale
std::vector< float > m_scale
Definition
cycle.cpp:6
apps
modalGainOpt
cycle.cpp
Generated by
1.9.8