Skip to main content
. Author manuscript; available in PMC: 2019 Jan 1.
Published in final edited form as: IEEE Trans Biomed Eng. 2017 Apr 12;65(1):52–63. doi: 10.1109/TBME.2017.2688919

Algorithm 1.

Joint magnetic calibration and localization

Input: The number of iterations L, the stop threshold δ of EM algorithm, the recorded magnetic field data Y = {y}t=1:T, initial sensor parameters Ωs0={G0,b0,H0,s}, initial prior distribution Ωp0={m00,P00} and initial noise covariances Ωc0={Q0,R0}. Hf = 0.
  1: for n = 1 : L do
  2:  Run URTSS with Y and {Ωsn1,Ωpn1,Ωcn1} to estimate Xn1={mts,Pts}t=1:Tn1;
  3:   Update {Ωpn1,Ωcn1} to {Ωpn,Ωcn} with respect to Ωsn1, Y and Xn−1 according to (9)–(13);
  4: if Hf = 0 then
  5:   Update Ωsn1 to Ωsn by computing {Gn, bn} with respect to Rn, Hn−1, Y and Xn−1 according to (15);
  6: else
  7:   Update Ωsn1 to Ωsn by alternately optimizing {G, b} and H based on curvilinear search according to (15), (17), (18) and (20).
  8: end if
  9:  Compute the J(n) = [E(log(L)]n with respect to {Ωsn,Ωpn,Ωcn}, Y and Xn−1 according to (8);
10: if n > 1, Hf = 1 and |J(n)J(n1)J(n1)|<δ then
11:   break, end;
12: end if
13: if n > 1, Hf = 0 and |J(n)J(n1)J(n1)|<δ then
14:   break or Hf = 1 (optional), end;
15: end if
16: end for
Output: The optimized {Ωs, Ωp, Ωc} and X.