A function that filters out false positives by conditioning detections expecting on
a given expectation of when a second channel should also detect the event.
Example/test
def event_detection_filter(channel_0, channel_1, min_lag, max_lag):
"""A function that filters out false positives by conditioning detections expecting on
a given expectation of when a second channel should also detect the event.
Takes two binary streams ``channel_0`` and ``channel_1`` and returns a stream of
``(channel, index)``
anytime a detection in one channel is followed by a detection in the other within
``[min_lag, max_lag]`` steps.
The ``channel`` indicates where the event was first detected and the ``index``
when it happened.
"""
pass
>>> click_channel_0 = [1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0]
>>> click_channel_1 = [0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0]
>>> list(event_detection_filter(click_channel_0, click_channel_1, min_lag=1, max_lag=1))
[(1, 4), (0, 7)]
A function that filters out false positives by conditioning detections expecting on
a given expectation of when a second channel should also detect the event.
Example/test