MCPcopy Create free account
hub / github.com/FastLED/FastLED / computeSummary

Function computeSummary

tests/profile/audio/pitch_sweep_test.cpp:186–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184};
185
186static SweepSummary computeSummary(const fl::vector<SweepPoint> &points,
187 bool inBandOnly) {
188 SweepSummary s = {};
189 s.minConcentration = 1.0f;
190 float concSum = 0.0f;
191
192 for (int i = 0; i < static_cast<int>(points.size()); i++) {
193 const SweepPoint &pt = points[i];
194 if (inBandOnly && !pt.inBand)
195 continue;
196 if (!inBandOnly && pt.inBand)
197 continue;
198
199 s.totalSteps++;
200 if (pt.aliased)
201 s.aliasingEvents++;
202 if (!pt.monotonic && i > 0)
203 s.nonMonotonicEvents++;
204 if (pt.concentration < s.minConcentration)
205 s.minConcentration = pt.concentration;
206 concSum += pt.concentration;
207 }
208 if (s.totalSteps > 0)
209 s.avgConcentration = concSum / static_cast<float>(s.totalSteps);
210 return s;
211}
212
213// ---------------------------------------------------------------------------
214// JSON output

Callers 2

emitJsonFunction · 0.85
emitReportFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected