a method for identifying r waves in an ecg signal is proposed . an ecg measuring instrument measures ecg signals of a patient in which r waves are to be detected . the measured ecg signals are compared with respective reference quantities based on at least two comparison rules . the second comparison rule is dependent on a result of a first comparison conducted according to a first comparison rule . a signal that an r wave has been detected is issued if the first and the second comparison rules are fulfilled . making the second comparison rule dependent on the result of the first comparison rule enables an adept response to changes of measurement conditions . these changes can be taken into account in further comparisons . therefore the detection of r waves in an ecg signal can be optimized , leading to an improvement in the image quality in ecg - triggered mr examinations .