[SciPy-Dev] Finding signal upcrossings and declustered peaks

Ali Cetin ali.cetin at outlook.com
Thu Oct 18 16:52:55 EDT 2018



________________________________
From: SciPy-Dev <scipy-dev-bounces+ali.cetin=outlook.com at python.org> on behalf of Ralf Gommers <ralf.gommers at gmail.com>
Sent: Thursday, October 18, 2018 21:59
To: SciPy Developers List
Subject: Re: [SciPy-Dev] Finding signal upcrossings and declustered peaks



On Thu, Oct 18, 2018 at 10:41 AM Ali Cetin <ali.cetin at outlook.com<mailto:ali.cetin at outlook.com>> wrote:
Hi,

this is my first attempt to write to this mailing list, so if I'm doing something wrong please bear with me.

Hi Ali, no worries you got it all right. welcome:)

I've been working with extreme value analysis during my PhD and also in my current job. What we often do is to find signal upcrossings (such as mean and zero upcrossings) and find declustered peaks. That is, find the largest peak between two upcrossings, or the two largest peaks between two upcrossings etc...

I'm proposing to add two new functions to the scipy.signal submodule:
   - find_upcross; takes in signal and returns index of upcrossings wrt user defined upcrossing level
   - find_peaks_dc; takes in signal and returns index of peaks (n largest)

(find_peaks_dc is not necessarly easily incorporated into find_peaks, so it may be cleaner to have a separate function).

Any thought on this?

Do you have any references for the algorithms?
Well, the "algorithms" are rather straight forward and heuristic.

   - find_upcross is often referred to as zero-crossing (https://en.wikipedia.org/wiki/Zero_crossing) (a special case). It is essentially detecting sign changes. Upcrossing count and rates are important statistics in time series (extreme value) analysis. Side note: Zero-crossing rate is by def the ratio between the second and zeroth moment of the power spectrum of the signal.

   - find_peaks_dc finds all peaks above an upcrossing level (or threshold) between two consecutive upcrossings, i.e. batches of peaks. Then the n-largest peaks are selected from each batch. Declustering is a technique often used to break down statistical dependency between peaks when performing extreme value analysis, and thus be able to use simpler distributions to describe them. As n-> inf find_peaks_dc -> find_peaks 😊 (Albeit in many practical situations, inf < 5). (Note that find_peaks_dc depends on find_upcross).

The code are just a few lines and mostly numpy array operations.

Ali


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20181018/2600449e/attachment.html>


More information about the SciPy-Dev mailing list