A method and apparatus for measuring and correlating a patient's heart activity with optical detection of the patient's blood flow. The method and apparatus permit more accurate determination of blood flow characteristics such as oxygen saturation and pulse rate. In a preferred embodiment, the heart activity is detected by monitoring the patient's EKG waveform, and the blood flow is detected by a non-invasive pulse oximeter. The occurrence of the R wave portion of the EKG signal is detected and the time delay by which an arterial pulse follows the R wave is determined to establish a time window in which an arterial is to be expected. The established time window provides the oximeter with a parameter enabling the oximeter to analyze the blood flow only when it is likely to present an arterial blood pulse for waveform analysis. The invention also includes adjusting the polarity of the detected EKG signal to have a preselected uniform upgoing or downgoing polarity.