peakandtrough
Peak and trough is a term used in data analysis, mathematics, and signal processing to describe local extrema in a sequence, function, or time series. A peak, or local maximum, is a point whose value is greater than those of its neighboring points; a trough, or local minimum, is a point whose value is lower than its neighbors. These extrema can be local, affecting only a portion of the data, or global, representing the absolute highest or lowest value in the dataset.
In continuous functions, peaks occur where the first derivative is zero and the second derivative is negative;
Methods to detect peaks and troughs include derivative-based approaches, zero-crossing analysis of the signal’s gradient, and
Applications span finance (identifying turning points in prices), meteorology (extreme weather indicators), engineering and signal processing