The period of a signal is the time measured between parts of it that repeat over and over. A ECG is measured in beats per minute (BPM). Right now my heart is beating at about 84 BPM. When I sleep it beats at about 58 BPM. When I am running fast it beats at about 130 BPM. After I had a heart attack I took a medicine that reduced my heart rate to 58 BPM when I was awake and about 40 BPM when sleeping. It made me feel dizzy (dying?) sometimes so I do not take it anymore. Now my heart performs perfectly.
It is simple to measure the period of the ECG signal with a clock. But since you want to use complicated math (or Matlab) to calculate it then you can enter Period Of a Signal in Google and see a You Tube video of how to do it in about 30 steps.
A clock will also simply show you shifts in the period of an ECG signal. But you can spend all day calculating it if you want.
Noise?? I have had many ECG tests done and there is almost no noise on the printout. I even wore a portable ECG machine one entire night and its printout the next day was perfect.
Your circuit must have an error to be picking up lots of noise. Please post your schematic with parts numbers.
A minute ago I searched Google Images for ECG Printout and hundreds of clear ones are shown. Only one was full of noise maybe because it used your defective circuit.
Why are you adding noise? The person being tested should not be sneezing all the time. With a properly designed circuit using an instrumentation amplifier IC like an AD620A and a right leg common-mode interference cancelling feed then the real noise is low.
EDIT: I forgot. The wires to the sensors should be shielded audio cables with the shields connected to the circuit's 0V, not ordinary electrical wiring wires.
Why are you adding noise? The person being tested should not be sneezing all the time. With a properly designed circuit using an instrumentation amplifier IC like an AD620A and a right leg common-mode interference cancelling feed then the real noise is low.
Heart rate measurement in presence of noise can be a realistic problem. Recent gym equipment often provides heart rate measurement, e.g. through hand electrodes. The ECG signal is superimposed by other muscle action potentials which can have a similar frequency range. ECG signal extraction is quite difficult under these conditions.
The gym equipment does not have a "right leg common-mode interference cancelling" circuit.
When I had many ECG's taken I was lying down and not moving. There were many more electrodes than just 2 or 3. Even the portable ECG machine I wore had many electrodes.