The technique you need to solve this problem is known in math under several names:
- signal analysis
- Fast Fourier Transforms
- signal detection
You have some Internet searching to do.
A lot of signal analysis is done by generating the Fourier Transform of your signal.
A Fourier transform takes your data list and generates a graph of the intensities of different frequency ranges in your data. In the case of your data, a Fourier transform graph would have a peak at 6 cycles per whatever unit of time you have in your x axis width. There would also be some smaller peaks at 12 cycles, for the little wiggles in your heart beats.
There are a bunch of Javascript FFT transforms available for free, but they require fitting into AI2 like is done in this FAQ:
(I collect them, but have not yet coded one.)
P.S. If you collect a sample interval's readings and post them here as a Comma Separated Values (CSV) row, that would make it possible for other board members to attempt and test solutions to your problem.