the method according to the invention in conjunction with an ecg measuring instrument and a magnetic resonance device is explained below with reference to fig2 and 3 . during an examination a patient having an attached ecg measuring instrument 10 is positioned in the magnetic resonance device 100 . the magnetic resonance device 100 and the ecg measuring instrument are in this case represented merely schematically as a block , since the basic layout consisting of magnet unit , radio - frequency coils , gradient coil unit , patient couch , and control units of a magnetic resonance device is well - known , as also is the basic layout of an ecg measuring instrument comprising ecg electrodes and amplifier / filter units for measuring a voltage between two ecg electrodes . according to the invention the magnetic resonance device 100 comprises in particular an ecg measuring instrument 10 , a processing unit 9 , a computing unit 8 and a memory unit 8 a . the separate or combined representation of said units is to be understood not necessarily physically , but rather as a separation or combination based on meaningful entities . the ecg measuring instrument 10 , the processing unit 9 , the computing unit 8 and the memory unit 8 a are connected to the magnetic resonance device 100 and to one another for the purpose of transmitting data . the ecg measuring instrument 10 is represented as comprising two ecg channels 1 and 2 . the method according to the invention can also be performed using ecg measuring instruments having more than two ecg channels , although , as will be explained in greater detail below , two ecg channels are already sufficiently suitable for a particularly reliable identification of r waves in ecg signals with little effort . in such an arrangement one ecg channel 1 , 2 outputs an ecg signal which the ecg measuring instrument determines from a voltage between two ecg electrodes ( not shown ) attached to the patient . in an advantageous embodiment variant , in a first step 201 one reference ecg signal is measured at each of the channels 1 and 2 of the ecg measuring instrument 10 . in this case the reference ecg signals are advantageously recorded in an environment that is not disrupted by external influences , e . g . in the magnet of the magnetic resonance device 100 , without gradient fields being switched on in the magnetic resonance device 100 . in a further step 203 a , the r wave is identified in each reference ecg signal , e . g . in one of the ways known in the prior art . next ( step 203 b ), there is determined from the reference ecg signals at least one reference quantity which the reference ecg signal assumes in a time interval which advantageously starts before the r wave of the ecg signal and lasts at a maximum up to the time of the occurrence of the r wave . thus , the reference quantity can also be a variation of a quantity determined from the ecg signal over a period of time in the time interval . the reference quantity can also be determined in some other way , although by means of such a determination of the reference quantity it can be ensured that the reference quantity can be compared particularly effectively with an ecg signal measured later on the same patient by means of the same ecg measuring instrument , since a great similarity is to be expected between the reference ecg signals and the subsequently measured current ecg signals . in this case the size of the time interval can be specified with a large degree of freedom . in an advantageous exemplary embodiment , the time interval lies e . g . within the rise of the ecg signal between the points designated by “ q ” and “ r ” ( see fig1 ). if more than one ecg channel 1 , 2 is recorded , the time interval advantageously begins as soon as the start of the rise between “ q ” and “ r ” is detected in one of the channels 1 , 2 , and ends as soon as the end of said rise is detected in the last of the channels 1 , 2 . this means that the time interval has a duration in the order of approx . 12 to 20 milliseconds , max . 50 to 60 milliseconds , before the r wave . with such a choice of time interval , the further analysis of ecg signals within the time interval can be effectively accomplished owing to the particularly distinctive signal waveform there , e . g . owing to a relatively large amplitude there and a relatively large first derivative of the signal waveform there , as described below . in this case a reference quantity can be determined e . g . as illustrated schematically in fig3 . the ecg signals 3 . 1 and 3 . 2 acquired from the channels 1 and 2 are supplied to a processing unit 9 which is embodied for the purpose of further processing the ecg signals . thus , on the one hand the ecg signal 3 . 1 , 3 . 2 , provided it lies in the time interval , can be stored as a possible reference quantity in a memory unit 8 a as it was supplied to the processing unit 9 . the reference quantity is therefore simply a signal value over time , i . e . a signal waveform , of a channel of the ecg measuring instrument . where appropriate , instead of the entire variation of the ecg signal 3 . 1 , 3 . 2 in the time interval being stored as a reference quantity , only parts of the same will be stored , e . g . individual measurement points in the time characteristic . basically , however , maximally comprehensive signal waveforms from the time interval are to be preferred as a more reliable reference quantity over individual measurement points if only on account of the greater volume of data and the averaging over the data that is possible thereby . furthermore , such an averaging can also be performed over a plurality of recorded signal waveforms of reference ecg signals . an ecg signal 3 . 1 , 3 . 2 in the processing unit 9 is advantageously supplied to a derivative forming unit 4 which forwards the time derivative of the respective ecg signal 3 . 1 , 3 . 2 as a reference quantity to the memory unit 8 a . storing said time derivative as a reference quantity is possible in addition or alternatively to the storing of the ecg signal 3 . 1 , 3 . 2 itself as a reference quantity . in this case , in addition to a first time derivative of the respective ecg signal 3 . 1 , 3 . 2 , a second time derivative of the respective ecg signal 3 . 1 , 3 . 2 can also be calculated by the derivative forming unit 4 and forwarded to the memory unit 8 a . an advantage of the use of the respective first and , where applicable , second time derivatives of the described quantities is that these are not subject to possible offset fluctuations . in further steps a first comparison rule ( 203 c ) and a second comparison rule ( 203 d ) are created from the stored reference quantities . this happens in a computing unit 8 which has access to the reference quantities stored in the memory unit 8 a and to which subsequently measured ecg signals can be routed , in processed form if necessary . as their result the comparison rules specify how subsequently measured ecg signals in which an r wave is to be identified must correlate with the reference quantities when an r wave is present . a first comparison rule can include the use of an optimal filter and output of a similarity value as result . an optimal filter , also referred to as a “ matched filter ” ( mf ), determines the similarity of a curve , in this case e . g . of the waveform of the subsequently measured ecg signal or of a value of the ecg signal corresponding to a reference quantity in the time interval , in this case δt , as a comparative value , with a predefined curve , in this case a reference quantity , e . g . the waveform of the first time derivative of the reference ecg signals . mathematically , this advantageously happens through forming of the correlation between reference quantity and corresponding quantity , e . g . advantageously according to the following formula : mf ⁡ ( τ ) = α · ∑ t = 0 δ ⁢ ⁢ t ⁢ x ⁡ ( τ - δ ⁢ ⁢ t + t ) · lx * ⁡ ( t ) , where lx ( t ) is the reference quantity , x ( t ) is the measured corresponding comparative value , each of which is represented as a complex - value quantity , δt is the time interval , and α is a normalization factor which ensures that mf ( τ ) is equal to one if x ( t ) is identical to the previously determined reference quantity lx ( τ ). as is customary with complex numbers , the “*” signifies that the conjugate - complex quantity is used . an advantageous choice of the normalization factor is the reciprocal sum of the squared reference quantity values over the time interval . this value can also be described as the “ energy ” of the reference quantity in the time interval . a positive result of said comparison criterion is therefore a comparative value equal to one ( ideal value ) or a value which deviates from one at a maximum by a predefinable small threshold value ε u downward or ε o upward . in this case the upper and lower threshold ε o and ε u , respectively , can be chosen according to the desired precision . it has been shown that changes in the measurement conditions cause changes in the measured ecg signals and consequently also in quantities derived from the measured ecg signals . an example is shown in fig4 , where a trajectory of the first time derivative of an ecg signal ( dch 1 ) measured at a first channel of an ecg measuring instrument is plotted against the first time derivative of an ecg signal ( dch 2 ) measured at a second channel of the ecg measuring instrument . as can be seen , the trajectory includes a large loop s on which the point a marks an r wave which , following entry of the change in the measurement conditions , in this case a change in the patient &# 39 ; s breathing , is tilted by an angle α and now runs in the loop s ′, as a result of which an r wave is now represented by the point b . points a and b can thus be transferred into one another by way of a rotation through the angle α . if the reference quantity “ first time derivative of the ecg signal ” was determined in this case prior to the change in the measurement conditions , then it is expected that an r wave will be present again when the time derivative of the current ecg signal lies on the point a and the r waves lying on point b after the change will no longer be detected properly . the comparison of such a reference quantity with such a current corresponding value with the above optimal filter yields , not the ideal value one (“ 1 ”), but exp ( i *− α )), where i is the so - called imaginary unit , i . e . i =√{ square root over (− 1 )}. in order nonetheless to obtain a positive result of the optimal filter comparison criterion in this case , instead of the above requirement for the comparative value to be directly equal to one ( ideal value ) or a value that deviates at a maximum by a predefinable small threshold value ε u downward or ε o upward from one , it can be required that the amount of the above comparative value , i . e . | mf ( τ )|, fulfills this requirement , since | exp ( i * r )|= 1 , for all real numbers r . in this case the first comparison rule therefore includes the use of an optimal filter and output of the amount of a similarity value as result . alternatively or in addition it can be required , for a positive result of the comparison , that the angle α shall not exceed an upper limit α_o and shall not fall below a lower limit α_u . if the angle determined using the optimal filter is too great , this indicates in turn that no r wave is in fact present , since the changes in the ecg signal due to the changes in the measurement conditions are usually not serious ones . in step 203 d , a second comparison rule can now be applied which includes determining a deviation of the reference quantity from a corresponding quantity of the measured ecg signal multiplied by a factor that is dependent on the similarity value . this can advantageously take place in that the reference quantities are processed in such a way that e . g . the sum over the error squares of quantities of the measured ecg signal corresponding to the reference quantities multiplied by exp ( i * β ) is determined with respect to the reference quantities . the sum of the error squares is accordingly determined e . g . via the following formula : sumq ⁡ ( τ ) = α s · ∑ t = 0 δ ⁢ ⁢ t ⁢ (  x ⁡ ( τ - δ ⁢ ⁢ t + t ) · exp ⁡ ( ⅈ · β ) - lx ⁡ ( t )  ) 2 , where lx ( t ) is the reference quantity ( time derivative of the reference ecg signal ), x ( t ) is the measured corresponding comparative quantity , δt is the time interval , and α s is a normalization factor which ensures that sumq ( τ ) is equal to zero if x ( t )* exp ( i * β ) is identical to the previously determined reference quantity lx ( τ ). in this example the measured ecg signal is therefore multiplied by a factor that is dependent on the similarity value , a complex number exp ( i * β ). in this case the argument β of the complex number in its exponential exp ( i * β ) is advantageously dependent for example as follows on the angle α defined by the similarity value , and hence on the similarity value : β = α can be set if the angle α does not exceed an upper limit α_o and does not fall below a lower limit α_u and otherwise β = 0 . the result of this is that in the case of small tilts of the trajectory the comparison via a deviation also takes said tilting into account , but in the case of excessively large tilts , which indicate that in fact no r wave is present , a “ normal ” comparison is performed , without taking into account possible tilts ( exp ( i · 0 )= 1 ). in this case an advantageous choice of the normalization factor is once again the reciprocal sum of the squared reference quantity values over the time interval . this value can also be referred to as the “ energy ” of the reference quantity in the time interval . a positive result of this comparison criterion is therefore a value equal to zero ( ideal value ) or a value which deviates from zero at a maximum by a predefinable small threshold value ε . another type of error calculation , such as e . g . determining the simple error , for deter wining the deviation is likewise conceivable , depending on the desired precision . the respective advantages and disadvantages of different error calculations are well - known . a measurement of a reference ecg signal and the steps up to the formulation of the comparison rules ( 201 , 203 a , b , c , d ) are advantageously performed each time after the ecg measuring instrument 10 is attached to the patient before the planned measurements by means of the magnetic resonance device 100 and requiring triggering are performed . in particular a reference ecg signal is repeatedly measured after the ecg measuring instrument 10 is attached to the patient positioned on an examination couch of the magnetic resonance device until such time as the patient and with him / her the ecg measuring instrument 10 are disturbed by the electromagnetic fields of the magnetic resonance device 100 . in this way it is possible to determine particularly up - to - date reference quantities after the contacting of the ecg measuring instrument 10 with the patient has been stabilized to the greatest possible extent and no disrupting interference effects of the magnetic field of the magnetic resonance device on the ecg measuring instrument 10 are as yet present . further comparison rules , such as e . g . comparisons of magnitudes or angles determined as reference quantities from the reference signal with corresponding magnitudes and angles of the current ecg signal , are conceivable which can be interrogated in parallel in order to make the detection of the r wave by means of the thus even stronger checking of the current ecg signal even more reliable . storing a plurality of reference quantities and using them for creating comparison rules also increases the flexibility and stability of the method . it may , however , also suffice to evaluate only one reference quantity , e . g . the time derivative , in particular the first time derivative of the ecg signal values . once the reference quantities are known and the comparison rules have been specified , the actual ecg measurement that is intended to be used for triggering further measurements or examinations , e . g . by means of the magnetic resonance device , is started ( step 205 ). from the ecg signals measured during this process , comparative values corresponding to the reference quantities are determined analogously to the procedure for determining the reference quantities described with reference to fig3 ( step 205 a ). these comparative values ( e . g . first time derivative of the signal values ) are compared with the reference values on the basis of at least one first comparison rule and one second comparison rule that is dependent on a result of the first comparison rule ( step 207 ). furthermore advantageously , prior to the determination of the comparative values ( cf . fig3 ) reference ecg signals and ecg signals measured prior to the determination of the reference quantities are supplied to a smoothing filter 11 , for example a lowpass filter , which cleans the ecg signals e . g . of high - frequency interference . using “ smoothed ” reference values and comparative values obtained in this way , the above - described steps 203 c , 207 and 209 can be performed analogously , in particular in addition . a condition for the issuing of a trigger signal can be that both the results of the above - described comparison with the unsmoothed values and the results of said “ smoothed ” comparison must be positive ( conjunctive function ; “ and ”); alternatively , the results of the two comparisons can be drawn upon using a disjunctive function (“ or ”) as a condition for the issuing of a trigger signal . using such a smoothing filter 11 does in fact lengthen the duration of the method overall . the disadvantage of this longer duration , which lies in the order of approx . 2 to 3 milliseconds , must if necessary be weighed against the advantage of having interference - free signals for the evaluation . if at least the results of the first and second comparison rule are positive , in a final step 209 a trigger signal is issued which is supplied to the magnetic resonance device and there triggers a measurement , e . g . an acquisition of an image of an organ . other conditions that must be fulfilled before a trigger signal is issued are conceivable as a further measure to avoid triggering errors . thus , for example , it can be required that the issuing of a trigger signal in step 209 takes place only if in addition , following confirmation of a sufficient number of positive results of the already described criteria , the first time derivative of at least one measured ecg signal value deviates at a maximum only by a small , predefinable threshold value from zero . the existence of an extreme value in the measured signal waveform is identified by means of such an extreme condition . in this way the time instant at which an r wave is present , since at that point such an extreme value , a maximum , is present , can be determined particularly precisely , and consequently the trigger signal can be issued particularly precisely . as a further condition for the issuing of a trigger signal , e . g . also in the case described in the last paragraph , a trigger signal can be released only if a predefinable maximum duration between a confirmation of a sufficient number of positive results on the one hand and the identification of an extreme value in the measured signal on the other hand is not exceeded . such a maximum duration is advantageously less than or equal to the already described time interval , particularly advantageously in the order of approx . 15 milliseconds .