Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一张带有坐标点的表格 (X,Y-shown as a Chart-Series)。现在我检查了如何检测峰值。对于每个点 (P),我必须检查(PY > P-1.Y && PY > P+1.Y) 是否。如果是,那一定是峰。
但是,如果我只想获得整个图表中真正重要的峰值怎么办?我的猜测是,我需要某种阈值。这个阈值可能是什么,或者我应该如何改变峰值的条件?
我想到的最简单的事情:
public bool IsPeak(Point prev, Point aPoint, Point next, float threshold) { return aPoint.Y - prev.Y > threshold && aPoint.Y - next.Y; }
阈值是距您检查的每个点的距离,以查看它是否低于当前点。在您的第一种情况下,您检查一个点,所以我们可以说您的阈值是 1。