ANewMovement Recognition Technique for Flight Mode Detection

Nowadays, in the aeronautical environments, the use of mobile communication and other wireless technologies is restricted. More speci�cally, the Federal Communications Commission (FCC) and the Federal Aviation Administration (FAA) prohibit the use of cellular phones and other wireless devices on airborne aircra because of potential interference with wireless networks on the ground, and with the aircra’s navigation and communication systems. Within this context, we propose in this paper a movement recognition algorithm that will switch off a module including a GSM (Global System for Mobile Communications) device or any other mobile cellular technology as soon as it senses movement and thereby will prevent any forbidden transmissions that could occur in a moving airplane. e algorithm is based solely on measurements of a low-cost accelerometer and is easy to implement with a high degree of reliability.


Introduction
GSM localization or mobile phone tracking is a technology used to locate the position of a mobile phone. Localization uses the concept of multilateration of radio signals, where the phone must communicate wirelessly with at least three of the nearby radio base stations (RBSs). Knowing the position of the RBS's, and using a triangulation method, an approximation of the geographical location of the mobile phone can be calculated. is technology is based generally on four different techniques: network based, handset based, hybrid and subscriber identity module (SIM) based [1]. e SIM-based technique is of interest in this paper, where by using the SIM in mobile communication handsets it is possible to obtain raw radio measurements that include the serving cell ID, round trip time and signal strength. Different applications already use this service for localization, for example, resource tracking with dynamic distribution such as taxis, rental equipment, or �eet scheduling.
Within this context, Swisscom AutoID Services (SIS) in collaboration with La Poste Suisse aims to pioneer a service that will allow clients to be able to track and trace their packages in near real-time mode anywhere in the world. e service will consist of including a tracker with the package that operates on the GSM network for location and communication [2]. erefore, a key issue arises when the package is transported via airplane. Indeed, it is well known that aircra remains one of the few places where the use of mobile communication signals is prohibited [3,4]. In fact, the aircra is not a good Faraday cage and cannot prevent transmissions to reach terrestrial cellular networks. Moreover, there is a possibility of interference with some avionics instruments in the aircra. As a result, international regulation bodies have forbidden the use of mobile phones onboard an aircra and hence any module used for tracking a package should be turned off as soon as it is located inside an airplane. In order to respect these regulations, the main idea we develop in this paper is to consider the use of low cost MEMS accelerometers, such as those found in today's smartphones, to allow the tracker to detect the movement and to turn off the GSM module automatically without any human intervention. For the envisioned application, this means that once a shipment equipped with a tracker is in the moving aircra, the device will detect the aircra's movements; it will automatically switch off the GSM module until the aircra has come to a halt aer landing and the device detects a static condition, allowing it to turn on the GSM module again.
In the recent literature, several papers already proposed the use of smartphone accelerometers for movement recognition. For example in [5], the authors investigated the suitability of the built-in smartphones accelerometer to provide good accuracy for common human activity recognition. In [6], the authors introduced a new method to implement a motion recognition process using a mobile phone �tted with an accelerometer to effectively recognize different human activities with a high-level accuracy. Human movement detection using an accelerometer was also the subject for several other papers [7][8][9][10][11]. e accelerometer was also used for several types of movement detection, for example, sign language detection [12], handwritten digit recognition [13], fast fall detection [14], and wireless motion sensing [15]. In these cases, the detection is based on different techniques and the degree of algorithm complexity varies depending on the application, alongside with the quality of the accelerometer. However, none of the above papers considered the use of smartphones' accelerometers for �ight mode detection. erefore, this paper �lls a gap in the current literature by proposing a new movement recognition algorithm speci�cally tailored for �ight mode detection, that is, taking in consideration the reliability requirements that must be satis�ed for civil aviation applications. In particular, the proposed algorithm is specially conceived for detecting any movement that a package can be subject to inside an airplane, with a sufficiently high reliability to respect all the speci�cations and requirements from international airspace regulations. e analytical and statistical studies of the proposed algorithm are based on raw acceleration measurements acquired from static data and from dynamic data onboard different �ights. ese measurements are used to de�ne the parameters required by the algorithm to detect either static or dynamic condition. Furthermore, the reliability is analyzed in terms of probability of misdetection and false alarm. In addition, implementation complexity of the algorithm is evaluated in terms of response time and resources, and �nally power consumption considerations are presented.
It is important to note that the main contribution of the paper is not in devising the methods used in the algo-rithm, but instead results from the combination of these methods in one algorithm that is tailored to provide a highly reliable movement detection technique using low cost MEMS accelerometers. Moreover, the proposed algorithm is not intended to classify the source of movement (e.g., airplane, train, car, truck, etc.), as this would decrease the reliability of correctly detecting movement while in an airplane. Indeed, it is sufficient for the considered package tracking application to only get information about the position of the package when it is not moving and prohibit transmissions otherwise. Finally, the paper is not mainly involved from the theoretical point of view, but it has a clear engineering application while emphasizing the use of real acceleration measurements. For T 1: Main characteristics of LIS302DL accelerometer [16].
Noise (1 ) 2.23 mg Measurement range (g) ±2 or ±8 Output data rate (Hz) 100 or 400 Temperature range −40 ∘ C to +85 ∘ C Power consumption <1 mW more details about the �nal product where the proposed algorithm is part of, the interested reader is referred to [2].

Measurement Data Collection
In order to analyze the accelerometer behavior under different conditions a database was created including acceleration measurements from different experiments consisted of real �ights, of different duration and in different airplanes. An accelerometer is a device that measures the acceleration associated with the phenomenon of weight experienced by a test mass that resides in the frame of reference of the accelerometer device. e accelerometer chosen for conducting the analyses in this paper is the LIS302DL accelerometer, the same sensor as the one integrated inside an iPhone [16]. is accelerometer is an ST ultracompact low-power threeaxis linear accelerometer. Its main characteristics are shown in Table 1. e raw measurements were collected by putting an iPhone, which is set to �ight-mode, inside a handbag and taking it onboard different �ights. e , , and measurements from the built-in accelerometer are saved using an application on the phone with a sampling frequency of 100 Hz. e recorded measurements are stored later using a data logging soware in a database with a resolution of 16 bits. e measurements were taken before, during, and aer every �ight. In addition, with each series of �ight data, there is a metadata description containing the �ight duration time, the take-off time, landing time, as well as description about the turbulences, and other conditions occurring during the �ight and all other data necessary to detect transitions and unusual events. e metadata were collected through the observations of the person holding the accelerometer onboard the �ight. Hence, it has a couple of seconds of time accuracy, which is not critical because the proposed algorithm is independent of this information that is only used to better understand the behavior of the accelerometer. An example of a raw measurement collected is displayed in Figure 1, which shows the accelerometer three-axis output before, aer, and during a �ight from Geneva to London onboard an Airbus A31�. e �ight time is de�ned as the time from the push-back manoeuvre before takeoff until the time the plane engines are turned off aer landing, which is the time when the GSM module should not transmit any signals. It can be noted that outside the �ight time the accelerometer axes orientation is oen changing and the measurements are so noisy. is is due to the fact that the used iPhone was inside a handbag that is subject to all types of movements that occur during normal activities of a travel. Static data was also collected when the accelerometer was not moving for a long period of time and stored in the database. e �rst step in order to interpret the data collected was to identify the metadata provided with each set within the sequence of acceleration measurements. For example, for the �ight above (to be considered throughout the paper), the sudden sharp �umps during �ight time are due to strong turbulences. Also, the different parts of the takeoff manoeuvre are shown in Figure 2 where each part is identi�ed based on the metadata provided. is helped to better understand the behavior of the accelerometer under different events. For instance, it can be seen that once the "aircra push back maneuver" starts and the engines are turned on, the accelerometer outputs start to �uctuate and we can see immediately the change in the static condition of the sensor. Also the acceleration of the plane in the runway and the lioff are identi�ed easily as the amplitude of the acceleration on the 3 axes changes suddenly. is short overview on the raw acceleration measurements shows that as soon as the sensor senses a movement, the amplitude and the variance of the accelerometer outputs increase. Bearing this in mind and computing a parameter that is dependent on these two values can provide a criterion to �nd the status of the sensor. �onsequently, we chose the moving variance (MV) of the incoming measurements on the three axes as this parameter. But before analyzing the collected data with respect to this parameter, a short overview of the MV is given in the next section.

Moving Variance
A moving variance is used to analyze a set of data points by creating a series of variances of different subsets of the full data set [17]. �iven a series of numbers and a �xed subset size, the MV can be obtained by �rst taking the variance of the �rst subset. e �xed subset size is then shied forward, creating a new subset of numbers, and consequently a new variance is computed. is process is repeated over the entire data series. e plot line connecting all the (�xed) variances is the moving variance. us, an MV is not a single number, but it is a set of values, each of which is the variance of the corresponding subset of a larger set of data points. An MV may also use unequal weights for each data value in the subset to emphasize particular values in the subset. In this paper, two types of MV computations are used: (1) the normal moving variance (NMV) and (2) the exponential moving variance (EMV) also known as the exponentially weighted moving variance. e difference between the two is that the NMV calculates the variance of the �xed subsets without any weighting, in other words all the data in a speci�c subset have the same importance. As for the EMV, it applies weighting factors which decrease exponentially [17]. e weighting for each older data point decreases exponentially, never reaching zero. Alternatively, the EMV gives more weighting to the new data in the computation of the subset variance.
e formula for calculating the NMV is given by [17]: where ( ) corresponds to the average of the subset, 2 ( ) is the sum of the squares over the number of samples in the subset , and is the subset's index number. To reduce 4 International Journal of Vehicular Technology the amount of addition and multiplication and hence lower the computational load, data processing can be applied. So, instead of calculating in each subset the sum of the squares and the square of the sum for all the samples over a �xed window length, the two sums are calculated only for the �rst subset and kept in a buffer along with the samples in the subset. Moreover with the upcoming of a new sample (i.e., moving to a new subset), the sample and its square are added to the two sums computed before and the old sample and its square are subtracted and a new variance is calculated. us and 2 can also be expressed as At the next iteration, the old sample is dropped from the buffer and the new sample replaces it. is operation is repeated at every new measurement (i.e., overlapping windows), and a new moving variance is computed as shown in Figure 3.
e EMV uses the same overall concept, but it differs in two main points: (1) it does not require the storage of all the samples of a subset, but only the last result and (2) it gives more weighting to new measurements. e EMV computation can be summarized as follows: there are two variables that need to be saved in the memory, the average and the variance of the samples within a subset. With the arrival of a new sample (i.e., moving to a new subset) the old average and variance are weighted and a new average and variance are computed taking in consideration the new sample. is way the samples do not need to be saved in the memory in a subset and consequently all what is needed for memory are two variables, the previous average and the variance. e formulas to calculate the EMV are given by [17] where is the weighting factor, whose value depends on many factors as it will be seen in the following sections. In the following, both NMV and EMV of the raw acceleration measurements are computed, and performance comparison of these two methods are provided.

Static Mode.
Our analysis of the recorded data started with the analysis of the static measurements of the accelerometer. Around 35 hours static measurements were collected in order to �nd the noise behavior of the accelerometer. Figure  4 shows the power spectral density of each axis where it is clear that the -axis is the axis sensing the gravity presenting a higher amplitude component around 0 Hz. It can be seen that the behavior of the 3 axes in a static condition is very similar and can be approximated as an independent white noise with peak-to-peak amplitude around 0.01 mg, and a variance around 5 × 0 −6 g 2 . e NMV and EMV for the 3 accelerometer axes are shown in Figure 5. It can be seen that the NMV responses on the 3 axes are similar to the noise variance of the accelerometer and approximately equal to 5 × 0 −6 g 2 . As for the EMV, it can be noted that for the weighting factors of 1 and 5, the static behavior is very similar to the case of NMV and hence it is consistent with the noise level of the accelerometer. For a weighting factor of 10, we can see that the EMV has a slightly noisier response. is is due to the fact that the EMV gives more weighting to the new samples and in this case for a high weighting factor, the past information of the variance is less weighted than the new information that is added, and therefore, there is a loss in the smoothing effect on the variance computation.
Based on the results shown above, it can be seen that the output of the NMV and EMV in static mode can approximately provide the noise level of the sensor, and this value can be taken as a reference later to decide whether the accelerometer is in a static or dynamic mode.

Dynamic Mode.
As in the static case, the PSD of the acceleration measurements was �rst computed in order to check if a low quality sensor as the one used for the tests herein could detect small movements and more speci�cally the vibrations of an airplane's motor. e power spectral densities of the measurement norm of the three accelerator axes during �ights onboard different airplanes are shown in Figure 6. It is interesting to notice the existence of frequency peak components between 10 Hz and 30 Hz during all �ights' stages. ese peaks can be identi�ed as the vibration frequency of the airplane and typically they characterize the vibration frequency of the motors. Analyses of different series with different types of planes show that most of the aircra vibration frequencies and dynamic frequencies are within the band ranging from 0 Hz up to ∼30 Hz. erefore, the sampling frequency that has been used for the analysis (100 Hz) could be lowered down to 60 Hz if necessary. us, decreasing the sampling frequency in between 60 and 70 Hz seems feasible, and within this range all the vibration and dynamic frequencies are preserved.
�egarding the NMV and EMV of the dynamic �ight mode, Figure 7 shows the NMV computation for the 3 accelerometer axes of the �ight mentioned in Section 2. e existence of peak components with high amplitudes that represent sudden movements of the sensor can be noticed. A International Journal of Vehicular Technology Frequency (Hz) F 4: Power spectral density of the raw acceleration measurements in a static case.
closer look at the takeoff and landing phases during the �ight is shown in Figure 8. During the takeoff, it can be seen that as soon as the engines are on, the NMV outputs on the 3 axes increase, and also it can be noted the existence of high peaks during the plane acceleration and lioff. During the landing, it can be seen that the NMV outputs have high amplitude peak components and, as soon as the engines are off, the outputs on the 3 axes decrease momentarily. Results of the EMV are similar to those of NMV and hence are not shown here.
Overall, these graphs show that both the NMV and EMV are able to detect movement of the sensor under different conditions. As a result, it can be concluded that by using one of these two methods, the state of the sensor can be found. us, the proposed algorithm for movement detection is based on these analyses and described in the next section.

Proposed Algorithm
e proposed algorithm for the detection of static/dynamic condition of the sensor is based on the computation of the moving variance of the raw accelerometer measurements as described before. e overall architecture is illustrated in Figure 9 and was implemented in Matlab in a �rst step. e algorithm can work in real time directly on measured data coming from the accelerometer, but as the analyses conducted during this work were limited to offline data processing, the measurements were taken from the database and postprocessed. e algorithm starts by reading measurements during a speci�c window size ( ) of time and computes the moving variance (MV) of the measurements for each accelerometer axis separately: where represents the , , or axis, is the window size, stands for a normal (NMV) or exponential (EMV) moving variance computed in (1) or (3), is the subset's index number where the MV is computed, and is the acceleration measurement during the speci�ed period of time. Aerwards, two conditions are performed to set the status of the sensor. e �rst one is to check periodically every second if the MV of each axis is smaller than a prede�ned threshold, as shown by where ,th is the MV threshold on the axis. If this is not ful�lled, the condition is set to �nonstatic� and the next window measurements are read. Otherwise, the condition is EMV of the 3 accelerometer axes-weight= 5 EMV of the 3 accelerometer axes-weight= 1 EMV of the 3 accelerometer axes-weight= 10 F 5: NMV and EMV of the 3 accelerometer axes in a static condition for a window size of 1 s or samples.
set to a "temporary static condition" and another threshold related to time is being checked. is second threshold is performed in order to obtain a more secure and stable response. In fact, once a "temporary static condition" is declared, the algorithm goes backwards for a speci�c duration of time and examines if the status of the sensor within this duration was also "temporary static condition" cond time cond AND cond AND … cond th , where th represents the threshold in time or the duration of time in which the algorithm will look backward for a temporary static condition. If this is not ful�lled, a "nonstatic" condition is declared and the next window measurements are read. If the condition is ful�lled, the algorithm outputs a "static condition" and consequently at this time the module is allowed to transmit a wireless mobile communication signal if needed. th typically ranges from 1 up to several seconds. For example, if the threshold in time is set to 3 seconds and the MV condition is checked every 1 second, then in case of a "temporary static condition, " the algorithm checks the state of the previous three conditions. If all the three of them were of "temporary static condition, " then the sensor is considered to be in a static state. Otherwise, the sensor is considered to be in dynamic state.

Probability Analysis and MV reshold Determination.
Our movement recognition algorithm can be seen as a binary detection problem, that is, deciding between two hypotheses whether the sensor is in a static or a dynamic mode.  least the MV of one of the accelerometer axes is higher than the MV threshold), cond time is false and the test function equals zero, that is hypothesis H 1 is rejected and H 0 is accepted. Figure 10 shows the binary hypothesis test and its corresponding probabilities.
If the sensor is static, then the probability of detection is de�ned as the probability that cond time is true and H 1 is accepted (i.e., detecting �nal static condition), and the probability of misdetection is de�ned as the probability that cond time is false and H 0 is accepted (i.e., detecting dynamic condition). ey can be expressed as If the sensor is dynamic, then the probability of false alarm FA is de�ned as the probability that cond time is true and H 1 is accepted (i.e., detecting �nal static condition). It can be expressed as Note that our focus is on selecting a threshold that will lead to a sufficiently low FA that is compliant with the civil aviation regulations. For our particular application, the maximization of (and thus minimization of ) is not so critical, as long as static condition detection can still happen regularly to allow periodic location determination.
In the next two subsections, we seek to determine the probability density function for the NMV and EMV outputs in static and in dynamic mode, respectively, in order to apply the well-known classical detection theory (see, e.g., [18]) to theoretically determine a suitable threshold.

Probability of Misdetection ( ).
As shown in Section 4.1, the behavior of the 3 accelerometer axes while it is static is similar, with the variance on each axis approximately equal to 2 = 5 × 10 −6 g 2 . e NMV and EMV outputs in this case are also very similar. erefore, it is possible to de�ne the same MV threshold for the three axes, that is, is threshold should be chosen as a function of two parameters: the noise behavior of the accelerometer and the probability of misdetection , which is related to the distribution of the accelerometer measurements while it is static. In order to �nd the MV threshold, the sensor should be set in a static mode, and the subsequent approach can be followed: (1) measure the noise variance on each axis of the accelerometer, Once an MV threshold is computed, the correspondent FA should be derived to check if it is below the maximum value de�ned by the civil aviation regulations. If not, then is increased and a new MV threshold is computed.
In the case of the accelerometer chosen in this paper [16], the output of the NMV or EMV algorithm applied to nonoverlapping datasets of the static accelerometer raw measurements can be approximated as independent and identically distributed (i.i.d.) with a Gaussian distribution, as can be seen in Figure 11 that depicts the probability density function (pdf) and the cumulative density function (cdf) for the Y axis. e measurements for the two other axes and from other static data sets have very similar probability distribution as the one plotted here and are thus not shown.
e probability of misdetection in this case can be written as [18] = H 1 MV ≥ where , 2 MV , and are the mean, the variance, and the cdf of the MV distribution, and erf is the error function. Time Error 2 2 6 × 10 −3 166 s 2.5 2 8 × 10 −6 35 hours 3 2 2 × 10 −11 1585 years 4 2 6 × 10 −19 5 × 10 10 years Table 2 shows the probability of misdetection for different MV thresholds, where Time Error corresponds to the period of time for the algorithm to missdetect a dynamic condition if the MV is checked every 1 , that is Time Error is equal to 1/ . It can be seen that for a threshold of 2.5 2 or above, is already very small, yielding sufficiently large values for Time Error (considering our application). We now look at the threshold requirements to yield a sufficiently small probability of false alarm when we are in dynamic mode, starting with the above thresholds as well as an additional one of 5 2 .

Probability of False Alarm ( FA ).
To compute FA , the temporary probability of false alarm (i.e., to detect a temporary static condition) FA should �rst be derived. FA is de�ned as the probability that at a speci�c time the computed MV outputs of the three accelerometer axes during a dynamic condition are lower than . As the noise on the 3 axes is uncorrelated (i.e., consecutive MV output measurements and measurements from different axes are assumed independent since we assume that they are obtained from nonoverlapping datasets of the static accelerometer raw measurements), then FA and FA can be expressed as where FA is the probability that the computed MV on the " " axis is lower than during a dynamic condition. In order to compute these probabilities, the distribution of the NMV and EMV outputs in dynamic conditions should be found. However, by analyzing all the collected measurements, we could neither determine a theoretical nor an empirical model for the dynamic mode (such a model would need to depend on many parameters such as the type of aircra, the weather, the packaging of the sensor, etc.). erefore, we could not provide an analytical expression for the MV threshold as a function of the desired probability of false alarm. us, we decided to proceed empirically as follows: (i) for each data set, only the part of the series where the sensor is subject to a dynamic movement is considered and used to compute the EMV and NMV; (ii) then the corresponding pdf and cdf of the EMV and NMV outputs are computed; (iii) �nally, the probability that the NMV or EMV outputs of each axis are lower than the threshold is computed.
International Journal of Vehicular Technology  Following this approach, FA was empirically computed for different MV thresholds and thresholds in time.

reshold in Time.
As it was described above, the threshold in time th stands as a second condition aer testing the MV on the three axes. In fact, the threshold in time ensures that the sensor was static for the period of time that is speci�ed, and once this period is exceeded, a �nal static condition is declared that can be used as an indication for the allowance of transmission of mobile communication signals. e main reason behind this second condition is to decrease FA in order to meet the speci�c requirements for the civil aviation regulations, which is the most critical point especially during �ight time. �imilar to the MV threshold, we analyzed empirically different threshold in times on different measurements from different �ights, in order to �nd a minimum threshold in time that ensures a reliable performance of the algorithm under different conditions for the chosen accelerometer.

Impact of Window Size ( ). e window size ( )
is de�ned as the duration of time where the algorithm is computing the MV and the period at which cond is checked. If the accelerometer measurement rate is 100 Hz and is equal to 1 s, it means that the MV over 100 samples is computed and compared to the MV threshold every 1 s. When decreasing the window size, the MV bandwidth is increased and the noise also increases. Consequently, the threshold should be increased. Table 3 shows the MV average for different window sizes considering static measurements. For 1, 2, or 3 s window size, the moving variance is almost the same� meaning that no signi�cant additional information will be gained when increasing the window size more than 1 s for static data. For 0.5 s the response starts to be slightly noisier and in this case the threshold should be slightly increased.
Overall, a small change in window size does not have a great Another aspect that should be taken in consideration is the effect of different window sizes on the MV during dynamic conditions. Figure 12 shows the acceleration measurement on one axis and its corresponding NMV computation. In the graphs on the le, it can be seen that when the window size is increased, the moving variance becomes less sensitive to dynamic change. Also, a smaller window size results in a noisier response and in this case it would be harder to detect a static condition. However, one exception is noticed regarding this point. In fact, it can be seen from the graphs on the right of Figure 12 that there is an opposite behavior when increasing the window size. Normally, for dynamic movements resulting in an acceleration measurement having sudden jumps with a very short duration (a), the NMV output for a 1 s window size (c) is higher than for a 3 s window size. is is expected, because for a window size of 1 s the variance is computed using less information and any short duration movement within this 1 s can have more effect than in the case of a 3 s window size where more information are taken in consideration. In a different case, when a movement occurs resulting in an acceleration having a jump that lasts more than 3 s (b), it can be seen that a window size of 3 s results in a higher variance (d). In general, it has been noticed that this type of movement rarely occurs and even in this case a 1 s window size can still detect it.
Overall, it is observed that varying the window size has a limited impact on the MV threshold and a general value for different window sizes can be used. Regarding sensitivity to    dynamic movement, it is shown that increasing the window size results in a variance that is less sensitive to dynamic detection and decreasing it results in a variance less sensitive to static detection. As a tradeoff between these two results, we have found that a window size between 1 and 2 s works well.

Simulation Results
For testing and optimization, the algorithm is implemented in Matlab where simulation results are obtained using measurements from all the �ights datasets. Herea�er, only results from two selected �ights are shown for illustration and comparison purposes.
(i) Flight 1, which is the �ight from �eneva to �ondon already described in Section 2, is chosen as a representative of a typical �ight.
(ii) Flight 2, from Helsinki to Zurich onboard a Bae Avro RJ85, is chosen because it was the most challenging �ight for detecting dynamic conditions during �ight time. Figures 13 and 14 show the algorithm detection output applied on measurements from both �ights using �MV International Journal of Vehicular Technology   method for different MV thresholds and a 5 s threshold in time. e magenta peaks in the bottom of the �gures represent the "temporary static condition" and the black peaks represent the �nal "static condition. " �hat can be observed is that the second condition (time duration of static period upon which it is decided if the condition is static or dynamic� �lters the �rst condition and as expected improves the performance of the algorithm. For �ight 1, it can be noted that the algorithm detects the movement of the sensor with high precision, and during all the �ight time it always outputs a dynamic condition up to an MV threshold of 4 2 . For an MV threshold of 5 2 , the algorithm outputs a false temporary static condition before landing. For �ight 2, the algorithm starts to detect false temporary static condition during �ight time for a MV threshold of 4 2 or higher, and false �nal static condition for a MV threshold of 5 2 . ese two graphs show that the maximum MV threshold needed for detecting a temporary static condition during �ight time is around 3 2 and as soon as the MV threshold reaches 4 2 the false temporary static conditions start to appear. At this MV threshold level or higher, the importance of the threshold in time to detect or not a �nal static condition becomes crucial. For �ight 1, it can be seen that even with increasing the MV threshold up to 5 2 , no �nal static condition is detected� however, for �ight 2, at 5 2 the algorithm starts to detect false �nal static conditions for a 5 s threshold in time. e signi�cance of th is better shown in Figure 15 that displays the algorithm detection output for �ight 2 for different thresholds in time and a 4 2 MV threshold. It can be noted that for a th smaller than 4 s, the algorithm detects falsely �nal static conditions during �ight time. And for 4 s and higher, no �nal static condition is declared and hence no transmission is allowed. ese results were con�rmed by analy�ing a huge number of �ight hours where similar results were obtained and the MV threshold of 4 2 was found to be the maximum threshold allowed for a reliable performance of the algorithm with a corresponding threshold in time of 4 s.
A deeper look of the algorithm behavior using these two thresholds is shown in Figure 16  the algorithm outputs a static condition where it can be seen as the black peak in the le graph.
e output of the algorithm using EMV method is similar when using NMV for small weighting; however, when increasing the weighting factor the EMV starts to be more sensitive to static condition detection. In fact when increasing the weight, and consequently increasing the importance of new measurements, the response of the algorithm starts to be more �uctuating. is can be explained by looking at Figure 17, where it is shown the NMV and EMV outputs for a measurement resulting from a dynamic movement. It can be seen that for EMV, with increasing the weighting, the amplitude variation increases; this is because the new sample has more weight, and if it represents a sample coming from a dynamic movement it will increase the output variations. As for the NMV where there is no weighting, the variance is more stable as it results from an average of data having similar weight. erefore, the effect of increasing the weight too much in the EMV method has a disadvantage. For example, if the �ight is very calm, then the MV output could potentially be close to the MV threshold, and if the weight is increased, then the EMV output will be noisier and there is a possibility due to the variation that it crosses the threshold and thus the algorithm outputs a static detection during the �ight. is type of scenario should be avoided, and this is why it is not recommended to increase the weight above 10.
Regarding the probability of false alarm, and following the approach in Section 5.1.2, Tables 4 and 5 show the temporary probability of false alarm and FA during �ight time for �ights 1 and 2. It can be seen that the performance of the algorithm varies from one �ight to another, and in both cases FA is considerably low. Also the table shows that if a lower FA is required, it is sufficient to either decrease the MV threshold or increase the threshold in time. Probability analyses from other �ights were similar to the assessment discussed in this paper and the algorithm showed a high �delity in detecting the state of the accelerometer.
To conclude, this section shows that the proposed algorithm has a very precise detection of static/dynamic conditions of the sensor using EMV or NMV for a MV threshold less than or equal to 4 2 . It has been also shown that the detection performance is very good especially during �ight time where FA is very low. For EMV it is not recommended to increase the weighting more than 10, as the detection output starts to be biased by the weighting factor on the new measurement and can lead to false detection. 7. Implementation Analysis e implementation of the algorithm is assessed using three criteria: the response time, resources, and practical considerations.

Response
Time. An important point to study is the response time of the algorithm, which we de�ne as the time required for the algorithm to output a static condition at turnon assuming that the sensor is static. Indeed, minimizing this response time will also extend the battery life. For the NMV algorithm and assuming a window size of 1 s, it will �rst ta�e 1 s for the data window to be full of measurements before the algorithm can output the �rst temporary condition. Assuming a threshold in time of 4 s, the �nal static condition will be generated a�er 4 s.
For the EMV algorithm, the behavior is different and depends on the initialization state of the accelerometer before startup. For example, Figure 18 shows the EMV outputs for different weightings compared to the NMV output (i.e., no weighting) for one axis of an accelerometer in static mode when the algorithm is initialized with an acceleration variance of 10 2 (this value is chosen to guarantee that the algorithm will not provide a temporary static condition at startup). e cyan dotted line represents a MV threshold of 4 2 . T 5: FA during �ight time for �ight 2 using NMV method. It can be noted that with increasing the weighting, the response time decreases as expected and consequently the output of the EMV algorithm reaches faster the MV threshold than the NMV. It is also important to note that increasing the variance of the initial dynamic condition will increase the response time. erefore this factor should be chosen carefully to guarantee a shorter response time while minimizing the probability of false alarm.

Implementation
Resources. e NMV and EMV algorithms have shown similar results in terms of performance. In this section, we explore the hardware implementation of these two algorithms in order to select the most appropriate one.
7.2.1. NMV Implementation. e basic element of the implementation of the NMV method is a moving averager (MA) shown in Figure 19 and its -domain transfer function is is element is then used to compute the NMV of a sequence as de�ned by (1) and depicted in Figure 20.

EMV Implementation.
e same procedure is used for the EMV method. e basic element of the implementation is an exponential averager (EA) which is de�ned by (4) and depicted in Figure 21. is element is then used to compute the EMV of a sequence as de�ned by (5) and depicted in Figure 22.

Optimization and Comparison.
It can be seen that the implementation of these two algorithms requires only four different operations: (1) delay; (2) addition/subtraction; (3) multiplication by a constant; (4) squaring. When an adder has one input which is the delayed version of its output, as it is the case in the MA and EA, this is equivalent to an integrator. Table 6 summarizes the resources required by these operations in terms of logic cell available in CPLDs and FPGAs, when the input signal of the operation has a resolution of bits. e implementation of the multiplication by a constant is highly dependent on the value of the constant. If the constant is a power of two, it corresponds to a simple shi and does not require resource at all. If this rule is too strict, it is also possible to implement the multiplication using two shis and a subtraction when the constant is in the form 2 -2 [17]. Table 7 summarizes the total resources required by the algorithm, when the resolution of the input signal is bits, the number of samples in a MA or EA is , and considering that the multiplications are all implemented by shis. It can be seen that the EMV implementation requires less resources than the NMV. is is due to two points: (1) it does not need to store samples; (2) it requires only one squaring against two for the NMV implementation. For , Table  8 shows a comparison for implementation of both methods in terms of logical elements, where a block includes all the operations needed to process measurements from one axis of the accelerometer. package from its starting point to its destination. erefore, the proposed algorithm does not need to work all the time. Instead, a timer can periodically wake up the tracking module algorithm for limited time duration. If during this time a �nal static condition is detected, then the module can make a transmission to enable its localization. Otherwise, the module goes back to sleep until the next timer occurs. By doing so, the power consumption of the algorithm can be reduced drastically. In addition, even when the system is awake, it has been shown that the algorithm only requires few logical elements and that the sampling frequency needed is very low (<70 Hz), which will result in a power consumption of less than 4 mW considering, for example, an Altera MAX V CPLD [19]. Also, taking into consideration the fact that MEMS-based accelerometers are not power hungry (e.g., <1 mW for the LIS302DL accelerometer [16]), we can infer that the total power consumption of the detection module will be less than 5 mW while active.
Regarding the power consumption of the transmission module, it will consist of the power to establish the connection, and the power to maintain the transmission. As it was already shown in [20], module communication radios have low connection maintenance energy, but high energy per bit transmission cost and low bandwidth. erefore, the − EA( / ) EA( / ) ( ) ( ) 2 ( ) F 22: Implementation of an exponential averaging network [18]. further compared to a threshold in time to declare a �nal static condition. e main characteristics of the algorithm are summarized as follows. Generality, as it is independent of the accelerometer quality or type, where only the noise behavior of the sensor is needed to de�ne all the algorithm parameters. Reliability, as it provides a very low probability of false alarm to meet the requirements needed by the airspace regulations. Flexibility, where it is sufficient to vary the MV threshold and the threshold in time to adapt it for different application. Simplicity, as it requires low resources, and thus, it can be implemented on a small FPGA or a CPLD. Consequently, the detection module including the accelerometer and the hardware where the algorithm is implemented will have very low power consumption, typically less than 5 mW.