Skip to content

Instantly share code, notes, and snippets.

@dusita
dusita / peakdetect.py
Created August 10, 2011 10:58 — forked from endolith/peakdet.m
Peak detection in Python
import sys
from numpy import NaN, Inf, arange, isscalar, asarray
def peakdet(v, delta, x = None):
"""
Converted from MATLAB script at http://billauer.co.il/peakdet.html
Currently returns two lists of tuples, but maybe arrays would be better
function [maxtab, mintab]=peakdet(v, delta, x)