Location Fingerprint Extraction for Magnetic Field Magnitude Based Indoor Positioning

. Smartphone based indoor positioning has


Introduction
Location-based services (LBS) in smartphones have attracted tremendous attention in recent years, since convenient and high precision localization services improve people's daily life significantly.These services include navigating a driver to a destination in an unfamiliar area, searching a book inside a large library, or finding a friend at a complex airport.
However, traditional localization techniques, GPS, for example, are only available in outdoor scenarios.They become invalid when it comes to indoor areas, because walls and roofs dramatically attenuate signals from GPS satellites.
Therefore, many indoor localization techniques have been presented by researchers.These techniques include WiFi [1][2][3][4], echo [5,6], and FM [7][8][9] based approaches.However, WiFi based localization methods are energy expensive for smartphones.Echo approaches are too sensitive to location change, which makes them improper for continuous positioning in a large area.FM methods often become invalid when radio frequency (RF) signals are attenuated by obstacles.
With the development of sensing systems mounted on smartphones, sensing based approaches to indoor localization became available.That is, location-related signals are sensed, and then the user's location is estimated based on these signals.Indoor magnetic field is one kind of locationrelated signals, which can be sensed by magnetometers embedded on smartphones.
Indoor magnetic field is a pervasive anomalies field induced by geomagnetic field.Because of its locationrelated, infrastructure-free, and energy efficient features, many researchers have focused on utilizing indoor geomagnetic field for indoor localization purposes.Some experts [10] leverage indoor magnetic anomalies as landmarks, since these anomalies generated by ferromagnetic objects, that is, pillars and doors, are relatively stable.Other researchers [11] construct an indoor magnetic magnitude model, using probability method to estimate user location.In order to improve localization feasibility, experts [10,12] introduced particle filter framework, which makes it possible to fuse multipositioning methods, including WiFi, Bluetooth, and pedestrian dead reckoning (PDR).
The smartphone collects the indoor magnetic field signal by the magnetometer; however, this process is interfered in by hard/soft-iron effect, hand quivers, and electronic noise, which are not location-related.These interferences decrease the distinguishability of location fingerprints in magnetic field based localization systems.
The main purpose of this paper is to extract locationrelated only feature of indoor magnetic fields for indoor localization.Although indoor magnetic field contains location information, this information is interfered in by hard/softiron effect, hand quiver, and electronic noise.Therefore, rejecting interference signals and keeping location-related signals are beneficial for improving indoor localization performance.
There are two main challenges to magnetic field magnitude (MFM) based location feature extraction.The first one is to ascertain interference sources of magnetometers embedded on the smartphone.This paper first examines the model of magnetometer measurement and then derives the inverse model to estimate indoor magnetic field from magnetometer measurement.With this inverse model as well as related experiments, it is found that the fundamental interference sources of real MFM estimation are coarse-grained soft/hardiron calibration and sensor electronic noise.
Secondly, there are various magnetic field fingerprint extraction methods; hence, it is necessary to select a high discernible one among them.However, a few researchers have studied this problem.Galván-Tejada et al. compared temporal, spectral, and energy features of indoor magnetic field [13].But their work concentrates on room level classification.Although localization accuracy can reflect fingerprint performance in some degree, it is affected by the localization algorithm.Therefore, to measure fingerprint distinguishability, this paper presents a novel and lightweight distinguishability measurement method (DAME).This method provides an independent way to qualify fingerprint distinguishability, and it has low overhead compared to previous works.
In conclusion, our contributions are threefold: (i) We perform in-depth studies of indoor magnetic field attributes and magnetometer measurement.Then, we present the notion that coarse-grained soft/hard-iron calibration and sensor noise are the fundamental reasons of device heterogeneity and user diversity.
(ii) We propose a novel fingerprint distinguishability measurement method, DAME, which is especially suitable for low discernibility MFM fingerprint.
(iii) With DAME, we perform a study on various fingerprint extraction methods and find that Butterworth low pass filter (LPF) is a high discernible fingerprint extraction method of our experiments.
This paper conducts extensive experiments on commercially available smartphones to evaluate the research.Experiment result shows that coarse-grained soft/hard-iron calibration and sensor electronic noise were pervasive in various kinds of smartphones.Butterworth filter fingerprint is a high discernible fingerprint extraction method.Confusion matrixes and their localization errors are also computed to show the localization accuracy improvement with the high discernible fingerprint.
This paper is organized as follows.Section 2 describes the related work.Section 3 reviews the background of indoor magnetic field formation as well as its advantages and challenges in indoor localization.Section 4 presents the main interferences sources of embedded magnetometer on the smartphone.Section 5 presents the DAME fingerprint distinguishability measurement method and the study for finding a high discernible fingerprint.Section 6 describes the experiments.Finally, Section 7 concludes the paper with a discussion.

Related Work
Localization technology is an enabling technology in pervasive computing area, which provides a foundation for the context-aware service.Many efforts have been devoted to this field, and there are already numerous commercially available positioning technologies.In recent years, various indoor MFM based localization methods have been presented; however, there are few researches related to MFM location feature extraction.
Chavez-Romero et al. presented a robotic wheelchair based indoor localization method using visual markers and particle filter [14].Their system is mounted on a wheelchair, and the wheels can provide odometry data, which is not available for the pedestrian user holding a smartphone.
Li et al. addressed reliable and accurate indoor localization using inertial sensors commonly found on commodity smartphones [15].They utilized indoor magnetic field based compass to provide orientation for their particle filter localization system.Shu et al. described a fusion indoor localization system with pervasive magnetic field and opportunistic WiFi [16].They noticed the phenomena where different devices and different smartphone attitudes cause magnetic field measurement offset.So, they remove the mean of MFM sequences to overcome this offset.Besides, their system uses these sequences to update particle weight at each step event.
Frassl et al. researched the magnetic maps of indoor environments [17].They studied the magnetic field intensity and direction distribution features.Based on their analysis, they implemented a high precision indoor localization system using foot mounted inertial sensors as well as a magnetometer.
Angermann et al. conducted in-depth studies on the characterization of the indoor magnetic field [18].They utilized a well calibrated sensor package mounted on a measuring device with code odometry to collect and evaluate indoor magnetic field.In their work, they presented the notion that the multiple measurements along a path showed strong modulation.
Le et al. studied magnetic field mapping and fusion method for indoor localization [11].Their algorithm proves that local magnetic disturbances carry enough information to localize without the help from other sensors.They built a magnetometer measurement probability model to update particle weight in their particle filter based positioning algorithm.
Xie et al. built MaLoc, a magnetic fingerprint based indoor localization system [12].They presented the notion that magnetometer's sensitivity is different across different smartphones.Hence, they used magnetic magnitude difference to compare real-time sampling data with trained data.
Galván-Tejada et al. presented an extension and improvement of their previous indoor localization model [13].The model tests many magnetic field signal features, including kurtosis, mean, and slope.However, their model is designed for room level classification.
Although there are various magnetic field feature extraction methods utilized by different indoor localization systems, they mainly focus on localizing users through original magnetic magnitude fingerprints.However, the original fingerprints are interfered in by coarse-grained soft/hard calibration and sensor electronic noise.Therefore, this paper gives an in-depth study on how to reduce magnetometer interferences and present the DAME algorithm to evaluate the performance of different MFM feature extraction methods.

Insight into Indoor Magnetic Field
Modern buildings generally adopt steel reinforced concrete in their structures.However, these ferromagnetic materials distort the magnetic field in various manners in different areas.Though this distortion is negative for orientation estimation of pedestrian dead reckoning (PDR), it can be used as indoor location feature.
Indoor magnetic field is distorted locally, because of pillars, escalators, and large iron furniture.These ferromagnetic objects change the spread of magnetic lines, so indoor MFM reveals different intensities across different locations.Figure 1 illustrates this distortion: the magnitude changes in different locations.
Indoor magnetic field's distortion patterns are static, because the geomagnetic field varies rather slowly.Moreover, the indoor magnetic anomalies are mainly formed by building ferromagnetic structure.As a result, provided that the structure remains unchanged, the magnetic anomalies will be invariant.For instance, Figure 1 demonstrates this stability.The MFM of one corridor was collected twice over 50 days.Although there is a calibration offset between the two signals, the anomalies of the two are similar.The calibration offset will be explained in Section 5.2.
Magnetic field has low discernibility.Geomagnetic magnitude at the earth's surface ranges from 25 to 65 T [19].Because indoor magnetic field is mainly formed by distortion of the geomagnetic field, this narrow range is also the approximate magnitude scope of indoor magnetic field.As a result, the number of similar distortion patterns will increase with the enlargement of the searching scope.Take the red line in Figure 1 as an example; there is only one location's magnitude, which is equal to 50 when the search scope is limited in the first one meter.But the location number increases to 3 when the search scope increases to ten meters.Hence, it can be deduced that the longer the search scope is, the more confusing locations there are.As a brief summary, indoor magnetic field is locally distorted and location stable, which are the advantages for indoor localization, but the field's low discernibility brings about challenges to location feature comparison.

Indoor Magnetic Field Interferences
In this section, we discuss the process of magnetometer measuring the geomagnetic field and magnetometer noise.Furthermore, we analyze interference sources of magnetometer measurement.

Characteristics of Magnetometers on Smartphones.
The complicated inner electromagnetic environment of smartphones and the diversity in user behavior make it difficult to precisely measure environment magnetic field.
The magnetometer measures indoor magnetic field's value of a position relative to the orientation of the phone.This value Phone  measured is a triple with each element representing the magnitude of the magnetic field along the three dimensions of a phone's frame.Moreover, given that the expression of a vector  in frame  is  , then a magnetometer measurement can be represented as follows [20]: The smartphone magnetometer is interfered with by additive interference and multiplicative interference when measuring geomagnetic field.
Additive interference  add in magnetometer measurement consists of two parts: hard-iron effect and sensor offset, as (1) shows.In addition, hard-iron effect  hard is the fact that permanently magnetized ferromagnetic components on Printed Circuit Boards (PCBs) add an offset field when the magnetometer is measuring geomagnetic field.Sensor offset  sensorOffset is the zero field offset in magnetometer's factory calibration.
Multiplicative interference  multiply in magnetometer measurement consists of three parts: soft-iron effect, magnetometer nonorthogonality, and unequal gains, as (2) reveals.First, soft-iron effect is the fact that outer fields, for example, geomagnetic and speaker field, onto unmagnetized ferromagnetic components on the PCB, induce interfering magnetic field when the magnetometer is measuring geomagnetic field.Second, magnetometer nonorthogonality is the lack of perfect orthogonality between sensor axes and sensor relative to the phone's coordinate system.Finally, unequal gains are the different gains in magnetometer in all three axes.Equation ( 3) demonstrates the overall process of smartphone magnetometer measuring geomagnetic field.Firstly, the real geomagnetic field is Earth  real , which is expressed in north, east, down (NED) frame.However, the magnetometer measurement is in phone frame, so the geomagnetic field in phone frame is Phone Earth  ⋅ Earth  real , with Phone Earth  representing transform matrix from earth frame to phone frame.Moreover, considering all possible phone frames, the universal set of geomagnetic fields in phone frames can be illustrated as the red sphere in Figure 2. Secondly, the magnetometer is interfered with by multiplicative interference, which makes the magnetic field gain different along different axes.As a result, the universal set becomes an ellipsoid.Finally, additive interference makes the universal set ellipsoid leave the original phone frame, as the blue sphere shows.In other words, one magnetometer measurement Phone  measured is one vector from original to a point of the blue ellipsoid.
Equation (3) reveals that magnetometer measurement Phone  measured is heavily interfered with, which cannot be used for localization.However, one practical way is to estimate Earth  real from Phone  measured .From (3), the estimated Earth  real can be easily derived: Furthermore, considering that Phone Earth  is a unit frame transform matrix, the magnitude of Earth  Breal can be drawn from (4): In ( 5), W−1 mulitply and Ṽadd are estimated multiplicative and additive interference parameter.Solving W−1 multiply and Ṽadd is actually to compute the blue ellipsoid center and its ellipsoid parameters in Figure 2. To solve them, one general way for commodity smartphones is to rotate the device in a figure of 8 in a small space.Consequently, the magnetometer collects omnidirectional data.These data are distributed on the blue ellipsoid in Figure 2. Hence, using Cholesky factorization [21], the ellipsoid center and ellipsoid parameter can be derived, that is, Ṽadd and W−1 multiply .As a result, ‖ Earth Breal ‖ is computed.
As (5) shows, the precision of ‖ Earth Breal ‖ estimation depends on the precision of estimated Ṽadd and W−1 multiply .Although the smartphone always runs background magnetometer calibration, it is a complicated problem.As a result, only coarse calibration parameter can be computed.Hence, the magnetic magnitude varies as the device rotates.Figure 3 clearly demonstrates these properties, where the magnetic signals were collected within a small cube with 15 cm edges: red dash line signal was collected with parallel movement.Blue full-line signal was collected with omnidirectional rotational movement.In the experiment result, parallel signal fluctuation scope was 3.7 T, while rotational signal fluctuation scope was 13.3 T.In contrast, the fluctuation scope of a typical road is approximately 30 T, as Figure 1 depicted, comparable with that of omnidirectional rotation case.Therefore, random omnidirectional device rotation is interfering enough to pollute location feature, as Figure 4 shows: the magnetic signal is collected during walks along a straight corridor with 4 different attitudes and the last one was collected with rotating the device all the way.Obviously, although different attitude magnitude signals have different mean values, their alternating current (AC) component signals are similar.But, for rotation magnitude signals, they had become ambiguous.Therefore, the coarse-grained additive and multiplicative parameters in the smartphone can be characterized as measured magnetic magnitude being sensitive to rotation movement.In other words, magnetic magnitude is only available when the device stays at a relatively stable situation.

Magnetometer
Measurement.Smartphone magnetometer suffers from random fluctuation signals, including excitation current, feedback circuit and signal conditioning from the sensor inside [22], and currents within coils outside the sensor [23].Consequently, these signals will make the magnetometer output signal combined with noise.
Figure 5 reveals histogram statistical result of the noisy MFM signal collected by a static smartphone.Obviously, the signal obeyed normal distribution, with mean which equaled 54.16 T and standard deviation of 0.72 T.So, the indoor magnetic field measure equation (3) should be updated to (6), where Δ is Gaussian noise.Hence, Therefore, the estimated geomagnetic magnitude is updated to (7), where Δ  is Gaussian noise.Hence,
In conclusion, this section analyzes interference sources of the magnetometer, including hand movement and senor noise, which are harmful to indoor localization.

Indoor Magnetic Fingerprint Extraction
This section presents several indoor MFM fingerprint extraction methods.In order to compare these methods, firstly, a fingerprint distinguishability evaluation model is presented.Secondly, a series of evaluations were conducted to find a high discernible extracted fingerprint.

Fingerprint Segment Distinguishability Evaluation Method.
Indoor magnetic field is a location-related magnetic field induced by geomagnetic field that is steadily distorted by steel reinforced concrete building structures.Hence, it can be utilized as indoor location feature, that is, location fingerprint.A location fingerprint is a static map between location space and feature space whereby one can determine a location from observed features.In other words, an eligible fingerprint has two features: time stability and spatial distinguishability.The time stability of indoor MFM mainly depends on the stabilization of geomagnetic field and building structures discussed in the last section.As to the spatial distinguishability, experts have provided some insights into it [17,18]; however, as far as we know, there is no study on quantifying distinguishability.In this section, the paper first introduces the feature of MFM distinguishability and then its calculation method.
Indoor magnetic field based positioning generally has two phases: model training phase and fingerprint localization phase.In the model training phase, trainers collect spatial fingerprint signal, then mark them with location information, and finally generate the localization model.In the fingerprint localization phase, users collect real-time fingerprint signal and then estimate users' locations by comparing the real-time fingerprint signals and the localization model.For example, given a localization model (represented as  2 in Figure 6), suppose a user has collected a target segment (represented as  1 in Figure 6).To localize the user is to find the most possible position of the target segment in the localization model.This process is usually implemented by comparing the similarity between the target segment and all candidate segments in the model with a sliding window technique.However, false positions ( 1 and  2 ) sometimes are more similar than the true position  0 due to the interferences analyzed in the last section.This paper defines the ability of a target fingerprint segment to be distinguished from the localization model as fingerprint segment distinguishability.
Fingerprint segment distinguishability is proportional to segment length while it is inversely proportional to model fingerprint length.Figure 6 clearly demonstrates these relations: (a) shows that, in the first 20 meters of the model fingerprint, there are only two candidate segments, but the number rises to 3 when model fingerprint extends to 55 meters.However, when target segment length increases to 4 meters, candidate segments number drops from 3 to 1.
The signal similarity between a target segment and a candidate segment can be measured with mean Euclidean distance between them.Moreover, the similarities between the target segment and all possible candidate segments in model fingerprint can be calculated through a sliding window.For instance, the similarities between the target segment and possible candidate segments in Figure 6 can be illustrated as Figure 7, in which the red stars are the ground truth location of target segment.In (a), the three highest peaks represent the three most similar candidate segment locations in fingerprint 2, and the same goes for (b).
In order to measure the distinguishability of MFM fingerprint segment against a model fingerprint, the segment distinguishability needs to be quantified.Although error distance is one common way to measure the performance of the localization algorithm, it is infeasible to assume that error distance represents distinguishability, because of MFM's low discernibility.Therefore, the paper proposes a distinguishability measurement method (DAME) based on the number of similar segments and the signal similarity of the Euclidean distance of AC signal component, which is summarized in Algorithm 1.
Segment distinguishability increases as target fingerprint compare length extends.Distinguishability range lies in (0, 1].When target segment distinguishability equals 1, it will represent the notion that, with the corresponding compare length, the segment can be localized within the given fingerprint.Figure 8 reveals this relation of the fingerprints in Figure 6: when target segment length increases by 2.6 m, the segment distinguishability rises to the maximum, and hence its location can be confirmed.Consequently, in order to locate a fingerprint segment from the given localization model, the compare length for this segment should be greater than the value whose distinguishability first equals 1.

Location-Related Fingerprint Extraction.
Indoor magnetic field signal is location-related; however, it is difficult to precisely collect this signal by the magnetometer of the smartphone, because of coarse-grained calibration parameter and sensor electronic noise, as discussed in Section 4. Consequently, these interferences decrease magnetic magnitude distinguishability, causing localization accuracy to decay.In order to improve localization performance, it is important to filter the signals collected by the magnetometer and extract location-related only fingerprints from these signals.
There are three main affecting factors in MFM collection: temporal influence and device attitude, body tremble, and sensor electronic noise.For temporal influence, users will inevitably approach ferromagnetic materials, including iron chairs and cars, with their smartphones in daily life.These materials will change the interior magnetic environment inside the devices.Although the calibration routine of the smartphone will automatically calibrate this change, this process is coarse-grained, which will cause calibrated signal shift up or down.This shift will remain stable until another calibration happens, as shown in Figure 1.The device attitude has similar effects with temporal influence, as shown in Figure 4. Therefore, it is necessary to remove the direct current (DC) component of the magnetic signal.However, the left AC component will still be interfered with by hand tremble and sensor electronic noise.
The body tremble factor is the slight random quiver when a user carrying a device moves around.Affected by coarse-grained hard/soft-iron effect, this tremble will add distorted magnetometer output.Finally, the sensor electronic noise factor is an additive noise to magnetometer output.Because these factors have little relation with locations, it is supposed that the removal of these signals components improves localization performance.
Several fingerprint extraction methods are studied to reject location-unrelated signal components: wavelet transform, Savitzky-Golay filter, moving average filter, wavelet denoising, and Butterworth filter.The wavelet transform method computes a series of wavelets on different scales with the given wavelet [24].The wavelet transform of the signal in Figure 1 is represented as Figure 9.In other words, this method transforms time domain signal into frequency domain signal, and it is expected that this transform might reject location-unrelated signal components.In this transformation, different wavelet factor needs different spatial delay;  therefore, 1 meter is chosen as max.tolerance delay, as the blue line shows.Consequently, the fingerprint is shown in Figure 10, and the vertical heads and tails are transition areas that should be discarded.
The Savitzky-Golay filter method fits successive subsets of adjacent data points with a low-degree polynomial by the method of linear least squares, which is also known as convolution [25].This method is supposed to increase the signal-to-noise ratio without greatly distorting the signal.Consequently, the resulting fingerprint is shown in Figure 11.
The moving average filter method smooths data using a moving average filter, that is, denoising MFM signal by averaging adjacent measurements, with the sacrifice of some adjacent discernibility.The resulting fingerprint is revealed as Figure 12.
The wavelet denoising method performs denoising using given wavelets [26].Typically, there are three steps in the procedure: original signal decomposition to get detail coefficients, detail coefficients modification based on threshold, and signal reconstruction based on modified detail coefficients.The consequent fingerprint is shown in Figure 13.The Butterworth filter is a maximally flat magnitude filter that is designed to have as flat a frequency response as possible in the pass band [27].Considering the indoor MFM mainly distorted by building structures which are much larger than user movement, low pass filter (LPF) is suitable for fingerprint extracting.The magnitude response of the LPF used in the system is depicted in Figure 14, with a pass band from 0 to 0.9 Hz.The resulting fingerprint is shown in Figure 15.
In order to compare the distinguishability of different fingerprint extraction methods, the experiment gathered statistics of mean DAME distinguishability of each method under different compare lengths, as shown in Figure 16.
Clearly, as far as the experiments reveal, except for wavelet transform method, other fingerprint extraction methods improved fingerprint distinguishability compared to that of original fingerprint, especially when the compare lengths of fingerprint segments are short.This improvement owes to the denoising of the original signal.In addition, Butterworth filter fingerprint has the highest distinguishability among all these extracted fingerprints, since it rejects noise based on the signal's frequency rather than simple average adjacent measurements.
In conclusion, this section proposes a fingerprint distinguishability measurement method, DAME; furthermore, with this method, Butterworth LPF is found to be a high discernible fingerprint extraction method for indoor magnetic field among the studies.

Experiments
This section first presents the experiment results of soft/hardiron calibration on different smartphones.Then, the paper compares and evaluates the fingerprint extraction methods of indoor MFM from various aspects.
6.1.Implementation 6.1.1.Devices.The devices used in our experiments were three commercially available smartphones: HTC One X, Samsung S4, and Huawei Mate7, with their main CPU and sensor parameters specified in Table 1.The algorithm was implemented in Matlab 2016a, running on a PC with Intel i5 dual core CPU, 16 G RAM, and Win10 64-bit OS.
6.1.2.Testing Area.These experiments were conducted in a large building, with a testing area of about 1500 m 2 .This is a typical office environment.

Fingerprint Collection.
The road used in our experiment was about 50 meters long.Testers were required to walk at a natural pace along the road, with the phone held in their hand.

Interference Sources of Indoor Magnetic
Field.This part evaluates magnetometer interference sources from two respects: magnetometer calibration error of hard/soft iron and magnetometer electronic noise.
6.2.1.Ubiquitous Hard/Soft-Iron Calibration Error on Smartphones.Testers selected a small free space (0.001 m 3 approximately) inside the lab.Then, for the three test devices, testers successively picked up one of them conducting two movements for one minute: first, testers randomly parallelmoved the phone inside the small space keeping its attitude static.Then, testers randomly rotated the phone with omnidirectional movement.The space was so small that the magnetic field inside this space can be seen as a constant field.Consequently, the first parallel movement was a little affected by hard/soft-iron effect; in contrast, the second rotation movement collected MFM from multiple directions of the smartphone, which exhibited the anisotropy of the magnetometer, as Figure 17 reveals.

Relatively Stable Hard/Soft-Iron Calibration Offset on
the Same Smartphone.Testers randomly selected three small spaces (0.001 m 3 approximately for each) inside the lab.Then, testers conducted two movements as the last experiment did in each space with one device.Clearly, the magnetic fields of the three spaces were different.Figure 18 shows that despite the fact that collecting spaces were different, causing different magnitude mean value, the standard deviation differences between parallel movement and rotation movement are similar, which suggests relative stabilization of hard/soft-iron calibration for the same device.

Pervasive Magnetometer Noise on Smartphones.
In order to measure magnetometer noise of different smartphones, testers successively put the three smartphones in the same place and then collected MFM for one minute.As Figure 19 reveals, all the three clusters of sample data fit normal distribution, which suggests a common Gaussian electronic noise.Furthermore, both the mean and the standard deviation of MFM of the three smartphones are different: firstly, the different means suggests different hard/soft-iron calibration error of different smartphones, while the different standard deviations reveal pervasive but different sensor noise level.

Relatively Stable Magnetometer Noise on the Same
Smartphone.In order to examine magnetometer noise level of the same smartphone in different places, testers randomly selected three places in the lab and then put the phone in each place and kept the smartphone static sampling for one minute.As Figure 20 reveals, the three distributions have different mean magnitude, but their standard deviations were similar, which suggests relatively stable sensor noise on the same device.In conclusion, as far as the experiment is concerned, the soft/hard calibration offsets and magnetometer noise levels on different smartphones are different; however, these offsets and noise levels are relatively stable on the same device.These two factors are the main sources of magnetometer interferences.between the two fingerprints shown in Figure 1.Moreover, distinguishability is affected by fingerprint compare length, so testers need to evaluate distinguishability under different compare lengths.Hence, the mean DAME distinguishability sequence calculation for each extracted fingerprint contains the following steps.

Fingerprint Extraction
Step 1. Assign a compare length  compare and fingerprint extraction method  extraction .
Step 2. With  extraction , extract two fingerprints  extracted 1 and  extracted 2 from the two original fingerprints in Figure 1.
Step 3. Randomly select a fingerprint segment  1 with compare length  compare from fingerprint  extracted 1 .
Step 4. Calculate the DAME distinguishability of this fingerprint segment  1 against fingerprint  extracted Step 5. Repeat Steps 2-4 one hundred times to get 100 DAME distinguishability values and then calculate the mean DAME distinguishability.
Step 6. Assign a new compare length and repeat Steps 1-5 to get a DAME distinguishability sequence with different compare length.
For each experiment, the two original fingerprints were the reference group.Furthermore, to make the experiments precise, the fingerprint segments selected in Step 3 for different fingerprint extraction methods are the same.

Wavelet Fingerprints Extracted by Different Analyzing
Wavelets.Testers used different analyzing wavelets in fingerprint extraction to get different fingerprints and computed their mean DAME distinguishability sequence.The statistic result is shown in Figure 21: morl wavelet performs the best, Haar wavelet has a little improvement, and the other 3 wavelets are even worse than the original fingerprint.This result shows that the performance of wavelet fingerprint extraction depends on wavelet selection.

Savitzky-Golay Fingerprints
Extracted by Different Polynomial Orders.Testers changed the polynomial order in Savitzky-Golay filter fingerprint extraction to get different fingerprints and computed their mean DAME distinguishability sequence.Figure 22 reveals that low order filters have higher distinguishability.

Butterworth LPF Fingerprints Extracted by Different
Low Pass Frequencies.In this experiment, testers changed the low pass frequency in fingerprint extraction to get different fingerprints and then computed their mean DAME distinguishability sequence.The statistic result is shown in Figure 25: low frequencies, for instance, 0.5 Hz and 1.0 Hz, improve distinguishability than higher frequencies.6.3.6.Diversity Fingerprint Extraction.In this experiment, testers selected all the most discernible fingerprints in each

Figure 1 :
Figure 1: Stable and local disturbance of indoor magnetic field.This is the MFM of a 55-meter-long corridor collected in constant speed.The offset between the two signals will be explained in Section 5.2.

Figure 5 :
Figure 5: Static magnetic magnitude collection statistics.The phone was put up on a tree in a park, sampling magnetic data for 55 seconds.

Figure 6 :
Figure 6: Fingerprints similarity with compare length 2 m (a) and compare length 6 m (b).The dash curve of  1 is real-time fingerprint, and that of  2 is magnetic localization model.The bold blue curves are fingerprint segments to be compared.The bold red curves are relative similar segments in the localization model.

Figure 10 :
Figure 10: Haar wavelet transform fingerprint.The vertical heads and tails are caused by Haar wavelet.

Figure 17 :Figure 18 :
Figure 17: MFM statistics of different devices in the same place.Mean statistics (a), standard deviation statistics (b).

Figure 20 :
Figure 20: Static magnetometer measurement distribution of different places by the same smartphone.
Different Average Lengths.Testers changed the smooth length in average moving fingerprint extraction to get different fingerprints and computed their mean DAME distinguishability

Figure 25 :
Figure 25: Butterworth LPF fingerprint extraction by different low pass bands.
Evaluation.In this part, testers first examine the distinguishability of MFM fingerprint extracted by different methods.Then, they evaluate the optimum fingerprint by confusion matrix.To evaluate the distinguishability, testers calculate mean DAME distinguishability with different extraction methods