A method for tracking a position of a sensor includes generating a periodic magnetic field in a vicinity of the sensor, the field having a positive polarity phase and a negative polarity phase with respective constant positive and negative amplitudes. First and second field measurement signals are produced responsively to the magnetic field at the sensor during the positive and negative polarity phases, respectively. The position of the sensor is determined responsively to the first and second field measurement signals.