Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the differenence between LocalDetect and RollingDetect? #15

Open
jonathanjfshaw opened this issue Apr 24, 2020 · 1 comment
Open

Comments

@jonathanjfshaw
Copy link
Contributor

The docs for LocalDetect say:

    """ Detect peaks and valleys in live 1D signal
    This node uses a simple algorithm to detect peaks in real time.

        This peak detection is considered real-time since it does not require buffering the data. However, the detection
        method necessarily involve a lag between the actual peak and its detection.
        Indeed, the internal state of the node is either "looking for a peak" or "looking for a valley".
        The "last local extrema" is set to a peak (resp. valley) as soon as the signal drops (resp. rises) significantly.

Those for RollingDetect say:

    """ Detect peaks and valleys on a rolling window of analysis in  1D signal
    This node uses a buffer to compute local extrema and detect peaks in real time.

I've read the code for RollingDetect more than once, but I don't find it easy to see how it works and how it is different to LocalDetect.

If someone can tell me, I can improve the docs.

@bertrandlalo
Copy link
Member

Local detect
This algo handles each sample individually with internal states (last_peak, last_valley and whereas it is "looking for a peak").
peak_algo_illustration

Rolling Detect
This algo is actually equivalent to the local max function of scipy. It needs to buffer values over a window to decide on a local extrema.

Tell me if it makes sense and what you suggest for the doc. Otherwise, I'd close this issue, since it's not quite one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants