Skip to content

Multi-channel event detection #1

Description

@thorwhalen

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)]

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions