Abstract:
A magnetic field sensor generates signal components corresponding to an uncalibrated representation of a sensed magnetic field in a three-dimensional coordinate system. A reader coupled to the magnetic field sensor determines a center offset based on received signal components, adjusts the received signal components based on the determined center offset, and applies Kalman filtering to the adjusted signal components, generating a set of ellipsoid parameters. The reader generates calibrated signal components based on the determined center offset and the generated set of ellipsoid parameters.

Description:
BACKGROUND 
       [0001]    Technical Field 
         [0002]    The description relates to magnetic field sensing devices and to calibration of field sensing devices such as e.g., magnetometers, compasses, sensor HUBs. 
         [0003]    Description of the Related Art 
         [0004]    When adequately calibrated, a magnetic field sensing device such as e.g., a magnetometer may sense the magnetic field of the earth (around 0.5 Gauss) with no additional contributions. However, local disturbances may exist in an ambient magnetic field due e.g., to nearby magnetic fields generated by electrical currents and nearby magnetic objects, such as ferrous or high permeability materials. 
         [0005]    These local disturbances may produce two types of distortions, known as hard-iron offsets and soft-iron distortions. 
       BRIEF SUMMARY 
       [0006]    In an embodiment, a method comprises: receiving signal components of a magnetic field sensing device, the signal components corresponding to an uncalibrated representation of a sensed magnetic field in a three-dimensional coordinate system; determining a center offset based on the received signal components; adjusting the signal components based on the determined center offset; applying Kalman filtering to the adjusted signal components, generating a set of ellipsoid parameters; and generating calibrated signal components based on the determined center offset and the generated set of ellipsoid parameters. In an embodiment, the method comprises: estimating a gain of the received signal components; and tuning the Kalman filtering based on the estimated gain of the signal components. In an embodiment, the generated calibrated signal components correspond to a centered, spherical magnetic field in the three-dimensional coordinate system. In an embodiment, the generating calibrated signal components comprises: translating an ellipsoid center corresponding to the ellipsoid parameters to an origin of the three-dimensional coordinate system; rotating axes corresponding to the ellipsoid parameters to align with axes of the three-dimensional coordinate system; scaling the ellipsoid parameters to define a sphere; and rotating axes of the defined sphere to align with a pre-rotation orientation of the axes corresponding to the ellipsoid parameters. In an embodiment, with said ellipsoid parameters defining an ellipsoid in quadratic form as: 
         [0000]    
       
         
           
             
               
                 ax 
                 2 
               
               + 
               
                 2 
                  
                 bxy 
               
               + 
               
                 2 
                  
                 cxz 
               
               + 
               
                 dy 
                 2 
               
               + 
               
                 2 
                  
                 eyz 
               
               + 
               
                 fz 
                 2 
               
               + 
               
                 2 
                  
                 gx 
               
               + 
               
                 2 
                  
                 hy 
               
               + 
               
                 2 
                  
                 iz 
               
               + 
               l 
             
             = 
             0 
           
         
       
       
         
           
             B 
             = 
             
               [ 
               
                 
                   
                     a 
                   
                   
                     b 
                   
                   
                     c 
                   
                 
                 
                   
                     b 
                   
                   
                     d 
                   
                   
                     e 
                   
                 
                 
                   
                     c 
                   
                   
                     e 
                   
                   
                     f 
                   
                 
               
               ] 
             
           
         
       
     
         [0000]    and with m1, m2, m3 representing respective received signal components in the three-dimensional coordinate system as follows: 
         [0000]    
       
         
           
             
               
                 - 
                 m 
               
                
               
                   
               
                
               
                 1 
                 2 
               
             
             = 
             
               
                 
                   d 
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 
                   2 
                   2 
                 
               
               + 
               
                 
                   f 
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 
                   3 
                   2 
                 
               
               + 
               
                 
                   
                     2 
                      
                     g 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 1 
               
               + 
               
                 
                   
                     2 
                      
                     h 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 2 
               
               + 
               
                 
                   
                     2 
                      
                     i 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 3 
               
               + 
               
                 l 
                 a 
               
               + 
               
                 
                   
                     2 
                      
                     b 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 1 
                  
                 m 
                  
                 
                     
                 
                  
                 2 
               
               + 
               
                 
                   
                     2 
                      
                     c 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 1 
                  
                 m 
                  
                 
                     
                 
                  
                 3 
               
               + 
               
                 
                   
                     2 
                      
                     e 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 2 
                  
                 m 
                  
                 
                     
                 
                  
                 3 
               
             
           
         
       
       
         
           
             
                 
             
              
             
               
                 z 
                 n 
               
               = 
               
                 
                   - 
                   m 
                 
                  
                 
                     
                 
                  
                 
                   1 
                   2 
                 
               
             
           
         
       
       
         
           
             
               H 
               n 
             
             = 
             
               [ 
               
                 
                   
                     
                       m 
                        
                       
                           
                       
                        
                       
                         2 
                         2 
                       
                     
                   
                   
                     
                       m 
                        
                       
                           
                       
                        
                       
                         3 
                         2 
                       
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       1 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       2 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       3 
                     
                   
                   
                     1 
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       1 
                        
                       m 
                        
                       
                           
                       
                        
                       2 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       1 
                        
                       m 
                        
                       
                           
                       
                        
                       3 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       3 
                     
                   
                 
               
               ] 
             
           
         
       
       
         
           
             
               X 
               n 
             
             = 
             
               [ 
               
                 
                   
                     
                       X 
                        
                       
                         ( 
                         0 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         1 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         2 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         3 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         4 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         5 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         6 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         7 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         8 
                         ) 
                       
                     
                   
                 
               
               ] 
             
           
         
       
       
         
           
             
                 
             
              
             
               zres 
               = 
               
                 
                   
                     z 
                     n 
                   
                   - 
                   
                     z 
                     n 
                     ′ 
                   
                 
                 = 
                 
                   
                     z 
                     n 
                   
                   - 
                   
                     
                       H 
                       n 
                     
                      
                     
                       X 
                       
                         n 
                         - 
                         1 
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    said applying Kalman filter includes:
 
predicting values
 
         [0000]    
       
      
       X′ 
       n 
       =X 
       n-1  
      
     
         [0000]    
       
      
       P′ 
       n 
       =P 
       n-1 
       +Q  
      
     
         [0000]    
       
      
       z′ 
       n 
       =H 
       n 
       X′ 
       n  
      
     
         [0000]    and
 
correcting values
 
         [0000]        k   n   =P′   n   H   n   l ( H   n   P′   n   H   n   T   +R ) 
         [0000]        X   n   =X′   n   +k   n ( z   n   −z′   n ) 
         [0000]        P   n =( l−k   n   H   n ) P′   n    
         [0007]    In an embodiment, the method comprises: applying to said received signal components at least one of: filtering; derivative filtering of a FIR type; averaging; exponential smoothed averaging; comparing absolute values of said received signal components to upper value thresholds, said upper value thresholds being reached being indicative of a starting of movement of the magnetic field sensing device; comparing absolute values of said received signal components to lower value thresholds, said lower value thresholds being reached being indicative of a stopping of movement of the magnetic field sensing device; and selectively applying said Kalman filtering based on detecting movement of the magnetic field sensing device. In an embodiment, the method comprises: detecting movement of the magnetic field sensing device; storing values of said received signal components from the magnetic field sensing device upon detecting movement of the magnetic field sensing device; and subtracting the values stored from subsequently received signal components prior to applying said Kalman filtering. In an embodiment, the method comprises: adjusting the determined center component based on said stored values before generating the calibrated signal components. In an embodiment, the method comprises: estimating the gain of said received signal components based on a difference of maximum and minimum values of said received signal components. In an embodiment, the method comprises: comparing a difference between signal components predicted based on the Kalman filtering and current received signal components to an anomaly threshold; discontinuing Kalman filtering when the difference reaches the anomaly threshold; and resuming Kalman filtering when movement of the magnetic field sensing device from a rest position is detected. 
         [0008]    In an embodiment, a device comprises: an input, which, in operation, receives signal components of a magnetic field sensing device, the signal components corresponding to an uncalibrated representation of a sensed magnetic field in a three-dimensional coordinate system; and circuitry coupled to the input, wherein the circuitry, in operation: determines a center offset based on the received signal components; adjusts the signal components based on the determined center offset; applies Kalman filtering to the adjusted signal components, generating a set of ellipsoid parameters; and generates calibrated signal components based on the determined center offset and the generated set of ellipsoid parameters. In an embodiment, the circuitry, in operation: estimates a gain of the received signal components; and tunes the Kalman filtering based on the estimated gain of the signal components. In an embodiment, the generated calibrated signal components correspond to a centered, spherical magnetic field in the three-dimensional coordinate system. In an embodiment, the circuitry, in operation, generates the calibrated signal components by: translating an ellipsoid center corresponding to the ellipsoid parameters to an origin of the three-dimensional coordinate system; rotating axes corresponding to the ellipsoid parameters to align with axes of the three-dimensional coordinate system; scaling the ellipsoid parameters to define a sphere; and rotating axes of the defined sphere to align with a pre-rotation orientation of the axes corresponding to the ellipsoid parameters. In an embodiment, the circuitry, in operation applies to said received signal components at least one of: filtering; derivative filtering of a FIR type; averaging; exponential smoothed averaging; comparing absolute values of said received signal components to upper value thresholds, said upper value thresholds being reached being indicative of a starting of movement of the magnetic field sensing device; comparing absolute values of said received signal components to lower value thresholds, said lower value thresholds being reached being indicative of a stopping of movement of the magnetic field sensing device; and selectively applying said Kalman filtering based on detecting movement of the magnetic field sensing device. In an embodiment, the circuitry, in operation: detects movement of the magnetic field sensing device; stores values of said received signal components from the magnetic field sensing device upon detecting movement of the magnetic field sensing device; and subtracts the values stored from subsequently received signal components prior to applying said Kalman filtering. In an embodiment, the circuitry, in operation: adjusts the determined center component based on said stored values before generating the calibrated signal components. In an embodiment, the circuitry, in operation: compares a difference between signal components predicted based on Kalman filtering and current received signal components to an anomaly threshold; discontinues Kalman filtering when the difference reaches the anomaly threshold; and resumes Kalman filtering in response to detecting movement of the magnetic field sensing device from a rest position. 
         [0009]    In an embodiment, a system comprises: a magnetic field sensor configured to generate signal components corresponding to an uncalibrated representation of a sensed magnetic field in a three-dimensional coordinate system; and reading circuitry coupled to the magnetic field sensor and configured to: determine a center offset based on received signal components; adjust the received signal components based on the determined center offset; apply Kalman filtering to the adjusted signal components, generating a set of ellipsoid parameters; and generate calibrated signal components based on the determined center offset and the generated set of ellipsoid parameters. In an embodiment, the reading circuitry is configured to: estimate a gain of the received signal components; and tune the Kalman filtering based on the estimated gain of the signal components. In an embodiment, the generated calibrated signal components correspond to a centered, spherical magnetic field in the three-dimensional coordinate system. In an embodiment, the reading circuitry is configured to generate the calibrated signal components by: translating an ellipsoid center corresponding to the ellipsoid parameters to an origin of the three-dimensional coordinate system; rotating axes corresponding to the ellipsoid parameters to align with axes of the three-dimensional coordinate system; scaling the ellipsoid parameters to define a sphere; and rotating axes of the defined sphere to align with a pre-rotation orientation of the axes corresponding to the ellipsoid parameters. 
         [0010]    In an embodiment, a non-transitory computer-readable medium&#39;s contents configure a magnetic field sensor reading device to perform a method, the method comprising: determining a center offset based on signal components generated by a magnetic field sensing device, the signal components corresponding to an uncalibrated representation of a sensed magnetic field in a three-dimensional coordinate system; adjusting the signal components based on the determined center offset; applying Kalman filtering to the adjusted signal components, generating a set of ellipsoid parameters; and generating calibrated signal components based on the determined center offset and the generated set of ellipsoid parameters. In an embodiment, the method comprises: estimating a gain of the received signal components; and tuning the Kalman filtering based on the estimated gain of the signal components. In an embodiment, generating the calibrated signal components comprises: translating an ellipsoid center corresponding to the ellipsoid parameters to an origin of the three-dimensional coordinate system; rotating axes corresponding to the ellipsoid parameters to align with axes of the three-dimensional coordinate system; scaling the ellipsoid parameters to define a sphere; and rotating axes of the defined sphere to align with a pre-rotation orientation of the axes corresponding to the ellipsoid parameters. 
         [0011]    In an embodiment, a method of calibrating a magnetic field sensing device, wherein calibrated sensing signal components represented in a three-dimensional coordinate system by a spherical graph centered at the origin of said three-dimensional coordinate system are generated from uncalibrated signal components from said magnetic field sensing device represented in said three-dimensional coordinate system by an ellipsoidal graph having a center offset with respect to the origin of said three-dimensional coordinate system, includes applying to said sensing signal components Kalman filter processing yielding a set of parameters fitting said ellipsoidal graph by prediction and correction based on said prediction. In an embodiment, the method includes processing said set of parameters fitting said ellipsoidal graph obtained from Kalman filter processing by: a) translating the center of said ellipsoidal graph towards the origin of said three-dimensional coordinate system, b) rotating said ellipsoidal graph to align the axes thereof with the sensing device axes, c) scaling the ellipsoidal graph to a sphere, and d) back-rotating the sphere resulting from scaling to the orientation of said ellipsoidal graph before said rotation under b). In an embodiment, said ellipsoidal graph is expressed in quadratic form as: 
         [0000]    
       
         
           
             
               
                 ax 
                 2 
               
               + 
               
                 2 
                  
                 bxy 
               
               + 
               
                 2 
                  
                 cxz 
               
               + 
               
                 dy 
                 2 
               
               + 
               
                 2 
                  
                 eyz 
               
               + 
               
                 fz 
                 2 
               
               + 
               
                 2 
                  
                 gx 
               
               + 
               
                 2 
                  
                 hy 
               
               + 
               
                 2 
                  
                 iz 
               
               + 
               l 
             
             = 
             0 
           
         
       
       
         
           
             B 
             = 
             
               [ 
               
                 
                   
                     a 
                   
                   
                     b 
                   
                   
                     c 
                   
                 
                 
                   
                     b 
                   
                   
                     d 
                   
                   
                     e 
                   
                 
                 
                   
                     c 
                   
                   
                     e 
                   
                   
                     f 
                   
                 
               
               ] 
             
           
         
       
     
         [0000]    by denoting as m1, m2, m3 the X, Y, Z sensing signal components: 
         [0000]    
       
         
           
             
               
                 - 
                 m 
               
                
               
                   
               
                
               
                 1 
                 2 
               
             
             = 
             
               
                 
                   d 
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 
                   2 
                   2 
                 
               
               + 
               
                 
                   f 
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 
                   3 
                   2 
                 
               
               + 
               
                 
                   
                     2 
                      
                     g 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 1 
               
               + 
               
                 
                   
                     2 
                      
                     h 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 2 
               
               + 
               
                 
                   
                     2 
                      
                     i 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 3 
               
               + 
               
                 l 
                 a 
               
               + 
               
                 
                   
                     2 
                      
                     b 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 1 
                  
                 m 
                  
                 
                     
                 
                  
                 2 
               
               + 
               
                 
                   
                     2 
                      
                     c 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 1 
                  
                 m 
                  
                 
                     
                 
                  
                 3 
               
               + 
               
                 
                   
                     2 
                      
                     e 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 2 
                  
                 m 
                  
                 
                     
                 
                  
                 3 
               
             
           
         
       
       
         
           
             
                 
             
              
             
               
                 z 
                 n 
               
               = 
               
                 
                   - 
                   m 
                 
                  
                 
                     
                 
                  
                 
                   1 
                   2 
                 
               
             
           
         
       
       
         
           
             
               H 
               n 
             
             = 
             
               [ 
               
                 
                   
                     
                       m 
                        
                       
                           
                       
                        
                       
                         2 
                         2 
                       
                     
                   
                   
                     
                       m 
                        
                       
                           
                       
                        
                       
                         3 
                         2 
                       
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       1 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       2 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       3 
                     
                   
                   
                     1 
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       1 
                        
                       m 
                        
                       
                           
                       
                        
                       2 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       1 
                        
                       m 
                        
                       
                           
                       
                        
                       3 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       3 
                     
                   
                 
               
               ] 
             
           
         
       
       
         
           
             
               X 
               n 
             
             = 
             
               [ 
               
                 
                   
                     
                       X 
                        
                       
                         ( 
                         0 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         1 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         2 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         3 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         4 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         5 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         6 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         7 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         8 
                         ) 
                       
                     
                   
                 
               
               ] 
             
           
         
       
       
         
           
             
                 
             
              
             
               zres 
               = 
               
                 
                   
                     z 
                     n 
                   
                   - 
                   
                     z 
                     n 
                     ′ 
                   
                 
                 = 
                 
                   
                     z 
                     n 
                   
                   - 
                   
                     
                       H 
                       n 
                     
                      
                     
                       X 
                       
                         n 
                         - 
                         1 
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    said Kalman filter processing includes 
         [0012]    predicting values 
         [0000]    
       
      
       X′ 
       n 
       =X 
       n-1  
      
     
         [0000]    
       
      
       P′ 
       n 
       =P 
       n-1 
       +Q  
      
     
         [0000]    
       
      
       z′ 
       n 
       =H 
       n 
       X′ 
       n  
      
     
         [0000]    and 
         [0013]    correcting values 
         [0000]        k   n   =P′   n   H   n   l ( H   n   P′   n   H   n   T   +R ) 
         [0000]        X   n   =X′   n   +k   n ( z   n   −z′   n ) 
         [0000]        P   n =( l−k   n   H   n ) P′   n    
         [0014]    In an embodiment, the method includes: applying to said sensing signal components at least one of filtering, derivative filtering of the FIR type, and averaging, exponential smoothed averaging, and/or checking said sensing signal components against upper value thresholds, said upper value thresholds being reached being indicative of movement of the magnetic field sensing device being started, and/or checking said sensing signal components against lower value thresholds, said absolute value thresholds being reached being indicative of movement of the magnetic field sensing device being stopped, and/or performing said Kalman filter processing conditional to detecting movement of the magnetic field sensing device. In an embodiment, the method includes: detecting movement of the magnetic field sensing device, storing the values of said sensing signal components from the magnetic field sensing device upon detecting movement of the magnetic field sensing device, and subtracting the values stored from said sensing signal components forwarded to said Kalman filter processing, restoring said stored values in the calibrated sensing signal components. In an embodiment, the method includes estimating the gain of said sensing signal components forwarded to said Kalman filter processing, for example as difference of maximum and minimum values of said sensing signal components. In an embodiment, the method includes: checking if the difference between the sensing signal components as predicted in Kalman filter processing and the current sensing signal components reaches an anomaly threshold, if said difference reaches said anomaly threshold, discontinuing Kalman filter processing and resuming Kalman filter processing at a subsequent sensing movement, for example from a rest condition. In an embodiment, a system for calibrating a magnetic field sensing device, wherein calibrated sensing signal components represented in a three-dimensional coordinate system by a spherical graph centered at the origin of said three-dimensional coordinate system are generated from uncalibrated signal components from said magnetic field sensing device represented in said three-dimensional coordinate system by an ellipsoidal graph having a center offset with respect to the origin of said three-dimensional coordinate system, includes a Kalman filter module for applying to said sensing signal components Kalman filter processing yielding a set of parameters fitting said ellipsoidal graph by prediction and correction based on said prediction. 
         [0015]    One or more embodiments may relate to a corresponding system and apparatus (e.g., magnetometer-based apparatus) including such a system as well as a computer program product loadable the memory of at least one processing device (e.g., a DSP) and including software code portions for executing the steps of the method when the product is run on at least one computer. As used herein, reference to such a computer program product is understood as being equivalent to reference to a computer-readable means containing instructions for controlling the processing system in order to co-ordinate implementation of the method according to one or more embodiments. Reference to “at least one processor device” is intended to highlight the possibility for one or more embodiments to be implemented in modular and/or distributed form. 
         [0016]    The claims are an integral part of the disclosure of one or more exemplary embodiments as provided herein. 
         [0017]    One or more embodiments may involve tuning of a Kalman filter coupled e.g., to a magnetometer with the ability of coping with a large range of soft iron distortions with good performance in term of fitting speed. 
         [0018]    Advantages offered by one or more embodiments may include: 
         [0019]    a wide range of hard-iron offsets and soft-iron distortions may be dealt with; 
         [0020]    the sample gain range can be calculated dynamically, allowing e.g., auto-scaling of parameters, which results in improved Kalman filter convergence; 
         [0021]    Kalman filter processing may be started and stopped according to movement detection; 
         [0022]    magnetic anomalies can be detected and managed. 
         [0023]    In one or more embodiments, Kalman filter parameter auto-scaling according to amplitude of the incoming signal may be applied to a wide variety of magnetic-field sensing applications where a Kalman filter is used. 
         [0024]    By relying on a geometric approach with a Kalman filter and eigenvectors, one or more embodiments may provide cost-effective solutions adapted for use in a wide range of devices. 
     
    
     
       BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS 
         [0025]    One or more embodiments will now be described, by way of example only, with reference to the enclosed figures, wherein: 
           [0026]      FIG. 1  is generally exemplary of the effects of hard-iron offsets and soft-iron distortions in a magnetic field sensing device, and 
           [0027]      FIG. 2  is a block diagram of a system according to an embodiment. 
       
    
    
     DETAILED DESCRIPTION 
       [0028]    In the ensuing description, one or more specific details are illustrated, aimed at providing an in-depth understanding of examples of embodiments. The embodiments may be obtained without one or more of the specific details, or with other methods, components, materials, etc. In other cases, known structures, materials, or operations are not illustrated or described in detail so that certain aspects of embodiments will not be obscured. 
         [0029]    Reference to “an embodiment” or “one embodiment” in the framework of the present description is intended to indicate that a particular configuration, structure, or characteristic described in relation to the embodiment is comprised in at least one embodiment. Hence, phrases such as “in an embodiment” or “in one embodiment” that may be present in one or more points of the present description do not necessarily refer to one and the same embodiment. Moreover, particular conformations, structures, or characteristics may be combined in any adequate way in one or more embodiments. 
         [0030]    The references used herein are provided merely for convenience and hence do not define the scope of protection or the scope of the embodiments. 
         [0031]    A magnetic field (e.g., the magnetic field of the earth) and its possible distortions as sensed by magnetic field sensing devices such as magnetometers may be represented by plotting the output components X, Y, Z of the sensing signal as a graph in a three-dimensional (3D) coordinate space having an origin O (X=0, Y=0, Z=0). 
         [0032]    Such a conventional representation is exemplified in  FIG. 1 . 
         [0033]    In the absence of local disturbance, the three components of the measurement signal correspond to a vector representative of the local magnetic field having a radius equal to the radius of a sphere S centered at the origin O of the reference coordinate system. 
         [0034]    As exemplified in  FIG. 1  hard-iron (HI) offset effects will result in shifting the center of the 3D graph away from the origin O towards an offset center CE, without per se distorting the spherical shape of the graph. 
         [0035]    Soft-iron distortion effects, on the other hand, will result in the spherical shape of the graph to be changed into an ellipsoidal shape E. 
         [0036]    In an embodiment, an (auto) calibration process of such a magnetic field sensing device (a magnetometer will be referred to in the following for the sake of simplicity) recovers—from such an ellipsoidal graph E offset from the origin O—a non-offset, non-distorted signal components corresponding to a sphere S centered at the origin O as depicted in  FIG. 1 . 
         [0037]    The foregoing may be represented as a matrix transformation as reproduced in the following: 
         [0000]    
       
         
           
             
               [ 
               
                 
                   
                     
                       X 
                       cal 
                     
                   
                 
                 
                   
                     
                       Y 
                       cal 
                     
                   
                 
                 
                   
                     
                       Z 
                       cal 
                     
                   
                 
               
               ] 
             
             = 
             
               
                 [ 
                 
                   
                     
                       
                         M 
                          
                         
                             
                         
                          
                         11 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         12 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         13 
                       
                     
                   
                   
                     
                       
                         M 
                          
                         
                             
                         
                          
                         21 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         22 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         23 
                       
                     
                   
                   
                     
                       
                         M 
                          
                         
                             
                         
                          
                         31 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         32 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         33 
                       
                     
                   
                 
                 ] 
               
               * 
               
                 ( 
                 
                   
                     [ 
                     
                       
                         
                           
                             X 
                             unc 
                           
                         
                       
                       
                         
                           
                             Y 
                             unc 
                           
                         
                       
                       
                         
                           
                             Z 
                             unc 
                           
                         
                       
                     
                     ] 
                   
                   - 
                   
                     [ 
                     
                       
                         
                           
                             O 
                              
                             
                                 
                             
                              
                             1 
                           
                         
                       
                       
                         
                           
                             O 
                              
                             
                                 
                             
                              
                             2 
                           
                         
                       
                       
                         
                           
                             O 
                              
                             
                                 
                             
                              
                             3 
                           
                         
                       
                     
                     ] 
                   
                 
                 ) 
               
             
           
         
       
     
         [0000]    where 
         [0038]    X unc , Y unc , Z unc  represent the un-calibrated (offset and distorted) signal components, 
         [0039]    X cal , Y cal , Z cal  represent the calibrated (non-offset and undistorted) signal components,
       O1, O2, O3 are three components representative of the offset of the center CE with respect to the origin O, and   M11, . . . , M33 is a matrix representative of the geometric transformation of the ellipsoid E into a sphere S.       
 
         [0042]      FIG. 2  is a schematic representation of a block diagram of a system  100  according to embodiments as coupled to a magnetic field sensing device such as e.g., a magnetometer M. 
         [0043]    In the following the device M will be assumed to produce three (generally un-calibrated) signal components X unc , Y unc , Z unc  with the system  100  having the purpose of deriving therefrom corresponding (auto)calibrated signal components X cal , Y cal , Z cal . 
         [0044]    In one or more embodiments, the system  100  may be implemented either in hardware form or in software form or as a combination of hardware and software modules. Each blocks shown in  FIG. 2  may thus be exemplary of hardware processing or software processing or mixed hardware/software processing. As illustrated, the system  100  comprises circuitry including a processor P, a memory MEM and discrete circuitry DC (e.g., amplifiers, adders, control logic, etc.), which may, alone or in various combinations, implement various functions of the system  100 . 
         [0045]    Also, partitioning of processing among the various blocks in  FIG. 2  is merely for ease of explanation insofar as one or more embodiments may adopt different arrangements e.g., by consolidating or splitting any of the blocks as shown in the Figure. 
         [0046]    In one or more embodiments as exemplified herein, data processing (including a Kalman filtering as discussed below) of the signal components X, Y, Z (unless specified otherwise, in the following the suffixes “unc” and “cal” distinguishing un-calibrated and calibrated components will be dropped for brevity) may be performed after a movement detection, that is after the sensing device (magnetometer) M is subject to movement. 
         [0047]    In one or more embodiments, a movement detector block  101  may include a filter  101   a  such as a derivative filter to apply filtering (e.g., of a finite impulse response—FIR type) to each component X, Y, Z possibly followed by an exponential smoothed average of the absolute value. 
         [0048]    In one or more embodiments, the movement detector block  101  may include a double threshold comparator  101   b.    
         [0049]    In one or more embodiments, the signal components X, Y, Z may be checked against upper (e.g., absolute value) thresholds, so that these upper absolute value thresholds being reached will be indicative of movement being started. 
         [0050]    For instance, in order to assert that movement is starting, all the three average signal derivatives abs (mdmag XYZ ) may be checked to be above a start threshold (which may vary for the different components). 
         [0051]    Likewise, in one or more embodiments, the signal components X, Y, Z may be checked against lower (e.g., absolute value) thresholds, so that these lower absolute value thresholds (which may vary for the different components) being reached will be indicative of movement being discontinued (e.g., stopped). 
         [0052]    In that way, a movement may be asserted to be completed and the sensing device (magnetometer M) held to be still (stationary) when the three signals in question are below a stop threshold. 
         [0053]    In one or more embodiments, such start (upper) and stop (lower) thresholds may be computed by multiplying programmed values by individual factors indicative of a distance (which may be possibly different for each component mdmag XYZ ) as possibly computed in a MIN-MAX distance block  103  to be described in the following. 
         [0054]    In one or more embodiments, the movement detector block  101  may thus act like a sort of auto-scaling function of the thresholds according to the incoming data range thus allowing to deal automatically with e.g., large soft-iron distortion. 
         [0055]    In one or more embodiments as exemplified in  FIG. 2 , the signal components X unc , Y unc , Z unc  may also be fed to an offset removal block  102 . 
         [0056]    Signal components as possibly produced by a magnetometer M may be affected by offsets of tens of Gauss units, e.g., 50-60 times larger than the useful signal due to hard-iron distortion. 
         [0057]    In one or more embodiments, the values of the signal components (samples) at the beginning of movement (as detected e.g., in the block  101 ) may be stored and subtracted to the subsequently incoming samples to be eventually restored at the end of calibration, e.g., by being added to the computed center. 
         [0058]    In one or more embodiments, processing as performed in various blocks considered in the following may be performed on offset-scaled signal components (samples) mag′ XYZ  scaled e.g., by a scaling value scale_off XYZ  as stored upon movement of the sensing device M being detected, e.g., mag′ XYZ =mag XYZ −scale_off XYZ , where mag XYZ  denotes, in compact form, input samples X unc , Y unc , Z unc  affected by offset. 
         [0059]    In one or more embodiments, the MIN-MAX distance block  103  already mentioned in the foregoing may take into account the fact that the signal components X, Y, Z as produced by the device M may be effected by a wide range of soft-iron distortion, with the incoming signal range being generally unknown a priori. 
         [0060]    In one or more embodiments, e.g., in order to better tune the Kalman filtering block  104  to be discussed in the following, the gain of the incoming signal may be estimated in the block  103 . 
         [0061]    In one or more embodiments, the maximum and minimum values of the signal components (samples) max XYZ  and min XYZ , respectively may be stored e.g., upon their arrival, individually for each of the three components X, Y, Z, by possibly defining the distance for each component X, Y, Z e.g., as: 
         [0000]      distance XYZ =abs(max XYZ −min XYZ ).
 
         [0062]    In one or more embodiments, possibly after offset removal in block  102  and MIN-MAX distance evaluation in block  103 , the input signal components (samples) may be fed to a Kalman filter block  104  along with an enable signal KF_GO. 
         [0063]    In one or more embodiments, the purpose of such a filter is to yield a set of e.g., nine parameters that fit an ellipsoid shape (e.g., E in  FIG. 1 ). 
         [0064]    The quadratic form of an ellipsoid is: 
         [0000]    
       
         
           
             
               
                 ax 
                 2 
               
               + 
               
                 2 
                  
                 bxy 
               
               + 
               
                 2 
                  
                 cxz 
               
               + 
               
                 dy 
                 2 
               
               + 
               
                 2 
                  
                 eyz 
               
               + 
               
                 fz 
                 2 
               
               + 
               
                 2 
                  
                 gx 
               
               + 
               
                 2 
                  
                 hy 
               
               + 
               
                 2 
                  
                 iz 
               
               + 
               l 
             
             = 
             0 
           
         
       
       
         
           
             B 
             = 
             
               [ 
               
                 
                   
                     a 
                   
                   
                     b 
                   
                   
                     c 
                   
                 
                 
                   
                     b 
                   
                   
                     d 
                   
                   
                     e 
                   
                 
                 
                   
                     c 
                   
                   
                     e 
                   
                   
                     f 
                   
                 
               
               ] 
             
           
         
       
     
         [0065]    By denoting as m1, m2, m3 the X, Y, Z sample values: 
         [0000]    
       
         
           
             
               
                 - 
                 m 
               
                
               
                   
               
                
               
                 1 
                 2 
               
             
             = 
             
               
                 
                   d 
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 
                   2 
                   2 
                 
               
               + 
               
                 
                   f 
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 
                   3 
                   2 
                 
               
               + 
               
                 
                   
                     2 
                      
                     g 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 1 
               
               + 
               
                 
                   
                     2 
                      
                     h 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 2 
               
               + 
               
                 
                   
                     2 
                      
                     i 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 3 
               
               + 
               
                 l 
                 a 
               
               + 
               
                 
                   
                     2 
                      
                     b 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 1 
                  
                 m 
                  
                 
                     
                 
                  
                 2 
               
               + 
               
                 
                   
                     2 
                      
                     c 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 1 
                  
                 m 
                  
                 
                     
                 
                  
                 3 
               
               + 
               
                 
                   
                     2 
                      
                     e 
                   
                   a 
                 
                  
                 m 
                  
                 
                     
                 
                  
                 2 
                  
                 m 
                  
                 
                     
                 
                  
                 3 
               
             
           
         
       
       
         
           
             
                 
             
              
             
               
                 z 
                 n 
               
               = 
               
                 
                   - 
                   m 
                 
                  
                 
                     
                 
                  
                 
                   1 
                   2 
                 
               
             
           
         
       
       
         
           
             
               H 
               n 
             
             = 
             
               [ 
               
                 
                   
                     
                       m 
                        
                       
                           
                       
                        
                       
                         2 
                         2 
                       
                     
                   
                   
                     
                       m 
                        
                       
                           
                       
                        
                       
                         3 
                         2 
                       
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       1 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       2 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       3 
                     
                   
                   
                     1 
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       1 
                        
                       m 
                        
                       
                           
                       
                        
                       2 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       1 
                        
                       m 
                        
                       
                           
                       
                        
                       3 
                     
                   
                   
                     
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       2 
                        
                       m 
                        
                       
                           
                       
                        
                       3 
                     
                   
                 
               
               ] 
             
           
         
       
       
         
           
             
               X 
               n 
             
             = 
             
               [ 
               
                 
                   
                     
                       X 
                        
                       
                         ( 
                         0 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         1 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         2 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         3 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         4 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         5 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         6 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         7 
                         ) 
                       
                     
                   
                   
                     
                       X 
                        
                       
                         ( 
                         8 
                         ) 
                       
                     
                   
                 
               
               ] 
             
           
         
       
       
         
           
             
                 
             
              
             
               zres 
               = 
               
                 
                   
                     z 
                     n 
                   
                   - 
                   
                     z 
                     n 
                     ′ 
                   
                 
                 = 
                 
                   
                     z 
                     n 
                   
                   - 
                   
                     
                       H 
                       n 
                     
                      
                     
                       X 
                       
                         n 
                         - 
                         1 
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    the Kalman procedure may be based on two phases, namely: 
         [0066]    predicting values 
         [0000]    
       
      
       X′ 
       n 
       =X 
       n-1  
      
     
         [0000]    
       
      
       P′ 
       n 
       =P 
       n-1 
       +Q  
      
     
         [0000]    
       
      
       z′ 
       n 
       =H 
       n 
       X′ 
       n  
      
     
         [0000]    and 
         [0067]    correcting values 
         [0000]        k   n   =P′   n   H   n   l ( H   n   P′   n   H   n   T   +R ) 
         [0000]        X   n   =X′   n   +k   n ( z   n   −z′   n ) 
         [0000]        P   n =( l−k   n   H   n ) P′   n    
         [0000]    where, according to conventional notation, n−1 and n indicate generic subsequent steps in Kalman filter operation. 
         [0068]    The diagonal matrix Q and the scalar R are respectively the process and output noise covariance. 
         [0069]    Adequate filter performance in terms of fitting speed may be reached by scaling the output noise covariance according to the computed distance XYZ , such as R=Ro*median(distance XYZ )̂4. 
         [0070]    The e.g., nine ellipsoid parameters thus computed may be denoted X (8:0). 
         [0071]    In one or more embodiments, a magnetic anomaly detector block  105  may be provided. 
         [0072]    In one or more embodiments, operation of such a block  105  may assume that the Kalman filter  104  has a fit, meaning that the data provided by the magnetic field sensing device (e.g., magnetometer M) belong to an ellipsoid. 
         [0073]    In one or more embodiments, the block  105  may receive from the block  104  the Kalman residual zres, that is the difference between the predicted system output and the real samples assumes an abnormal value. 
         [0074]    In one or more embodiments, operation of the block  105  may involve checking if the difference between the output signal as predicted by Kalman filter processing and the current magnetometer output signal reaches an anomaly threshold. 
         [0075]    If the difference in question reaches the anomaly threshold (see e.g., the flag MA_DETECT in  FIG. 2 ) Kalman filter processing in the block  104  may be discontinued to be resumed e.g., at a subsequent movement of the device (magnetometer M), optionally from a reset condition. 
         [0076]    In one or more embodiments, managing the zres behavior may involve computing a smoothed (e.g., exponential) mean or average, peak-detector like: when no anomaly is detected, the average value may assume the value of |zres|; when anomaly is detected, than it may become: 
         [0000]        mz res( n )= a mz res( n −1)±(1 −a )| z res( n )|,
 
         [0000]    where n and n−1 denote two subsequent processing steps. 
         [0077]    In one or more embodiments, when the residual mean mzres starts to grow and exceeds of threshold (possibly scaled by the squared distance x ) than the MA_DETECT flag may be issued towards the Kalman filter block  104  so that Kalman filtering may be stopped to be restarted, e.g., from a reset condition at a next movement. 
         [0078]    In one or more embodiments the magnetic anomaly MA_DETECT flag may be cleared once the residual mean mzres is below a captioned threshold, meaning that the anomaly has disappeared. 
         [0079]    The block  106  in  FIG. 2  is exemplary of the evaluation of certain calibration flags, such as e.g.: 
         [0080]    the Kalman filter  104  has to fit the ellipsoid shape E, 
         [0081]    three delay counters have reached a programmed value, meaning that each component distance distance XYZ  has exceeded a programmable lowest distance for a given number of samples, 
         [0082]    a minimum time has elapsed between two subsequent calibration procedures, 
         [0083]    the system is in a steady condition, meaning that a movement has been completed. 
         [0084]    In one or more embodiments, flags such as those exemplified in the foregoing may be generated in a status and control block  106   a  and a timeout block  106   b  with the time out block sending e.g., MINTIME and MAXTIME signals to the status and control block  106   a.    
         [0085]    In one or more embodiments, certain status flags are collected in  106   a , such as Kalman filter fitting status, magnetic anomaly detection, steady/movement status, timeout status etc., to be read-back by a host processor. In one or more embodiments, a calibration event may occur: 
         [0086]    not before a MINTIME number of samples from a previous calibration event, and 
         [0087]    not after a MAXTIME number of samples from a previous calibration event or from the procedure start. 
         [0088]    If a MAXTIME number of samples are exceeded without a calibration event, then the Kalman filter is reset and the overall process is restarted. 
         [0089]    When the conditions expressed by the flags above are checked to be verified in the block  106 , operation of a block  107  for a matrix and center calculation may be enabled. 
         [0090]    In one or more embodiments, the related processing may be executed starting from the output X (8:0) from the Kalman filter block  104 . 
         [0091]    In one or more embodiments, processing in the block  107  may involve four phases: translation, rotation, scaling and back-rotation. 
         [0092]    Translation processing aims at translating the center of the ellipsoid E towards the origin O of the three-dimensional coordinate system of  FIG. 1 . 
         [0093]    In one or more embodiments, this may involve solving a system of linear equations in order to obtain the center coordinates: 
         [0000]      [ x 0 y 0 z 0] T   =−B   −1   [ghi]   T    
         [0094]    In one or more embodiments, translation to the center may involve a variable substitution such as: 
         [0000]    
       
         
           
             
               [ 
               
                 
                   
                     x_transl 
                   
                 
                 
                   
                     y_transl 
                   
                 
                 
                   
                     z_transl 
                   
                 
               
               ] 
             
             = 
             
               [ 
               
                 
                   
                     
                       x 
                       - 
                       
                         x 
                          
                         
                             
                         
                          
                         0 
                       
                     
                   
                 
                 
                   
                     
                       y 
                       - 
                       
                         y 
                          
                         
                             
                         
                          
                         0 
                       
                     
                   
                 
                 
                   
                     
                       z 
                       - 
                       
                         z 
                          
                         
                             
                         
                          
                         0 
                       
                     
                   
                 
               
               ] 
             
           
         
       
     
         [0000]    where _transl denotes a translated coordinate. 
         [0095]    In one or more embodiments, the rotation processing rotatings the ellipsoid E to align the ellipsoid axes with the axes of the sensing device (e.g., magnetometer M). 
         [0096]    The ellipsoid axes are the eigenvectors of the matrix B introduced in the foregoing. 
         [0097]    Rotation may be based on a matrix V including the resulting eigenvectors to perform the rotation: 
         [0000]    
       
         
           
             
               [ 
               
                 
                   
                     x_rot 
                   
                 
                 
                   
                     y_rot 
                   
                 
                 
                   
                     z_rot 
                   
                 
               
               ] 
             
             = 
             
               
                 V 
                 T 
               
               * 
               
                 [ 
                 
                   
                     
                       x_transl 
                     
                   
                   
                     
                       y_transl 
                     
                   
                   
                     
                       z_transl 
                     
                   
                 
                 ] 
               
             
           
         
       
     
         [0000]    where _rot denotes rotated coordinate obtained from the translated coordinates _transl. 
         [0098]    The foregoing results in having an ellipsoid which is both centered at the origin O and with its axes aligned with the axes of the sensing device. 
         [0099]    Its quadratic form will be: 
         [0000]      λ1 x _rot 2 +λ2 y _rot 2 +λ3 z _rot 2   =R   2  
 
         [0000]    where λ1, λ2 and λ3 are the eigenvalues of the matrix B and 
         [0000]        R =(− l+[x 0 y 0 z 0] B[x 0 y 0 z 0] T ) 1/2  
 
         [0100]    Scaling processing aims at scaling the ellipsoid E to a sphere S. 
         [0101]    The ellipsoid semi-axes may be represented as 
         [0000]        R /(λ1) 1/2    R /(λ2) 1/2    R (λ3) 1/2  
 
         [0000]    and the scaling matrix may be represented as follows: 
         [0000]    
       
         
           
             scale 
             = 
             
               
                 [ 
                 
                   
                     
                       
                         
                           λ 
                           1 
                         
                       
                     
                     
                       0 
                     
                     
                       0 
                     
                   
                   
                     
                       0 
                     
                     
                       
                         
                           λ 
                           2 
                         
                       
                     
                     
                       0 
                     
                   
                   
                     
                       0 
                     
                     
                       0 
                     
                     
                       
                         
                           λ 
                           3 
                         
                       
                     
                   
                 
                 ] 
               
               * 
               
                 1 
                 R 
               
               * 
               LMF 
             
           
         
       
     
         [0000]    where LMF is a gain term possibly equal to the local magnetic field. 
         [0102]    To sum up: 
         [0000]    
       
         
           
             
               [ 
               
                 
                   
                     
                       x 
                       sphere 
                     
                   
                 
                 
                   
                     
                       y 
                       sphere 
                     
                   
                 
                 
                   
                     
                       z 
                       sphere 
                     
                   
                 
               
               ] 
             
             = 
             
               
                 scale 
                 * 
                 
                   [ 
                   
                     
                       
                         x_rot 
                       
                     
                     
                       
                         y_rot 
                       
                     
                     
                       
                         z_rot 
                       
                     
                   
                   ] 
                 
               
               = 
               
                 scale 
                 * 
                 
                   V 
                   T 
                 
                 * 
                 
                   [ 
                   
                     
                       
                         x_trasl 
                       
                     
                     
                       
                         y_trasl 
                       
                     
                     
                       
                         z_trasl 
                       
                     
                   
                   ] 
                 
               
             
           
         
       
     
         [0103]    Back-rotation aims at back-rotating the sphere resulting from scaling to the orientation of the ellipsoid before the rotation considered in the foregoing. 
         [0104]    In one or more embodiments, back-rotation may involve multiplication for the matrix V: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         [ 
                         
                           
                             
                               
                                 x 
                                 sphere_fin 
                               
                             
                           
                           
                             
                               
                                 y 
                                 sphere_fin 
                               
                             
                           
                           
                             
                               
                                 z 
                                 sphere_fin 
                               
                             
                           
                         
                         ] 
                       
                       = 
                         
                        
                       
                         V 
                         * 
                         
                           [ 
                           
                             
                               
                                 
                                   x 
                                   sphere 
                                 
                               
                             
                             
                               
                                 
                                   y 
                                   sphere 
                                 
                               
                             
                             
                               
                                 
                                   z 
                                   sphere 
                                 
                               
                             
                           
                           ] 
                         
                       
                     
                   
                 
                 
                   
                     
                       = 
                         
                        
                       
                         V 
                         * 
                         scale 
                         * 
                         
                           [ 
                           
                             
                               
                                 x_rot 
                               
                             
                             
                               
                                 y_rot 
                               
                             
                             
                               
                                 z_rot 
                               
                             
                           
                           ] 
                         
                       
                     
                   
                 
                 
                   
                     
                       = 
                         
                        
                       
                         V 
                         * 
                         scale 
                         * 
                         
                           V 
                           T 
                         
                         * 
                       
                     
                   
                 
               
                
               
                 
 
               
               [ 
               
                 
                   
                     x_trasl 
                   
                 
                 
                   
                     y_trasl 
                   
                 
                 
                   
                     z_trasl 
                   
                 
               
               ] 
             
             = 
             
               V 
               * 
               scale 
               * 
               
                 V 
                 T 
               
               * 
               
                 [ 
                 
                   
                     
                       
                         x 
                         - 
                         
                           x 
                            
                           
                               
                           
                            
                           0 
                         
                       
                     
                   
                   
                     
                       
                         y 
                         - 
                         
                           y 
                            
                           
                               
                           
                            
                           0 
                         
                       
                     
                   
                   
                     
                       
                         z 
                         - 
                         
                           z 
                            
                           
                               
                           
                            
                           0 
                         
                       
                     
                   
                 
                 ] 
               
             
           
         
       
     
         [0105]    The foregoing results in a centered sphere S having a radius LMF without any additional rotation. 
         [0106]    In one or more embodiments, processing as performed in the block  107  may result in the generation of a vector O and a matrix M for hard-iron offset correction and soft-iron distortion correction of the signal components. 
         [0107]    In one or more embodiments this may take the form of an offset vector [x0 y0 z0] and a gain matrix M=V*scale*V T . 
         [0108]    In a sample calibration block  108  the offset stored at the beginning of processing (as a result of processing performed in block  102 ) may be restored and added to the ellipsoid center to yield a final hard-iron offset correction in the form 
         [0000]        O=[x 0 y 0 z 0]+scale_off XYZ    
         [0109]    In one or more embodiments, the calibrated samples at the output of the block  108  may be obtained as: 
         [0000]    
       
         
           
             
               [ 
               
                 
                   
                     
                       X 
                       cal 
                     
                   
                 
                 
                   
                     
                       Y 
                       cal 
                     
                   
                 
                 
                   
                     
                       Z 
                       cal 
                     
                   
                 
               
               ] 
             
             = 
             
               
                 [ 
                 
                   
                     
                       
                         M 
                          
                         
                             
                         
                          
                         11 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         12 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         13 
                       
                     
                   
                   
                     
                       
                         M 
                          
                         
                             
                         
                          
                         21 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         22 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         23 
                       
                     
                   
                   
                     
                       
                         M 
                          
                         
                             
                         
                          
                         31 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         32 
                       
                     
                     
                       
                         M 
                          
                         
                             
                         
                          
                         33 
                       
                     
                   
                 
                 ] 
               
               * 
               
                 ( 
                 
                   
                     [ 
                     
                       
                         
                           
                             X 
                             unc 
                           
                         
                       
                       
                         
                           
                             Y 
                             unc 
                           
                         
                       
                       
                         
                           
                             Z 
                             unc 
                           
                         
                       
                     
                     ] 
                   
                   - 
                   
                     [ 
                     
                       
                         
                           
                             O 
                              
                             
                                 
                             
                              
                             1 
                           
                         
                       
                       
                         
                           
                             O 
                              
                             
                                 
                             
                              
                             2 
                           
                         
                       
                       
                         
                           
                             O 
                              
                             
                                 
                             
                              
                             3 
                           
                         
                       
                     
                     ] 
                   
                 
                 ) 
               
             
           
         
       
     
         [0110]    Without prejudice to the underlying principles, the details and embodiments may vary, even significantly, with respect to what has been described by way of example only without departing from the extent of protection. 
         [0111]    The extent of protection is defined by the annexed claims. 
         [0112]    Some embodiments may take the form of or comprise computer program products. For example, according to one embodiment there is provided a computer readable medium comprising a computer program adapted to perform one or more of the methods or functions described above. The medium may be a physical storage medium, such as for example a Read Only Memory (ROM) chip, or a disk such as a Digital Versatile Disk (DVD-ROM), Compact Disk (CD-ROM), a hard disk, a memory, a network, or a portable media article to be read by an appropriate drive or via an appropriate connection, including as encoded in one or more barcodes or other related codes stored on one or more such computer-readable mediums and being readable by an appropriate reader device. 
         [0113]    Furthermore, in some embodiments, some or all of the methods and/or functionality may be implemented or provided in other manners, such as at least partially in firmware and/or hardware, including, but not limited to, one or more application-specific integrated circuits (ASICs), digital signal processors, discrete circuitry, logic gates, standard integrated circuits, controllers (e.g., by executing appropriate instructions, and including microcontrollers and/or embedded controllers), field-programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), etc., as well as devices that employ RFID technology, and various combinations thereof. 
         [0114]    The various embodiments described above can be combined to provide further embodiments. Aspects of the embodiments can be modified, if necessary to employ concepts of the various patents, applications and publications to provide yet further embodiments. 
         [0115]    These and other changes can be made to the embodiments in light of the above-detailed description. In general, in the following claims, the terms used should not be construed to limit the claims to the specific embodiments disclosed in the specification and the claims, but should be construed to include all possible embodiments along with the full scope of equivalents to which such claims are entitled. Accordingly, the claims are not limited by the disclosure.