| 128 | } |
| 129 | |
| 130 | int countMisplacedPeaks(fl::span<const SweepFrame> frames) { |
| 131 | int count = 0; |
| 132 | for (fl::size i = 0; i < frames.size(); ++i) { |
| 133 | int diff = frames[i].peakBin - frames[i].expectedBin; |
| 134 | if (diff < 0) diff = -diff; |
| 135 | if (diff > 1) { |
| 136 | count++; |
| 137 | } |
| 138 | } |
| 139 | return count; |
| 140 | } |
| 141 | |
| 142 | float averageConcentration(fl::span<const SweepFrame> frames) { |
| 143 | float sum = 0.0f; |