Method for determining a first and a second detection threshold (T1, T2, T3, T4) for detecting a presence of teeth or tooth gaps of a position encoder upstream of a sensor, the method having the following steps: reading in a sensor signal which represents a time profile of a measured magnetic field when teeth and tooth gaps of the position encoder are guided past the sensor; characterized in that the method further has the following steps: determining a first value on the basis of a minimum value of the sensor signal, and a first value on the basis of a maximum value of the sensor signal within a predefined time interval from the sensor signal; calculating an absolute difference value which represents a predetermined percentage of a difference between the first value on the basis of the at least one maximum value and the first value on the basis of the at least one minimum value of the sensor signal; determining the detection threshold (T1, T2, T3, T4) such that the detection threshold represents a value which corresponds to a result of an addition of the absolute difference value and the first value on the basis of the minimum value of the sensor signal; determining a second value on the basis of a minimum value of the sensor signal and a second value on the basis of a maximum value of the sensor signal within a second predefined time interval succeeding the predefined time interval from the sensor signal; calculating a second absolute difference value which represents a second predetermined percentage of a difference between the second value on the basis of the maximum value and the second value on the basis of the minimum value of the sensor signal; and determining a second detection threshold (T2, T3, T4) different from the first detection threshold (T1; T2; T3) such that the second detection threshold (T2, T3, T4) represents a value which corresponds to a result of an addition of the second absolute difference value and the second value on the basis of the minimum value of the sensor signal. reading in a sensor signal which represents a time profile of a measured magnetic field when teeth and tooth gaps of the position encoder are guided past the sensor; characterized in that the method further has the following steps: determining a first value on the basis of a minimum value of the sensor signal, and a first value on the basis of a maximum value of the sensor signal within a predefined time interval from the sensor signal; calculating an absolute difference value which represents a predetermined percentage of a difference between the first value on the basis of the at least one maximum value and the first value on the basis of the at least one minimum value of the sensor signal; determining the detection threshold (T1, T2, T3, T4) such that the detection threshold represents a value which corresponds to a result of an addition of the absolute difference value and the first value on the basis of the minimum value of the sensor signal; determining a second value on the basis of a minimum value of the sensor signal and a second value on the basis of a maximum value of the sensor signal within a second predefined time interval succeeding the predefined time interval from the sensor signal; calculating a second absolute difference value which represents a second predetermined percentage of a difference between the second value on the basis of the maximum value and the second value on the basis of the minimum value of the sensor signal; and determining a second detection threshold (T2, T3, T4) different from the first detection threshold (T1; T2; T3) such that the second detection threshold (T2, T3, T4) represents a value which corresponds to a result of an addition of the second absolute difference value and the second value on the basis of the minimum value of the sensor signal. determining a first value on the basis of a minimum value of the sensor signal, and a first value on the basis of a maximum value of the sensor signal within a predefined time interval from the sensor signal; calculating an absolute difference value which represents a predetermined percentage of a difference between the first value on the basis of the at least one maximum value and the first value on the basis of the at least one minimum value of the sensor signal; determining the detection threshold (T1, T2, T3, T4) such that the detection threshold represents a value which corresponds to a result of an addition of the absolute difference value and the first value on the basis of the minimum value of the sensor signal; determining a second value on the basis of a minimum value of the sensor signal and a second value on the basis of a maximum value of the sensor signal within a second predefined time interval succeeding the predefined time interval from the sensor signal; calculating a second absolute difference value which represents a second predetermined percentage of a difference between the second value on the basis of the maximum value and the second value on the basis of the minimum value of the sensor signal; and determining a second detection threshold (T2, T3, T4) different from the first detection threshold (T1; T2; T3) such that the second detection threshold (T2, T3, T4) represents a value which corresponds to a result of an addition of the second absolute difference value and the second value on the basis of the minimum value of the sensor signal.