[SciPy-user] Extract local minima

Paul Barrett pebarrett at gmail.com
Mon Jun 19 16:16:59 CDT 2006


On 6/19/06, Nils Wagner <nwagner at iam.uni-stuttgart.de> wrote:
>  Hi all,
>
> Is there a way to extract local minima from the column vector stored in
> data.mtx ?

Here is another approach.

Convolve the data with a simple kernel and then subract this array
from your original data.

kern = array([1.,2.,6.,2.,1.])/12.
res = dat - convolve(dat, kern, mode='same')

Now search for local minima less than -0.5.  See attached figure

 -- Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple_conv.png
Type: image/png
Size: 37234 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20060619/27556061/simple_conv-0001.png


More information about the SciPy-user mailing list