Continue the stream with more scores.
- Parameters
-
| scores | Scores in order |
| gate | One gate score per score, or empty for no gate |
- Returns
- The half open intervals completed by this call, in order
- Exceptions
-
| std::invalid_argument | When gate is not empty and its length differs from the scores |
Definition at line 100 of file IntervalScan.cpp.
101{
102 if (!gate.empty() && gate.size() != scores.size()) {
104 std::source_location::current(), "Interval scan gate has {} scores for {} scores", gate.size(), scores.size());
105 }
106
107 const auto first =
static_cast<uint32_t
>(
m_seen);
110
111 std::vector<Interval> out;
112 const bool gated = !gate.empty();
113
114 for (size_t i = 0; i < scores.size(); ++i) {
115 const double score = static_cast<float>(scores[i]);
116 const uint32_t cur =
m_config.first_sample + (first +
static_cast<uint32_t
>(i)) *
m_config.hop;
117 const bool above = score >=
m_config.enter;
118
119 if (gated &&
static_cast<double>(
static_cast<float>(gate[i])) <
m_config.gate_threshold) {
124 }
125 }
129 continue;
130 }
131
134 if (silence >
m_config.gap_at_limit) {
139 }
140 }
144 }
145 }
146
151 continue;
152 }
153
160 const uint32_t resume = cut + dur;
161 if (resume < cut + cur) {
164 } else {
166 }
174 } else {
177 }
179 } else {
184 continue;
185 }
186 }
187
191 }
193
196 }
198 continue;
199 }
200
204 }
208 }
209 }
210
211 return out;
212}
IntervalScanConfig m_config
void reset_gap_state() noexcept
void close_run(uint32_t start, uint32_t end, std::vector< Interval > &out)
void update_total() noexcept
@ Runtime
General runtime operations (default fallback).
@ Kinesis
General mathematical and physics algorithns.
References close_run(), MayaFlux::Journal::Kinesis, m_best_dur, m_best_end, m_config, m_has_best, m_has_start, m_next_start, m_prev_end, m_run_limit, m_seen, m_start, m_temp_end, m_triggered, reset_gap_state(), MayaFlux::Journal::Runtime, and update_total().