Apparatus is provided for tracking an object in a body of a patient in the
presence of an interfering article. A set of one or more radiators are
adapted to generate an energy field at a fundamental frequency in a
vicinity of the object. A position sensor, fixed to the object, is
adapted to generate a signal responsive to the energy field. A control
unit has access to a database of one or more harmonic frequency patterns
associated with one or more respective specific types of interfering
articles. The control unit is adapted to (a) receive the signal, (b)
detect a pattern of harmonic frequencies of the fundamental frequency
present in the signal responsive to an interaction of the interfering
article with the energy field, (c) compare the pattern to harmonic
frequency patterns stored in the database, (d) identify the interfering
article responsive to the comparison, (e) correct the signal responsive
to the identification of the interfering article and a magnitude of one
or more of the harmonic frequencies in the detected pattern, and (f)
determine position coordinates of the object responsive to the corrected
signal.