![]() |
VOOZH | about |
Prerequisites: Matplotlib, Scipy
In this article, we will see how to find all 'x' point above 0 with the help of find_peaks( ) function, that takes a 1-D array and finds all local maxima by a simple comparison of neighboring values.
Approach:
Step 1: Import all libraries.
Step 2: electrocardiogram(): The returned signal is a 5-minute-long electrocardiogram (ECG), a medical recording of the heart’s electrical activity, sampled at 360 Hz.
Syntax:
scipy.signal.find_peaks(x, height=None)
Parameter:
- x: A signal with peaks.
- height: Required height of peaks. Either a number, None,
Return:
peaks: Indices of peaks in x that satisfy all given conditions.
peak_heights: If the height is given, the height of each peak is x.
Below is the full Implementation:
Output: