VOOZH about

URL: https://www.geeksforgeeks.org/python/find-all-peaks-amplitude-lies-above-0-using-scipy/

⇱ Find all peaks amplitude lies above 0 Using Scipy - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Find all peaks amplitude lies above 0 Using Scipy

Last Updated : 23 Jul, 2025

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:

  • Import required module.
  • Find peaks inside a signal based on find_peaks() properties.
  • Label the graph.
  • Display Graph.

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:

👁 Image

Comment
Article Tags: