I have a simple home built pulse sensor that uses light from an LED to measure the opacity of my skin. As my heart beats the opacity of my skin goes up an down in a saw tooth like pattern. The frequency of this wave is my heat beat. The frequency is easy enough to find manually (by counting the peaks) but I want a mathematical solution so I can have a computer find my heart rate for me. Put in mathematical terms, I need to find the frequency of a noisy wave function. Also, because the sensor is affected by other light sources other than the LED the data may not be normalized. For example, the little peaks and troughs might represent my heartbeat but a big peak or trough might represent me turning a light on in the room, or shifting the sensor. Here is an example of what my data looks like (from another person's similar sensor): How could I go about doing this?