## 3 Momentum-Based Motion Detection
### MRSS Definition  
MRSS is set as the difference between current smoothed RSS sample and early smoothed RSS sample. The smoothed RSS can eliminate fading noises. The computation process of MRSS can be divided into three steps. First, an Averaged RSS (ARSS) [33] is computed, which is the average of \(T\) samples in the \(i^{th}\) interval of time:  
\[ARSS_{i}=\frac{\sum_{j=1}^{T}RSS_{i\times T+j}}{T} \tag{4}\]  
where \(i>0\), \(T>0\).  
In the second step, an exponentially weighted moving average (EWMA) filter [33], a low pass filter, is applied to the signal analysis process to smooth the ARSS. The EWMA filter is defined as  
\[EWMA_{i}=(1-\alpha)\times EWMA_{i-1}+\alpha\times ARSS_{i} \tag{5}\]  
where \(i\geq 1\), \(0<\alpha<1\). \(EWMA_{i}\) is the current estimated EWMA value, \(EWMA_{i-1}\) is the prior estimated EWMA value, \(ARSS_{i}\) is the current measured ARSS value, and \(\alpha\) is a smooth factor which can filter the noise of ARSS and keep the EWMA stable.  
The EWMA curve becomes more stable when the EWMA uses a smaller smooth factor \((\alpha)\), which is called the Long-term EWMA (L-EWMA) and can predict the trend of an MN's motion. On the other hand, when EWMA uses a larger smooth factor \((\alpha)\), which is called the Short-term EWMA (S-EWMA), the S-EWMA curve changes quickly and can track the MN's motion swiftly. The smaller \(\alpha\) make the \(EWMA_{i-1}\) (old data) relatively more important than \(ARSS_{i}\), and the larger \(\alpha\) discounts older observations quickly.  
However, selecting a suitable \(\alpha\) for an EWMA filter is difficult. Based on Equation 5, \(EWMA_{i}\) can be easily expanded to \[EWMA_{i} = \left(1-\alpha\right)^{0}\times\left(\alpha\right)\times ARSS_{i}\] \[+ \left(1-\alpha\right)^{1}\times\left(\alpha\right)\times ARSS_{i-1}\] \[\vdots\] \[+ \left(1-\alpha\right)^{i-1}\times\left(\alpha\right)\times ARSS_{1}\] \[+ \left(1-\alpha\right)^{i}\times ARSS_{0}\]  
which can be written as follows:  
\[EWMA_{i}=\left[\sum_{x=0}^{\left(i-s\right)-1}\left(1-\alpha\right)^{x}\times \left(\alpha\right)\times ARSS_{i-x}\right]+\left(1-\alpha\right)^{\left(i-s \right)}\times EWMA_{s} \tag{6}\]  
where \(i>s\geq 0\), \(i-s>x\geq 0\).  
In Equation 6, we assume \(k=i-s\), \(k>x\geq 0\), \(\gamma=\left(1-\alpha\right)^{k}\) and \(\sigma_{x}=\left(1-\alpha\right)^{x}\times\left(\alpha\right)\). Thus, Equation 6 can be written as follows:  
\[EWMA_{i}=\left[\sum_{x=0}^{k-1}\sigma_{x}\times ARSS_{i-x}\right]+\gamma\times EWMA _{s} \tag{7}\]  
where \(i>s\geq 0\).  
Clearly, \(k\) is the sampling size (also called moving average window size) of an EWMA filter, \(\gamma\) is the impact factor of \(EWMA_{s}\) on \(EWMA_{i}\). The EWMA filter assumes that when \(\gamma\) is smaller than 0.005, the impact of \(EWMA_{s}\) on \(EWMA_{i}\) can be ignored. Thus, the moving average window size can decide a suitable \(\alpha\) in EWMA filters, which is computed by  
\[\left(1-\alpha\right)^{k}<0.005 \tag{8}\]  
where \(k>1\). According the scaling function in multi-resolution analysis [34], the sampling size for a signal analysis is scaled by two, thus we can assume \(k=2,4,8,16,32,\cdots\). Table 1 shows the suitable \(\alpha\) value on various moving average window sizes.  
Finally, MRSS is defined as the difference between \(EWMA_{i}\) and \(EWMA_{j}\) as follows:  
\[MRSS_{i}=EWMA_{i}-EWMA_{j} \tag{9}\]  
where \(i>j\geq 0\). Figure 1 shows the calculation of MRSS, where \(\Delta t\) is the time difference between \(EWMA_{i}\) and \(EWMA_{j}\).  
\begin{table}
\begin{tabular}{|c|c||c|c|} \hline k & \(\alpha\) & k & \(\alpha\) \\ \hline
2 & 0.95 & 64 & 0.08 \\ \hline
4 & 0.80 & 128 & 0.05 \\ \hline
8 & 0.50 & 256 & 0.04 \\ \hline
16 & 0.29 & 512 & 0.02 \\ \hline
32 & 0.16 & 1024 & 0.01 \\ \hline \end{tabular}
\end{table}
Table 1: Relationship between the moving average window size \(k\) and smooth factor \(\alpha\).