Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • Hmm, why would I need to smooth? To remove noise? That sounds interesting. It seems to me that I could use another integer instead of 1 in your example code. I was also thinking of calculating gradients. Anyway if there is no function than that's too bad. Commented Jan 7, 2011 at 12:02
  • 1
    @Navi: The problem is that the notion of "local minimum" varies vastly from use case to use case, so it's hard to provide a "standard" function for this purpose. Smoothing helps to take into account more than just the nearest neighbor. Using a different integer instead of 1, say 3, would be strange as it would only consider the third-next element in both directions, but not the direct neihgbors. Commented Jan 7, 2011 at 13:27
  • 1
    @Sven Marnach: the recipe you link delays the signal. there's a second recipe which uses filtfilt from scipy.signal Commented Nov 12, 2015 at 15:18
  • 3
    Just for the sake of it, replacing the < with > will give you the local maxima instead of the minima Commented Mar 21, 2017 at 23:42
  • 1
    @SvenMarnach I have used your above solution to solve my problem posted here stackoverflow.com/questions/57403659/… but I got output [False False] What could be the problem here? Commented Aug 8, 2019 at 15:10