Getting BPM from AD8232 Analog output

Hello everybody,
I have AD8232 Heart Rate module for Aduino, I am getting proper output from the sensor - I am plotting those values in Serial plotter..

I want to know how to get BPM from the given output.? is there any readymade code available.?

Thank you

Here, i am attaching snippets of my DSO readings.
how should I modify my code to do the same??

That's quite easy. If the current value is more than 25 greater than the previous one you have a spike. Store the time (millis()) of it and when the next strike happens calculate the difference of the two times. The reciprocal value is the beats per millisecond. multiplicate by 60'000 and you get the BPM.