Next Article in Journal
A Multi-Step-Ahead Photovoltaic Power Forecasting Approach Using One-Dimensional Convolutional Neural Networks and Transformer
Previous Article in Journal
Route Positioning System for Campus Shuttle Bus Service Using a Single Camera
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Evaluation of Different Filtering Methods Devoted to Magnetometer Data Denoising

by
Tiago Pereira
1,*,
Victor Santos
1,
Tiago Gameiro
1,
Carlos Viegas
2 and
Nuno Ferreira
1,3
1
Polytechnic Institute of Coimbra, Coimbra Institute of Engineering, Rua Pedro Nunes-Quinta da Nora, 3030-199 Coimbra, Portugal
2
ADAI (Associação para o Desenvolvimento da Aerodinâmica Industrial), Department of Mechanical Engineering, University Coimbra, Rua Luís Reis Santos, Pólo II, 3030-788 Coimbra, Portugal
3
GECAD—Knowledge Research Group on Intelligent Engineering and Computing for Advanced Innovation and Development of the Engineering Institute of Porto (ISEP), Polytechnic Institute of Porto (IPP), 4200-465 Porto, Portugal
*
Author to whom correspondence should be addressed.
Electronics 2024, 13(11), 2006; https://doi.org/10.3390/electronics13112006
Submission received: 31 March 2024 / Revised: 15 May 2024 / Accepted: 17 May 2024 / Published: 21 May 2024
(This article belongs to the Section Circuit and Signal Processing)

Abstract

:
In this article, we describe a performance comparison conducted between several digital filters intended to mitigate the intrinsic noise observed in magnetometers. The considered filters were used to smooth the control signals derived from the magnetometers, which were present in an autonomous forestry machine. Three moving average FIR filters, based on rectangular Bartlett and Hanning windows, and an exponential moving average IIR filter were selected and analyzed. The trade-off between the noise reduction factor and the latency of the proposed filters was also investigated, taking into account the crucial importance of latency on real-time applications and control algorithms. Thus, a maximum latency value was used in the filter design procedure instead of the usual filter order. The experimental results and simulations show that the linear decay moving average (LDMA) and the raised cosine moving average (RCMA) filters outperformed the simple moving average (SMA) and the exponential moving average (EMA) in terms of noise reduction, for a fixed latency value, allowing a more accurate heading angle calculation and position control mechanism for autonomous and unmanned ground vehicles (UGVs).

1. Introduction

The assessment of a robot’s orientation with respect to a fixed reference is conducted using the heading, also called the azimuth, a vector representing the robot’s direction. This parameter is essential to allow the robot to move along a specific trajectory. It can be obtained in several ways using accelerometers, which measure the acceleration of a given object in motion by calculating its direction, and gyroscopes, which are designed to measure and maintain the orientation of an object relative to a reference point [1]. Another way involves using magnetometer sensors that can measure the intensity and direction of the local magnetic field, providing crucial information about the orientation of a robot relative to the Earth’s magnetic field [2]. Magnetometers have been widely used to estimate the orientation of vehicles, such as cars, and drones, and are fundamentally useful when combined with other sensors, such as gyroscopes, accelerometers, and Global Navigation Satellite System (GNSS) receivers. For example, in the work conducted by Jau-Hsiung Wang et al., an algorithm was proposed using neural networks to estimate the heading from a magnetometer sensor. The proposed algorithm does not require declination information or the estimation of magnetometer bias or the scale factor [3]. Xufei Cui et al. proposed an estimation algorithm integrating an INS/magnetometer system based on a Kalman filter, to combine inertial sensor and magnetometer information with attitude information. The results showed that the algorithm can accurately estimate the azimuth of a vehicle [4]. In the work of M. El-Diasty, an accurate procedure was proposed to estimate the azimuth direction, based on the integration of gyroscope measurements, and using data from the magnetometer to compensate for the changes originated by the gyroscope and using a robust filter to estimate the direction. The results showed that the fusion of the two sensors allowed the achievement of an accurate, smooth, and disturbance-free solution [5].
Sensors like accelerometers and gyroscopes (IMU) often exhibit errors due to noise, which can be divided into two types: deterministic and stochastic. Deterministic noise arises from factors such as sensor misalignment, bias errors, and the scale factor, and can be mathematically modeled. Stochastic noise is random and can be represented by variables following a certain probability distribution [6]. On the other hand, magnetometers can be influenced by interferences that are divided into the following two groups:
  • Hard iron: this category encompasses magnetic fields that are static or only slightly variable over time and whose origin is from ferromagnetic materials [7];
  • Soft iron: refers to the magnetic field generated internally by the device itself and whose origin is from ferromagnetic materials [7].
However, these types of interferences can be mitigated through a calibration process that adjusts a set of parameters to compensate for their effect. In the present work, the heading was obtained based on data from the magnetometer to indicate the azimuth of a forestry robot. It is assumed in this case that the magnetometer was previously calibrated, however it continues to be affected by noise that causes uncertainties in the correct measurement of the heading.
Finite impulse response (FIR) filters, designed using the DFT window method, and infinite impulse response (IIR) filters, based on analog filter prototypes, were the initial candidates to reduce the noise in the magnetometer’s signals. The preliminary results, obtained from simulations, confirm that the filtered signal latency is too large, precluding the real-time operation of unmanned ground vehicles (UGVs) in forest environments. Thus, several moving average filters were then analyzed and implemented to achieve the abovementioned goals.
This article is organized as follows: Section 2 describes several similar related works, devoted to the minimization of the noise present in magnetometers. Section 3 presents the magnetometer used in this work, as well as a detailed description of the proposed digital filters, in order to allow its successful replication in other technical solutions. In Section 4, the results obtained are presented and discussed. Moreover, an innovative approach that considers the maximum delay value as the main criteria to compare the noise reduction capabilities of the filters is validated. Section 5 presents the main conclusions derived from the findings in this study.

2. Related Work

This section presents the state of the art related to the noise characteristics of magnetometers and its sources, as well as the digital filtering techniques used in previous works to minimize noise from magnetometer sensors [8], which complement methods designed to prevent the effects of electromagnetic interference (EMI) [9].

2.1. Magnetometer Noise

Conventional magnetometer sensors can be affected by various independent sources, such as environmental noise in urban and industrial scenarios. These sensors are specifically designed to operate in the nanotesla range (which refers to the unit of measurement for magnetic field intensity); however, they face challenges due to environmental magnetic noise. In this way, magnetometers exhibit distinct types of noise, including 1/f noise and Johnson–Nyquist noise [8]. Flicker noise, also known as 1/f noise, is more pronounced at low frequencies and it can occur from various sources, such as temperature variations or even mechanical vibrations. On the other hand, the thermal agitation of charge carriers in a conducting material produces Johnson–Nyquist white noise, a type of random noise, which is uniform across all frequencies. When evaluating the performance of magnetometers, these types of noise should be taken into consideration as they can affect the sensitivity and accuracy of magnetometers across various frequency ranges [10].

2.2. Advancements in Noise Minimization in Magnetometer Sensors

In recent years, advancements have been observed in the field of magnetometer sensor noise minimization. This area of research aims to improve the accuracy and reliability of data from these sensors, which play a fundamental role in a wide variety of applications, such as autonomous localization and navigation systems.
For example, Dressler M. et al. managed to reduce the white noise of a fluxgate magnetometer by introducing a JFET input stage integrated directly into the magnetometer sensor head to achieve high common-mode rejection and low circuit loading, resulting in noise reduction contributions [11]. In [12], the authors used a method to cancel noise transmitted by a BLDC motor, thus not affecting the magnetometer sensor readings. An inverse filter was applied in the time domain, demonstrating a positive performance. Porang T. et al. conducted a comparative study between two filtering techniques, namely the Kalman filter and the Butterworth low-pass filter, applied to readings from a GPS and magnetometer sensor. These sensors were coupled to a tank-shaped robot, and the Kalman filter demonstrated greater stability in terms of the magnetometer data readings [13]. Ning Z. et al. proposed an adaptive method for reducing noise in magnetometer sensor readings. The authors designed an adaptive filtering algorithm with multiple fading memory factors to perform offline noise reduction on the magnetometer’s output data. The results showed good filtering capacity of the proposed method, successfully reducing noise [14].
However, the current literature lacks methods for reducing noise originating from magnetometer sensors using digital filtering techniques with minimum delay and distortion, which motivated the undertaking of this study.

3. Method Development

3.1. The UGV Platform

The UGV platform used in this study was a MDB LV600 PRO (MDB, Fossacesia, Italy) multipurpose remote-controlled platform designed to operate in outdoor environments, as illustrated in Figure 1.
The aim was to make this robotic platform autonomous by integrating a variety of multimodal sensors. The sensors were integrated in a sensor module called Sentry (as shown in Figure 1 and attached on the top of the platform), and were responsible for the machine’s perception and control, enabling autonomous localization and navigation [15,16].
One of the fundamental parameters for the autonomous navigation of a robot is its orientation, which specifically consists of a direction vector indicating the alignment of the robot, with north coinciding with the Y-axis and east coinciding with the X-axis, projected onto a two-dimensional map. This orientation was determined by a Bosch BMM150 (Bosch Sensortec GmbH, Reutlingen, Germany) magnetometer present in the Sentry module. The magnetometer sensor measures the magnetic fields using the Hall effect [17]. The sensor characteristics are shown in Table 1.
The sensor has a semiconductor plate with an electric current flowing through it. When this semiconductor is exposed to an external magnetic field, a Lorentz force is applied, resulting in the movement of electrons to one side of the plate, generating a potential difference called the Hall voltage. This voltage is directly proportional to the intensity of the applied magnetic field, and the sensor measures the Hall voltage and converts it into a magnetic field reading [17]. The BMM150 sensor contains three axes with high precision for detecting weak and strong magnetic fields. These characteristics contribute to the precise estimates of the robot’s state. Its structure can be observed in Figure 2.
In this sensor, Hall effect components are responsible for detecting the magnetic fields around it and converting this information into an electrical signal. Subsequently, there are signal conditioning circuits that amplify/process the Hall sensor signal to ensure a more reliable reading. Then, the analog signal is converted into a digital signal through an ADC, which provides compatibility with microcontrollers and other electronic devices. The BMM150 sensor includes communication interfaces, such as the inter-integrated circuit (I2C) or serial peripheral interface (SPI) [17]. This sensor is coupled to a module called Duro Inertial (Figure 3) from Swift Navigation, which in turn is attached to the top of the Sentry.
The data from the magnetometer sensor is read using the Robot Operating System (ROS) framework, which communicates via the Ethernet with the Duro Inertial sensor, as depicted in Figure 4. The corresponding source code is available at [18].
Through the raw data obtained from the magnetometer, it is possible to manipulate the data to achieve the heading. Therefore, the following sections will discuss the performance of several moving average filtering techniques, with the aim of reducing the noise present in the signals.

3.2. Moving Average Filters

Moving average filters are widely used in engineering and economics to identify trends, smooth time-series data that exhibit short-term fluctuations, or to filter signals that are corrupted by AWGN noise. The most common versions are implemented using FIR filters, with the output, at each instant, being the weighted sum of a fixed number of past values of the input signal. This process is thereafter repeated, moving the window in order to calculate the mentioned weighted sum using new time-series data that includes new input samples, while discarding the oldest ones.
In a simple moving average (SMA) filter [19], all the input data are equally weighted to produce an output value, which is obtained by multiplying the last N input samples by a 1/N factor and discarding those that fall outside this range. The SMA filter impulse response is, therefore, given by:
  h S M A n = 1 N ,   0 n N 1
where N is the filter length or number of samples taken in the averaging process.
The linear decay moving average (LDMA) filter, as the name indicates, is a moving average FIR filter whose weighting factors will decay linearly. The most recent input signal samples will have the highest weights and the oldest ones the lowest. The filter impulse response is similar to the Bartlett window, but only the decaying part is considered, thus hLDMA is no longer even symmetrical around a central peak value. The LDMA filter impulse response is defined using expression [20]:
h L D M A n = 2 N N + 1 · N n     ,   0 n N 1
The raised cosine moving average (RCMA) filter, as before, emphasizes the most recent input samples, which have the maximum weight, and undervalues the oldest ones. The proposed filter is based on the Hanning filter; however, only the part in which the weight values are progressively decreasing, according to a raised cosine shape, is considered (see Figure A1 of Appendix A), resulting in the RCMA impulse response:
h R C M A n = 1 N + 1 · 1 + c o s n π N = 2 N + 1 · cos 2 n π 2 N ,   0 n N 1
Finally, an IIR filter named the exponential moving average (EMA) is considered to diminish the noise variance in the acquired signal. The EMA filter, first introduced in [21], has an impulse response in which the past input values are geometrically reduced accordingly to their oldness. The EMA filter impulse response is given by:
h E M A n = α · β n ,   0 n < ;         0 < β < 1 ;   α = 1 β
The β parameter, called the smoothing coefficient, is a positive real value less than one, which directly reflects the time constant that is intended to be implemented by the filter. In order to hold a unit DC gain, the filter constants α and β must fulfill the equation α = 1 − β. Moreover, Refs. [20,21] defines the relationship between the smoothing geometric constant β and the SMA filter length N, which results in a group delay or lag value equal to N 1 / 2 , which is the one associated with an even symmetric or an asymmetric impulse response.
α = 2 N + 1 ;     β = N 1 N + 1   ;     N = 1 + β 1 β  
In order to design the most suitable filter, aiming to mitigate the inherent noise present in the magnetometer’s signals, it is necessary to analyze the frequency responses of the proposed filters.
The analysis of the SMA filter is a mature subject [19,22]; its transfer function is given by:
H S M A z = 1 N · 1 z N 1 z 1
The zeros of HSMA(z) are located over the unit circle of the z plane, starting at z = 1, being separated by angles equal to 2π/N. A pole-zero cancellation occurs at z = 1, allowing the desired unitary DC gain. The location of the zeros on the unit circle leads to frequencies with zero gain and distinctive side lobes in the magnitude of the frequency response, as depicted in Figure 5a,b for filters with N equal to 11 and 21, respectively.
The LDMA filter transfer function is described by:
H L D M A z = 2 N N + 1   · N N + 1 z 1 + z N + 1 1 z 1 2
Analyzing the frequency response of the LDMA filter, it is possible to verify the existence of two poles at z = 1 that will be canceled by two zeros of HLDMA(z); double pole-zero cancellation, being the remaining zeros now located inside the unit circle, resulting in a smoother frequency response at higher frequencies, as showed in Figure 5.
The proposed RCMA filter transfer function is obtained by applying the definition:
H R C M A z = n = + h R C M A n · z n = 1 N + 1 · n = 0 N 1 1 + c o s n π N   · z n
developing the equation and dividing the summation in two, and thereafter applying the infinite geometric sum formula and the Euler identity, we get:
H R C M A z = 1 N + 1 · 1 z N 1 z 1 + 1 + z N · 1 c o s π N · z 1 1 2 · c o s π N · z 1 + z 2
The RCMA filter transfer function is now rewritten considering that γ = cos π / N :
H R C M A z = 1 z N · 1 2 γ z 1 + z 2 + 1 z 1 · 1 + z N · 1 γ z 1 N + 1 · 1 z 1 · 1 2 γ z 1 + z 2
The filter transfer function HRCMA(z) is given by:
H R C M A z = 2 1 + 3 γ z 1 + 1 + γ z 2 1 γ z N + 1 1 γ z N + 2 N + 1 1 z 1 1 2 γ z 1 + z 2  
The filter transfer function has three poles located on the unit circle that will cancel with three zeros, the remaining zeros are located inside the unit circle, resulting in a smooth magnitude response and a nonlinear phase response, which contrasts with the characteristics and the zero’s location on the Hanning window (Figure A4 of Appendix A).
The EMA filter transfer function is given by:
H E M A z = α 1 β z 1
which corresponds to a first order IIR filter having a single pole at z = β, being its location fundamental to the noise mitigation and the definition of the time constant values.

3.3. Noise Reduction Analysis

The extraction of the desired signal from an acquired signal, which usually includes AWGN noise, is performed by means of an accurately designed filter H(z) that removes the unwanted noise leaving unaffected the desired signal features. Keeping in mind the peculiarities of the intended application, in this case the evaluation of the UGV heading based on coordinates taken from the magnetometer’s sensors, the designed denoise filter must remove as much noise as possible, with the minimum delay and distortion, preserving a unitary gain at frequencies close to DC.
The noise reduction effectiveness of a digital linear filter is measured by the noise-reduction factor (NRF), which quantifies the ratio of the output mean square noise values with respect to its input counterpart, defined by the following equations:
N R F = σ o 2 σ i 2 = 1 2 π   π π H ω 2 · d ω = n h 2 n
The output and input mean square noise values of the noise components of the signals are defined by σ o 2 = E z 2 n and by σ i 2 = E v 2 n , z n and v n , being the output and input noise time sequences, respectively, with z n = h n     v n , and also assuming linear filter usage that independently affects the desired signal and undesired noise that are superposed. Parseval’s theorem is also used to evaluate the energy of the filtered noise signal in the time domain, which is equivalent to the energy evaluated in the frequency domain, integrating the square of the filter magnitude response.
The NRF expressions of the considered moving average filters, SMA, LDMA, RCMA, and EMA, shown in Table 2, were evaluated using (13).
The noise-reduction factor of the proposed RCMA filter follows definition (13):
N R F R C M A = n = 0 N 1 h R C M A n 2 = n = 0 N 1 1 N + 1 · 1 + c o s n π N 2  
By developing the binomial and dividing the summation into three parts, we obtain:
N R F R C M A = 1   N + 1 2 · n = 0 N 1 1 + 2 · n = 0 N 1 c o s n π N + n = 0 N 1 c o s 2 n π N  
From the individual sums, we obtain the N R F R C M A expression:
N R F R C M A = 1   N + 1 2 · N + 2 + N 2 = 3 N + 4 2   N + 1 2  
The formulas were validated by simulations performed in MATLAB R2024a. In those simulations, it was considered that a deterministic signal (constant or sinusoidal) was corrupted by AWGN noise, with a particular variance value. The simulated NRF values were thereafter evaluated, dividing the filtered noise signal variance by the variance of the input noise for 108 length sequences.
From the results, shown in Figure 6, it is observed that the NRF value decreases with the increase in the filter length, improving the noise mitigation capabilities of the mentioned digital filters. For comparison purposes, an equivalent β parameter is used for the EMA filter that satisfies (5). Among the studied filters, the SMA filter is always the one that offers the best performance in terms of noise reduction for the same equivalent filter length.
Keeping in mind that the planned solution will be implemented in the real-time trajectory control of an autonomous UGV, it is crucial that its position and direction values have been acquired and processed with minimum latency. The autonomous vehicle’s heading values are obtained using the magnetometer’s signals that are corrupted by noise, thus the noise minimizations filters must introduce minimum latency or lag. Thus, from now on, the performed analysis must consider the filter delay as the reference parameter instead of the filter order. Moreover, the literature has shown that a larger noise-reduction factor is always associated with an increase in the filter group delay or lag.
The application of linear-phase FIR filters, implemented by even or odd symmetrical windows, is a mature topic, resulting in a group delay value equal to N 1 / 2 . The delay group is also independent of the frequency, being the derivative of the filter delay. That value is constant irrespective of the observed frequency. As presented above, the SMA filter has a symmetrical impulse response around a central point, satisfying the previous assumptions. The proposed LDMA and RCMA filter impulse responses are no longer even symmetrical, since they have been restricted to the descending part of the classical Bartlett and Hanning windows, respectively.
To evaluate the group delay (GD) at DC, the lag or latency of the proposed filters, we used a generic formula presented in [23]. The group delay at DC is evaluated computing the following summation:
G D = n = 0 n · h n
where n is the index number and h n is the filter impulse response. This expression is easily computed by simply multiplying, element by element, the filter impulse response vector, by a vector with linear increasing integer values (ramp signal).
Appling (17) to the analyzed filters result in expressions, shown in Table 3, that can be used to evaluate the GD of the proposed filters based only on the filter length N. The GD expression for the RCMA filter approximates the exact result computed, as the filter length increases the error of that evaluation becomes negligible.
From the results presented in Figure 7 it can be concluded that the GD value increases with the increase in the filter length. The RCMA filter produces the lowest latency, followed by the LDMA filter. Due to its even symmetry, the SMA filter produces a group delay value higher than the mentioned ones. It can also be concluded that the RCMA and LDMA filters have a lower latency value than that associated with the Bartlett and Hanning windows, for the same filter length. Figure 7 is a valuable resource in the assessment of the filter lengths that produce the same GD or latency value. As an example, for a target latency equal to 10 samples it is advisable to use: an SMA filter with N = 21; an LDMA filter with N = 31; an RCMA filter with N = 35; and an EMA filter with β equal to 10/11.
To validate the GD expressions, simulations were conducted to quantify the filtered signal delay regarding a sinusoidal input signal. Figure 8a,b presents the sinusoidal response of the considered filters, SMA, LDMA, RCMA and EMA, for lengths equal to 11 and 21, or equivalent values, respectively. From the obtained results it can be concluded that the RCMA filter presents the lowest latency at 119.38 ms, followed by the LDMA filter with a value of 133.33 ms and, finally, the SMA and EMA filters present a similar GD value of 200 ms. The same tendency is observed for filters with a length equal to 21. The filtered sinusoidal signal amplitudes are slightly different; this arises from the different gain values of the filter’s magnitude frequency response at the signal frequency ω = 0.05   r a d / s a m p l e , as shown in Figure 5a,b, with the EMA filter magnitude being the lowest and the RCMA filter the highest one.
The next stage of our analysis consists of a comparative study on the performance of moving average filters, assuming that the filters are of equal length. From the obtained results, as shown in Table 4, we can conclude that the SMA filtering technique outperforms the LDMA and RCMA techniques. The NRF value of the SMA filter is the lowest one among the considered filters; on the other hand, the latency or group delay value of the SMA filter is the largest. Although the EMA filter presents a similar result with respect to the SMA filter, its step response exhibits an undesirable behavior, underperforming in comparison to the other analyzed filters. In the conducted analysis, the magnetometer signals have been taken at a sampling rate of 25 Hz, i.e., a sampling time interval of 40 ms.
Filters processing time delay, as already known, have a noticeable degrading effect on control system performance, namely those that involve close loop control [24]. Thus, for the considered UGV position control mechanism, two maximum latency values were defined for the conducted analysis and simulations: 200 ms and 400 ms. For the abovementioned sampling time of 40 ms, the latency values correspond to 5 and 10 samples, respectively. Thus, knowing that the SMA filter latency is equal to N S M A 1 / 2 , then these values correspond to filter lengths equal to NSMA = 11 (200 ms latency) and NSMA = 21 (400 ms latency).
The next step is the LDMA filter NLDMA value assessment, which results in the same group delay value with respect to a particular SMA filter. Rearranging the expressions presented in Table 3, it is possible to evaluate the NLDMA, based on the SMA filter NSMA value, using (18).
N L D M A = 3 N S M A 1 2  
The obtained NLDMA value is now used to evaluate the NRF of the LDMA filter, which produces the same latency as an SMA filter with length NSMA. From the obtained expression and results, we conclude that this innovative solution always outperforms the SMA filter, ensuring a given latency target value.
8 · N S M A 9 · N S M A 2 1 < 1 N S M A               N R F L D M A < N R F S M A
An SMA filter of length 11 reduces the noise by a factor of 0.09091 (1/11) and produces a latency equal to five samples, those values are compared with an LDMA filter of length 16, which produces the same latency and reduces the noise by a factor of 0.08088 (11/136), as can be seen in Table 5. As explained before, the SNR is inversely proportional to the NRF, thus the proposed LDMA filter usage outperforms the SMA filter by 0.50753 dB. For longer filter lengths that value converges to 0.51153 dB. Moreover, the observed trend in the results is independent of the latency value, as can be seen for the LDMA filter of length 31, which outperforms the SMA filter of length 21, both filters having a group delay of 10 samples.
Despite the lack of a closed formula to assess the group delay of the RCMA filter, it is possible to observe from the results presented in Table 5 that an RCMA filter with N = 17 will reduce the noise by a factor of 0.08488, with a latency value of 190.60 ms. This result is better than the one obtained for the SMA filter, but slightly worse than the corresponding one attained for the LDMA filter. If a 1.2% increase in the latency value to 202.48 ms is allowed, then an N = 18 filter with an NRF value of 0.08033 can be used, which performs better than the equivalent LDMA filter of length 16. The same trend is observed in the filter’s performance, if a 400 ms group delay was considered as a design constraint value.
The obtained results can also be verified in the frequency domain. Figure 9 presents the frequency response of the filters for an equal group delay, with it being possible to observe the lowest magnitude of the LDMA and RCMA filters’ frequency responses for frequencies higher than that associated with the first null of the SMA filter’s response. That observation explains the improved performance in regard to the noise reduction goal of those filters with different lengths, while maintaining the latency constant. A non-significant advancement was obtained from the EMA filter usage.
Now, to validate the new proposed method, a transient analysis of the considered filters is performed [25]. Figure 10a shows the step response of the filters, assuming that they have a length of 11. From the results obtained, it is possible to conclude that the LDMA and RCMA filters respond faster than the SMA filter, this is consistent with the lower GD values observed; however, all three filters, SMA, LDMA and RCMA, reach the final stage value after 11 samples only, due to the inherent DC unit normalization [20,25]. The EMA filter step response is slower and takes a significantly extended time period to reach the final value of the step. In that analysis, a β = 5/6 value was considered for the EMA filter, which is equivalent to an SMA filter with N = 11, according to (5).
Figure 10b presents the step response of the filters, with different length values, which produce the same GD or latency value. Once again, all the filters respond faster than the SMA filter until a particular point, around 80% of its final value. Thereafter, the LDMA and RCMA filter responses are slower, since the weights associated with the oldest values of their impulsive response are significantly smaller, contributing less to the output value. Moreover, only after 16 and 18 times, the sampling interval, respectively, did the mentioned LDMA and RCMA filters reach the exact step value.

4. Results

This section presents the experimental results obtained from the new proposed approach, which considers latency as the main design criterion for filters devoted to reducing noise in magnetometers. The experiment involves collecting data in static conditions, by attaching a Duro Inertial sensor to a wall at the top of a building.
Since the position of the device does not change, the result obtained is a reference signal superimposed on the noise (the X, Y, and Z signals acquired from the magnetometer are corrupted by noise). The following sections in this paper are dedicated to the statistical analysis of the raw and filtered signals, with the aim of determining which filtering technique and filtering order provides the best performance in terms of noise reduction.

4.1. Data Collection System

As mentioned above, data collection from the magnetometer sensor was conducted under stationary conditions. The Duro Inertial sensor was placed on a platform and then fixed to a wall at the top of a building forming part of the Association for the Development of Industrial Aerodynamics, located on the campus of the Faculty of Science and Technology at the University of Coimbra, Portugal, as shown in Figure 11.
The magnetometer’s signals were then acquired at a sampling rate of 25 Hz. Those signals were filtered, in real time, using the proposed moving average filters. The filters were implemented on a processing unit equipped with an Intel® Core™ i7-5500U CPU (Intel Corporation, Santa Clara, CA, USA), operating at 2.4 GHz, and with 4 GB of DDR3L SO-DIMM RAM (Kingston Technology, Valley, CA, USA). The filter source code was developed in Python, using the NumPy library. The implemented solution uses floating-point arithmetic.
After collecting the raw and filtered signals, statistical analysis was carried out which included assessing the mean, standard deviation (SD), and mean absolute error (MAE) of the raw and filtered time-series data.
The MAE is a metric that calculates the arithmetic mean of the absolute differences between the values predicted by a model and the actual values of a given data set. The lower the MAE value, the better the model’s performance, indicating that the predictions are close to the actual values. In summary, the MAE is defined as follows [26]:
M A E = 1 N · i = 1 N | y i y i ^ |  
where, as follows:
  • N is the number of samples;
  • y is the observed value for each sample;
  • y i ^ is the value predicted by the model for each sample.
The MAE metric was selected, among others, because it offers the better resistance against distortions introduced by outliers present in the signal time series, treating all errors equally.

4.2. Experimental Results

From now on, our analysis is devoted to the evaluation of the heading direction, i.e., the orientation of the robot relative to the Earth’s magnetic field using the Duro Inertial, in a fixed position, based on the magnetometer’s signals.
Figure 12 illustrates the three raw data signals acquired from the magnetometer corresponding to the X, Y, and Z axes. By analyzing the acquired data, it is possible to observe the quantized noise superimposed on the signals that will be processed. From the data, it is also possible to state that the highest magnitude values are associated with the X and Z axes, with the Y-axis measured values being residual. Moreover, from the statistical analysis of the raw data obtained from the magnetometer, it is possible to conclude that the amplitude distribution of the sampled signals related to the magnetic field in the X, Y, and Z axes, under static conditions, roughly follows a Gaussian distribution.
The raw data acquired from the Duro Inertial magnetometer associated with the X-axis was then filtered using two SMA filters with lengths equal to 11 and 21, and two LDMA filters with lengths equal to 16 and 31, the results of which are shown in Figure 13a and Figure 13b, respectively. The results show that increasing the length of the filters always results in a greater capacity to reduce noise and signal fluctuations. For filters with the same latency, the LDMA technique performs better than the SMA technique.
The overall noise reduction performance of the filters was also evaluated based on descriptive statistics of the data acquired by the magnetometer before and after filtering. From the results presented in Table 6, it can be concluded that all proposed filters significantly reduce the noise in the magnetometer signals, a conclusion based on the reduction in the standard deviation value observed in the filtered signals.
Among them, the LDMA filter provides the greatest reduction in the value of the standard deviation on the X and Z axes, closely followed by the RCMA filter. The above assumption that the raw signals follow a Gaussian distribution makes it possible to calculate the noise reduction factor using the variance values of the filtered σ f i l t e r e d 2 and raw signals σ r a w 2 , the square values of the standard deviations presented. Considering the Z-axis and an LDMA filter with N = 16, the approximate NRF is equal to 0.2476 or 0.514 2 / 1.033 2 , which is higher than the theoretical value of 0.081.
The results presented in Table 6 are now compared with other filtering methods available in the literature [14] to reduce the magnetometer noise.
Table 7 shows the NRF values calculated from the standard deviation values of the filtered σ f i l t e r e d and raw signals σ r a w , using Equation (13). For the wavelet denoising, EKF, and adaptive filter techniques, the NRF values were calculated based on the data available in Table V of [14]; for the moving average filters studied in this article we used the data shown in Table 6.
From the results presented in Table 7, we conclude that the LDMA filter with N = 31 and the RCMA filter with N = 35 outperform the wavelet denoising technique, behave slightly better than the extended Kalman filter (EKF), and perform worse than the adaptive filter, with larger NRF values. Note that [14] uses the RM1300 sensor, while we have used the BMM150 sensor. In addition, compliance with the latency limit is not guaranteed for the analyzed adaptive filter.
The final step in our analysis is devoted to the heading signal. Firstly, we examine the raw heading values evaluated from the noisy magnetometer signals, which also exhibit a quantized nature. The raw unprocessed heading data is depicted in the upper graph in Figure 14, with the filtered version shown in the lower graph; once again, an SMA filter of length 11 was used to smooth the original heading signal.
Table 8 presents the descriptive statistics of the heading signal before and after filtering, using different moving average filters and lengths. The mean, standard deviation, and MAE values of those signals are used to access the filtering technique performance. The results exhibit a notable reduction in the filtered heading signal standard deviation, with respect to the raw heading data for all the considered filters. As an example, considering a latency limit of five samples (or 200 ms), the standard deviation σ values were equal to 0.8787°, 0.8303°, 0.8278°, and 0.8695° from an SMA filter with N = 11; an LDMA filter with N = 16; an RCMA filter with N = 18; and an EMA filter with β = 5/6, respectively. Those values must be compared with the raw heading data standard deviation equal to 1.8007°. For filters with a longer length, the noise reduction capabilities increase further.
The results show that the RCMA filter has the best noise attenuation capacity for a latency value of 5 or 10 samples and that the LDMA filter presents similar performance.
Regarding heading noise reduction, we claim that for a latency threshold of 10 samples, all the proposed filtering techniques, SMA of length 21, LDMA of length 31, RCMA of length 35, and EMA with β equal to 10/11, outperform the adaptive filtering presented in [14]. However, if that latency limit reduces to five samples, the adaptive filtering performs better.
The noise-reduction factor for the adaptive filtering presented in [14] was evaluated by dividing the variance of the filtered heading signal by the variance of the raw heading signal; the result obtained is equal to σ f i l t e r e d 2 / σ r a w 2   = 0.1985 . The variance values were obtained by squaring the standard deviation values of the heading signals before and after filtering, which were equal to σ f i l t e r e d = 0.5387 ° and σ r a w = 1.2089 ° , respectively. Those values were obtained from Table VII of [14].
A different approach was proposed and analyzed, which involved filtering the heading signal instead of filtering the magnetometer signals, used to calculate the heading. This approach, which swaps the order in which the filtering and heading calculations were performed, results in a slightly lower-quality performance.

5. Conclusions and Future Work

This article presents a performance evaluation of different digital filtering techniques to minimize the noise observed in magnetometers. These sensors are used in diverse applications, such as mobile robotics and autonomous UGVs, where they provide crucial orientation information needed for navigation. However, these sensors are sensitive and can be affected by several types of noise, including flicker noise and Johnson–Nyquist noise.
Four moving average filters, SMA, LDMA, RCMA, and EMA, were thereafter selected and analyzed to smooth the magnetometer’s data, which was corrupted with different types of noise. The RCMA filter is an innovative technique, proposed by the authors, which only considers the descending part of the Hanning window impulse response. A comparative analysis of these filtering techniques is available in Appendix A.
The results indicate that the SMA filtering technique outperforms the LDMA and RCMA techniques in terms of noise reduction, if filters of equal length are considered; although the SMA filter presents a higher latency, when compared with the LDMA and RCMA proposals.
Considering the impact of latency on autonomous navigation systems, a maximum delay value was considered in the filter design procedure, instead of the usual filter order value. Under the same latency assumption, the LDMA and RCMA filters outperformed the SMA and the EMA filters, with a similar transient step response.
All the techniques were then implemented using a microprocessor and an experimental procedure was conducted, using a Duro Inertial sensor. From the experimental results obtained by placing the Duro Inertial in a fixed position, it can be seen that the noise in the magnetometer is significantly reduced by filtering. The sensor heading values calculated from the magnetometer’s filtered data also show a reduction in the standard deviation values, which is consistent with a reduction in noise. The RCMA filter stands out, with the lowest standard deviation and MAE values of all the techniques analyzed, independently of the latency value: 200 ms or 400 ms. The proposed approach, which defines the allowed latency and then selects the technique that minimizes noise mitigation, offers significant advantages in terms of real-time position control system performance. Due to its noise reduction capabilities, minimal phase distortion, and simplicity, the RCMA filter was selected to be implemented in the considered UGV.
As future work, several other approaches and enhancements could be considered and implemented based on local polynomial smoothing, wavelet denoising, minimum-roughness filters, and smoothing splines.

Author Contributions

Methodology, T.P., V.S., T.G. and N.F.; software, V.S., T.P and T.G.; validation, V.S.; formal analysis, N.F.; investigation, V.S. and T.P.; resources, C.V.; writing—original draft, T.P. and V.S.; writing—review and editing, T.G., C.V. and N.F.; visualization, T.G. and N.F.; supervision, C.V.; project administration, C.V. and N.F.; funding acquisition, C.V. and N.F. All authors have read and agreed to the published version of the manuscript.

Funding

The present work was funded in the scope of the following projects: E-Forest—Multi-agent Autonomous Electric Robotic Forest Management Framework, ref. POCI-01-0247-FEDER-047104 and by project F4F—Forest for Future, ref. CENTRO-08-5864-FSE-000031, co-financed by European Funds through the programs Compete 2020 and Portugal 2020. Also, this work was funded by the Portuguese Foundation for Science and Technology under the project grant UIDP/00760/2020 with the DOI 10.54499/UIDP/00760/2020 | https://doi.org/10.54499/UIDP/00760/2020, project LA/P/0079/2020, DOI: 10.54499/LA/P/0079/2020 | https://doi.org/10.54499/LA/P/0079/2020 and project grant UIDB/00760/2020 with the DOI 10.54499/UIDB/00760/2020 | https://doi.org/10.54499/UIDB/00760/2020 (accessed on 26 April 2024).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A

This appendix contains additional information on the characteristics of the RCMA filter and the Hanning window, illustrated by means of a practical example. The impulse response of the classic Hanning window (causal version) is given by:
h H a n n n = 1 2 · 1 c o s 2 n π N = s i n 2 n π N ,       0 n N
where L = N + 1 is the window length. Since the last value of the Hanning impulse response is always zero, the effective length of the window is reduced to N.
To guarantee a unity DC gain, it is necessary to normalize the Hanning window, which results in a scaled version of (A1), by a factor of 2 / N .
h H a n n _ 2 n = 2 N · s i n 2 n π N ,       0 n N
The DC normalization performed on the Hanning window modifies the gain of the transfer function only, while maintaining all its original characteristics, namely: pole-zero patterns, magnitude and phase responses, and group delay and impulse response shape. The example used to illustrate the differences between the aforementioned techniques considers an RCMA filter and a normalized Hanning window, both with N equal to 11. The impulse responses of the above filters are shown in Figure A1.
Figure A1. Impulse response: (a) RCMA filter (N = 11); (b) Hanning window (N = 11).
Figure A1. Impulse response: (a) RCMA filter (N = 11); (b) Hanning window (N = 11).
Electronics 13 02006 g0a1
Figure A2 illustrates the magnitude and phase responses of the RCMA filter and Hanning window for N equal to 11.
Figure A2. Magnitude and phase frequency responses: (a) RCMA filter (N = 11); (b) Hanning window (N = 11).
Figure A2. Magnitude and phase frequency responses: (a) RCMA filter (N = 11); (b) Hanning window (N = 11).
Electronics 13 02006 g0a2
The group delay of the Hanning window, shown in Figure A3b, is constant for all frequencies, because the filter has a linear phase. The group delay of the RCMA filter decreases significantly as the frequency increases, with the highest value occurring at DC, as illustrated in Figure A3a.
Figure A3. Group delay: (a) RCMA filter (N = 11); (b) Hanning window (N = 11).
Figure A3. Group delay: (a) RCMA filter (N = 11); (b) Hanning window (N = 11).
Electronics 13 02006 g0a3
Figure A4a,b depicts the pole-zero patterns of the considered RCMA filter and normalized Hanning window, respectively.
Figure A4. Pole-zero pattern: (a) RCMA filter (N = 11); (b) Hanning window (N = 11).
Figure A4. Pole-zero pattern: (a) RCMA filter (N = 11); (b) Hanning window (N = 11).
Electronics 13 02006 g0a4

References

  1. Quoc, D.D.; Sun, J.; Le, V.N. Attitude Estimation Algorithms Using Low Cost IMU. Int. J. Control Autom. 2015, 8, 113–126. [Google Scholar] [CrossRef]
  2. Belalcazar-Bolaños, E.A.; Torricelli, D.; Pons, J.L. Automatic Detection of Magnetic Disturbances in Magnetic Inertial Measurement Unit Sensors Based on Recurrent Neural Networks. Sensors 2023, 23, 9683. [Google Scholar] [CrossRef] [PubMed]
  3. Wang, J.-H.; Gao, Y. A New Magnetic Compass Calibration Algorithm Using Neural Networks. Meas. Sci. Technol. 2005, 17, 153–160. [Google Scholar] [CrossRef]
  4. Cui, X.; Li, Y.; Wang, Q.; Karaim, M.; Noureldin, A. Vehicle Heading Estimation of INS/Magnetometer Integrated System Based on Constant Hard Iron Interference Calibration. Meas. Control 2021, 54, 1208–1218. [Google Scholar] [CrossRef]
  5. El-Diasty, M. An Accurate Heading Solution Using MEMS-Based Gyroscope and Magnetometer Integrated System (Preliminary Results). ISPRS Ann. Photogramm. Remote Sens. Spat. Inf. Sci. 2014, 2, 75–78. [Google Scholar] [CrossRef]
  6. Nirmal, K.; Sreejith, A.G.; Mathew, J.; Sarpotdar, M.; Suresh, A.; Prakash, A.; Safonova, M.; Murthy, J. Noise Modeling and Analysis of an IMU-Based Attitude Sensor: Improvement of Performance by Filtering and Sensor Fusion. SPIE Proc. 2016, 9912, 99126W. [Google Scholar] [CrossRef]
  7. Kuncar, A.; Sysel, M.; Urbanek, T. Calibration of Triaxial Accelerometer and Triaxial Magnetometer for Tilt Compensated Electronic Compass. In Automation Control Theory Perspectives in Intelligent Systems; CSOC 2016. Advances in Intelligent Systems and Computing; Silhavy, R., Senkerik, R., Oplatkova, Z.K., Silhavy, P., Prokopova, Z., Eds.; Springer: Cham, Switzerland, 2016; Volume 466. [Google Scholar] [CrossRef]
  8. Lenz, J.; Edelstein, S. Magnetic Sensors and Their Applications. IEEE Sens. J. 2006, 6, 631–649. [Google Scholar] [CrossRef]
  9. Basit, A.; Daraz, A.; Zhang, G. Implementation of a Wideband Microwave Filter Design with Dual Electromagnetic Interference (EMI) Mitigation for Modern Wireless Communication Systems with Low Insertion Loss and High Selectivity. Micromachines 2023, 14, 1986. [Google Scholar] [CrossRef] [PubMed]
  10. Robbes, D. Highly Sensitive Magnetometers—A Review. Sens. Actuators A Phys. 2006, 129, 86–93. [Google Scholar] [CrossRef]
  11. Dressler, M.; Janosek, M.; Butta, M. Reduction of Magnetic Noise Limits of Orthogonal Fluxgate Sensor. AIP Adv. 2021, 11, 015347. [Google Scholar] [CrossRef]
  12. Unwin, N.J.; Postula, A.J. Filtering of Magnetic Noise Induced in Magnetometers by Motors of Micro-Rotary Aerial Vehicle. In Proceedings of the Eighth International Conference on Advances in Circuits, Electronics and Micro-Electronics, Venice, Italy, 23–28 August 2015. [Google Scholar]
  13. Porang, T.; Maneetham, D.; Aung, M.M. Kalman and Butterworth Filter Comparison for GPS and Magnetometer Sensors. In Proceedings of the 2022 IEEE 8th Information Technology International Seminar (ITIS), Surabaya, Indonesia, 19–21 October 2022. [Google Scholar] [CrossRef]
  14. Ning, Z.; Fu, J.; Chang, Y.; Lyu, T. Improved MEMS Magnetometer Adaptive Filter Noise Reduction and Compensation Method. IEEE Sens. J. 2022, 22, 1252–1264. [Google Scholar] [CrossRef]
  15. Pereira, T.; Gameiro, T.; Viegas, C.; Santos, V.; Ferreira, N. Sensor Integration in a Forestry Machine. Sensors 2023, 23, 9853. [Google Scholar] [CrossRef] [PubMed]
  16. Gameiro, T.; Pereira, T.; Viegas, C.; Di Giorgio, F.; Ferreira, N.F. Robots for Forest Maintenance. Forests 2024, 15, 381. [Google Scholar] [CrossRef]
  17. Sensortec, B. BMM150 Geomagnetic Sensor. Available online: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmm150-ds001.pdf (accessed on 3 February 2024).
  18. Szenergy/Duro_gps_Driver. Szenergy. Available online: https://github.com/szenergy/duro_gps_driver (accessed on 21 February 2024).
  19. Harris, F.J. On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform. Proc. IEEE 1978, 66, 51–83. [Google Scholar] [CrossRef]
  20. Applied Optimum Signal Processing. Available online: https://www.ece.rutgers.edu/~orfanidi/aosp/ (accessed on 25 February 2024).
  21. Brown, R. Smoothing, Forecasting and Prediction of Discrete Time Series; Courier Dover Publications: Mineola, NY, USA, 2004. [Google Scholar]
  22. Roman, K. Introduction to Digital Signal Processing; McGraw-Hill Education: New York, NY, USA, 2008. [Google Scholar]
  23. Hayes, M.H. Schaum’s Outline of Theory and Problems of Digital Signal Processing; McGraw Hill: New York, NY, USA, 1999. [Google Scholar]
  24. Valiviita, S.; Ovaska, S.J.; Vainio, O. Polynomial Predictive Filtering in Control Instrumentation: A Review. IEEE Trans. Ind. Electron. 1999, 46, 876–888. [Google Scholar] [CrossRef]
  25. Vainio, O. Minimum-Phase FIR Filters for Delay-Constrained Noise Reduction. IEEE Trans. Instrum. Meas. 1999, 48, 1100–1102. [Google Scholar] [CrossRef]
  26. Hodson, T.O. Root-Mean-Square Error (RMSE) or Mean Absolute Error (MAE): When to Use Them or Not. Geosci. Model Dev. 2022, 15, 5481–5487. [Google Scholar] [CrossRef]
Figure 1. The UGV forestry robot.
Figure 1. The UGV forestry robot.
Electronics 13 02006 g001
Figure 2. Block diagram of BMM150 magnetometer sensor [17].
Figure 2. Block diagram of BMM150 magnetometer sensor [17].
Electronics 13 02006 g002
Figure 3. Duro Inertial module.
Figure 3. Duro Inertial module.
Electronics 13 02006 g003
Figure 4. Interface to collect data from magnetometer sensor.
Figure 4. Interface to collect data from magnetometer sensor.
Electronics 13 02006 g004
Figure 5. Moving average filter frequency responses: (a) filters with N = 11; (b) filters with N = 21.
Figure 5. Moving average filter frequency responses: (a) filters with N = 11; (b) filters with N = 21.
Electronics 13 02006 g005
Figure 6. Noise-reduction factor value as a function of the filter length.
Figure 6. Noise-reduction factor value as a function of the filter length.
Electronics 13 02006 g006
Figure 7. Group delay value as a function of the filter length.
Figure 7. Group delay value as a function of the filter length.
Electronics 13 02006 g007
Figure 8. Sinusoidal response of moving average filters: (a) group delay for filters when N = 11; (b) group delay for filters when N = 21.
Figure 8. Sinusoidal response of moving average filters: (a) group delay for filters when N = 11; (b) group delay for filters when N = 21.
Electronics 13 02006 g008
Figure 9. Moving average filter frequency responses for an equal group delay: (a) SMA (N = 11), LDMA (N = 16), RCMA (N = 18), EMA (β = 5/6); (b) SMA (N = 21), LDMA (N = 31), RCMA (N = 35), EMA (β = 10/11).
Figure 9. Moving average filter frequency responses for an equal group delay: (a) SMA (N = 11), LDMA (N = 16), RCMA (N = 18), EMA (β = 5/6); (b) SMA (N = 21), LDMA (N = 31), RCMA (N = 35), EMA (β = 10/11).
Electronics 13 02006 g009
Figure 10. Transient step response of moving average filters: (a) filters with N = 11; (b) filters with lengths that correspond to an equal group delay.
Figure 10. Transient step response of moving average filters: (a) filters with N = 11; (b) filters with lengths that correspond to an equal group delay.
Electronics 13 02006 g010
Figure 11. Duro Inertial sensor on a platform, used for data collection.
Figure 11. Duro Inertial sensor on a platform, used for data collection.
Electronics 13 02006 g011
Figure 12. Unfiltered magnetometer signals acquired in the X, Y, and Z axes.
Figure 12. Unfiltered magnetometer signals acquired in the X, Y, and Z axes.
Electronics 13 02006 g012
Figure 13. Magnetometer X-axis raw and filtered signals: (a) SMA filters with N equal to 11 and 21; (b) LDMA filters with N equal to 16 and 31.
Figure 13. Magnetometer X-axis raw and filtered signals: (a) SMA filters with N equal to 11 and 21; (b) LDMA filters with N equal to 16 and 31.
Electronics 13 02006 g013
Figure 14. Heading signals: raw data and filtered data using an SMA filter.
Figure 14. Heading signals: raw data and filtered data using an SMA filter.
Electronics 13 02006 g014
Table 1. BMM150 sensor characteristics [17].
Table 1. BMM150 sensor characteristics [17].
ParametersValues
Measuring Range±1300 μT (X and Y axes), ±2500 μT (Z-axis)
Resolution0.3 μT (13 bits)
Zero Offset±40 μT/±2 μT (software optimized)
Non-linearity1% FS
Output Data Rate10 Hz (default)
2, 6, 8, 15, 20, 25, and 30 Hz
Table 2. Noise-reduction factor expressions of the considered moving average filters.
Table 2. Noise-reduction factor expressions of the considered moving average filters.
Performance Metrics
Expressions
Moving Average Filters
SMALDMARCMAEMA
Noise-Reduction Factor 1 N 4 N   +   2 3 N N   +   1 3 N   +   4 2 N   +   1 2 1 N   o r   1     β 1   +   β
Table 3. Group delay expressions of the considered filters.
Table 3. Group delay expressions of the considered filters.
Performance Metrics
Expressions
Moving Average Filters
SMALDMARCMAEMA
Group Delay N     1 2 N     1 3 ~ 8 9 · N     1 3 N     1 2
Table 4. Performance metrics for equal length moving average filters.
Table 4. Performance metrics for equal length moving average filters.
Performance IndicatorsMoving Average Filters
Filter LengthMetricsSMALDMARCMAEMA
11Noise-Reduction Factor0.09091
−10.414 dB
0.11616
−9.349 dB
0.12847
−8.912 dB
0.09091
−10.414 dB
Group Delay5.00 samples
200.00 ms
3.333 samples
133.33 ms
2.984 samples
119.38 ms
5.00 samples
200.00 ms
21Noise-Reduction Factor0.04762
−13.222 dB
0.06205
−12.073 dB
0.06921
−11.598 dB
0.04762
−13.222 dB
Group Delay10.00 samples
400.00 ms
6.667 samples
266.67 ms
5.953 samples
238.12 ms
10.00 samples
400.00 ms
Table 5. Moving average filters performance metrics for target group delay values.
Table 5. Moving average filters performance metrics for target group delay values.
Performance MetricsMoving Average Filters
SMALDMARCMAEMA
Filter Length N11161718(β = 5/6)
Noise-Reduction Factor0.090910.080880.084880.080330.09091
NRF (dB)−10.414−10.921−10.712−10.951−10.414
Group Delay (ms)200.00200.00190.60202.48200.00
Filter Length N21313435(β = 10/11)
Noise-Reduction Factor0.047620.042340.043270.042050.04762
NRF (dB)−13.222−13.733−13.639−13.762−13.222
Group Delay (ms)400.00400.00392.66404.55400.00
Table 6. Descriptive statistics of the BMM 150 magnetometer data before and after filtering.
Table 6. Descriptive statistics of the BMM 150 magnetometer data before and after filtering.
Filtering
Methods
X-Axis OutputY-Axis OutputZ-Axis Output
Mean (μT) X ¯ SD (μT)
σ X
Mean (μT) Y ¯ SD (μT)
σ Y
Mean (μT) Z ¯ SD (μT)
σ Z
Raw data23.6231.669−1.2910.74834.8921.033
SMA (N = 11)23.6320.905−1.2850.37234.8980.534
LDMA (N = 16)23.6350.866−1.2900.35134.8960.514
RCMA (N = 18)23.6370.868−1.2910.35034.8960.516
EMA (β = 5/6)23.6060.914−1.2850.36834.8610.587
SMA (N = 21)23.6390.705−1.2910.29334.8950.437
LDMA (N = 31)23.6460.671−1.2950.27934.8900.418
RCMA (N = 35)23.6500.672−1.2970.27934.8860.416
EMA (β = 10/11)23.5910.773−1.2900.28934.8270.528
Table 7. Comparison between several filtering methods [14] and the studied moving average filters, using the signal noise variance reduction metric.
Table 7. Comparison between several filtering methods [14] and the studied moving average filters, using the signal noise variance reduction metric.
Noise Reduction
σ f i l t e r e d 2 / σ r a w 2
Filtering Methods [14]
RM3100 Magnetometer (Table V)
Moving Average Filters
BMM 150 Magnetometer
Wavelet DenoiseEKFAdaptive FilterSMA
(N = 21)
LDMA
(N = 31)
RCMA
(N = 35)
X-axis0.54560.16890.03850.17840.16160.1621
Y-axis0.44730.13950.02100.15340.13910.1391
Z-axis0.65930.33460.06020.17890.16370.1621
Table 8. Descriptive statistics of the heading signal before and after filtering.
Table 8. Descriptive statistics of the heading signal before and after filtering.
Performance MetricsBefore
Filtering
After Filtering
SMALDMARCMAEMA
Group delay five samplesFilter length
Mean (°)
σ SD (°)
MAE (°)
σ f i l t e r e d 2 / σ r a w 2
---
−3.1056
1.8007
1.5151
---
11
−3.1075
0.8787
0.6910
0.2381
16
−3.1195
0.8303
0.6404
0.2126
18
−3.1237
0.8278
0.6392
0.2113
β = 5/6
−3.1112
0.8695
0.6779
0.2332
Group delay 10 samplesFilter length
Mean (°)
σ SD (°)
MAE (°)
σ f i l t e r e d 2 / σ r a w 2
---
−3.1056
1.8007
1.5151
---
21
−3.1243
0.7014
0.5376
0.1517
31
−3.1360
0.6693
0.5070
0.1382
35
−3.1389
0.6690
0.5021
0.1380
β = 10/11
−3.110
0.702
0.548
0.1509
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Pereira, T.; Santos, V.; Gameiro, T.; Viegas, C.; Ferreira, N. Evaluation of Different Filtering Methods Devoted to Magnetometer Data Denoising. Electronics 2024, 13, 2006. https://doi.org/10.3390/electronics13112006

AMA Style

Pereira T, Santos V, Gameiro T, Viegas C, Ferreira N. Evaluation of Different Filtering Methods Devoted to Magnetometer Data Denoising. Electronics. 2024; 13(11):2006. https://doi.org/10.3390/electronics13112006

Chicago/Turabian Style

Pereira, Tiago, Victor Santos, Tiago Gameiro, Carlos Viegas, and Nuno Ferreira. 2024. "Evaluation of Different Filtering Methods Devoted to Magnetometer Data Denoising" Electronics 13, no. 11: 2006. https://doi.org/10.3390/electronics13112006

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop