Skip to content
Advertisement

How to use values of find_peak function Python

I have to analyse a PPG signal. I found something to find the peaks but I can’t use the values of the heights. They are stored in like a dictionary array or something and I don’t know how to extract the values out of it. I tried using dict.values() but that didn’t work.

JavaScript

The PPG signal looks like this. To search for the peaks I used:

JavaScript

Printing:

JavaScript

Signal with highlighted peaks looks like this.

Advertisement

Answer

heights_peak_0 is the properties dict returned by scipy.signal.find_peaks

You can find more information about what is returned here

You can extract the array containing all the heights of the peaks with heights_peak_0["peak_heights"]

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement