fix: a zero-width band fires on equality, not never; dead accessors removed
- The comment in `feed_window()` and three companion sites claimed a zero-width band "never fires, because no sample can be on a different side of it than its neighbour". That is false: `inside = value >= lo && value <= hi` with `lo == hi == 1.0` is true at +1 and false at -1, so a ±1 square fires 19 times in 20 samples. The correct reason the panel refuses one is that it reduces the condition to a float-equality test on a real-valued signal, which in practice never fires (fix 4). - `EventDetector::condition()`, `BufferSearch::channel()` and `BufferSearch::condition_` were confirmed unused by grep and deleted (fix 10). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
7aa9cf4664
commit
090b6bb57d
4 files changed
+2
-6
No files matched your search
+2
-2
@@ -119,8 +119,8 @@ double EventDetector::feed_window(double value, double t) noexcept {
|
||||
if (inside == inside_) return kNoEvent;
|
||||
inside_ = inside;
|
||||
// The event is the *change of side*, so `Rising` reads as "into the band" and `Falling`
|
||||
// as "out of it". A band of zero width therefore never fires at all, because no sample
|
||||
// can be on a different side of it than its neighbour: the panel refuses one.
|
||||
// as "out of it". A band of zero width reduces the condition to an equality test on a
|
||||
// real-valued signal, which is a float-equality test and therefore unusable: the panel refuses one.
|
||||
const bool fired = (cond_.edge == TriggerEdge::Rising && inside) ||
|
||||
(cond_.edge == TriggerEdge::Falling && !inside) ||
|
||||
cond_.edge == TriggerEdge::Both;
|
||||
|
||||
Reference in new issue
Block a user