  The magnetic near-field provides a suitable means for indoor localization,
due to its insensitivity to the environment and strong spatial gradients. We
consider indoor localization setups consisting of flat coils, allowing for
convenient integration of the agent coil into a mobile device (e.g., a smart
phone or wristband) and flush mounting of the anchor coils to walls. In order
to study such setups systematically, we first express the Cram\'er-Rao lower
bound (CRLB) on the position error for unknown orientation and evaluate its
distribution within a square room of variable size, using 15 x 10cm anchor
coils and a commercial NFC antenna at the agent. Thereby, we find cm-accuracy
being achievable in a room of 10 x 10 x 3 meters with 12 flat wall-mounted
anchors and with 10mW used for the generation of magnetic fields. Practically
achieving such estimation performance is, however, difficult because of the
non-convex 5D likelihood function. To that end, we propose a fast and accurate
weighted least squares (WLS) algorithm which is insensitive to initialization.
This is enabled by effectively eliminating the orientation nuisance parameter
in a rigorous fashion and scaling the individual anchor observations, leading
to a smoothed 3D cost function. Using WLS estimates to initialize a
maximum-likelihood (ML) solver yields accuracy near the theoretical limit in up
to 98% of cases, thus enabling robust indoor localization with unobtrusive
infrastructure, with a computational efficiency suitable for real-time
processing.
