[SciPy-Dev] ENH: Extend peak finding capabilities in scipy.signal (#8264)

Lars G. lagru at mailbox.org
Sun Jan 28 20:06:59 EST 2018


On 28.01.2018 23:24, Ralf Gommers wrote:
> 
> On Sun, Jan 28, 2018 at 6:05 AM, Lars G. <lagru at mailbox.org> wrote:
>> I have prepared a performance evaluation for you to review here:
>> http://nbviewer.jupyter.org/urls/gitlab.com/snippets/1695752/raw
> 
> Thanks, such easy to read comparisons are very helpful to evaluate
> proposed new functionality. 
> 
> Regarding the flat peaks issue, I'd have a preference for only a single
> index being returned. Rationale: 
> - whether a peak is considered flat or not can be determined by small
> amount of noise (either numerical or real)
> - behavior of the function for different inputs should be consistent,
> changing the number of returned indices will be annoying for users
> Regarding the execution time: that should be only a secondary concern here.

Okay, it seems we are in agreement here. :)

I also played around with Cython and managed to come up with a solution
that is both
- faster than SciPy's argrelextrema and my old pure Python suggestion
- and can detect flat peaks by default.

I have updated the linked notebook with the new Cython function for
those who are interested.

I'll use this as the basis of a new PR when I find the time.

Best regards,
Lars



More information about the SciPy-Dev mailing list