API
 
Loading...
Searching...
No Matches
cycle.cpp
Go to the documentation of this file.
1
2
3
4
5std::vector<int> m_regCounter;
6std::vector<float> m_scale;
7
8m_regCounter.resize(m_numModes);
9m_scale.resize(m_numModes, -999); //maybe -1 does it. need a trigger to reset this?
10
11int m_nRegCycles {60};
12
13int nc = 0;
14
15for(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
26if(m_scale[n] == -999 || m_regCounter[n] >= m_nRegCycles)
27{
28 float sc;
29 //regularize
30
31 if(m_scale[n] == -999)
32 {
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}
43else
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}
std::vector< int > m_regCounter
Definition cycle.cpp:5
int nc
Definition cycle.cpp:13
gopt_lp
Definition cycle.cpp:56
int m_nRegCycles
Definition cycle.cpp:11
std::vector< float > m_scale
Definition cycle.cpp:6