comparison NNLSBase.cpp @ 59:1ccb883b585f matthiasm-plugin

more README and n3 updates; changed rollon parameter to percentage
author matthiasm
date Mon, 25 Oct 2010 23:47:06 +0900
parents 01bc078f5f61
children 9a1f83057e84
comparison
equal deleted inserted replaced
58:01bc078f5f61 59:1ccb883b585f
161 161
162 ParameterDescriptor d0; 162 ParameterDescriptor d0;
163 d0.identifier = "rollon"; 163 d0.identifier = "rollon";
164 d0.name = "spectral roll-on"; 164 d0.name = "spectral roll-on";
165 d0.description = "Consider the cumulative energy spectrum (from low to high frequencies). All bins below the first bin whose cumulative energy exceeds the quantile [spectral roll on] x [total energy] will be set to 0. A value of 0 means that no bins will be changed."; 165 d0.description = "Consider the cumulative energy spectrum (from low to high frequencies). All bins below the first bin whose cumulative energy exceeds the quantile [spectral roll on] x [total energy] will be set to 0. A value of 0 means that no bins will be changed.";
166 d0.unit = ""; 166 d0.unit = "%";
167 d0.minValue = 0; 167 d0.minValue = 0;
168 d0.maxValue = 0.05; 168 d0.maxValue = 5;
169 d0.defaultValue = 0; 169 d0.defaultValue = 0;
170 d0.isQuantized = true; 170 d0.isQuantized = true;
171 d0.quantizeStep = 0.005; 171 d0.quantizeStep = 0.5;
172 list.push_back(d0); 172 list.push_back(d0);
173 173
174 ParameterDescriptor d1; 174 ParameterDescriptor d1;
175 d1.identifier = "tuningmode"; 175 d1.identifier = "tuningmode";
176 d1.name = "tuning mode"; 176 d1.name = "tuning mode";
434 434
435 float cumenergy = 0; 435 float cumenergy = 0;
436 if (m_rollon > 0) { 436 if (m_rollon > 0) {
437 for (size_t iBin = 2; iBin < m_blockSize/2; iBin++) { 437 for (size_t iBin = 2; iBin < m_blockSize/2; iBin++) {
438 cumenergy += pow(magnitude[iBin],2); 438 cumenergy += pow(magnitude[iBin],2);
439 if (cumenergy < energysum * m_rollon) magnitude[iBin-2] = 0; 439 if (cumenergy < energysum * m_rollon / 100) magnitude[iBin-2] = 0;
440 else break; 440 else break;
441 } 441 }
442 } 442 }
443 443
444 if (maxmag < 2) { 444 if (maxmag < 2) {