# Low-Speed Bearing Fault Diagnosis Based on Permutation and Spectral Entropy Measures
## 2 Theoretical Background
### Permutation Entropy  
Permutation entropy (PE) was first introduced by [PERSON] et al. [56] as a complexity quantification for chaotic time series containing dynamical and observational noise. The use of a series of seven values called \(x\) will be helpful for understanding the calculation:  
\[x=\{x_{t}\}_{t=1,\ldots,\mathcal{J}}=\{x_{1},x_{2},\ldots,x_{\mathcal{J}}\}= \{2,7,1,9,6,2,1\}. \tag{3}\]  
The order of PE is related to the number of neighbors (consecutive elements) that need to be compared. For order \(O_{p}=2\left(O_{p}\in\mathbb{N}\right)\), the groups are pairs of neighbors. As equal consecutive values are disregarded [56], the relative possible values are 01 (\(x_{t}<x_{t+1}\)) and 10 (\(x_{t}>x_{t+1}\)). Consequently, the pairs associated with the set \(x\) in Equation (3) are  
\[x_{\text{pairs}}=\left\{(2,7),(7,1),(1,9),(9,6),(6,2),(2,1)\right\}, \tag{4}\]where two out of six pairs are 01, while four out of six pairs are 10. PE is defined as a measure of the probabilities of the existing permutations in Equation (3). As 01 and 10 are found in Equation (4), the calculation is  
\[\mathrm{PE}(2)=-(2/6)\log_{2}(2/6)-(4/6)\log_{2}(4/6)\approx 0.91829. \tag{5}\]  
The same calculation for \(O_{p}=3\) is performed, where the number of possible cases increases according to \(O_{p}!\). The trios found in Equation (3) are  
\[x_{\mathrm{trios}}=\left\{(2,7,1),(7,1,9),(1,9,6),(9,6,2),(6,2,1)\right\}. \tag{6}\]  
A similar notation for the relative possibility values found in Equation (4) is used for the trios, where 012 represent the case where \(x_{t}<x_{t+1}<x_{t+2}\). The cases found in Equation (6) are one 021, \((1,9,6)\); one 102, \((7,1,9)\); one 201, \((2,7,1)\); and two 210, \(\{(9,6,2),(6,2,1)\}\). Therefore, the calculation of \(\mathrm{PE}(3)\) is made as follows  
\[\mathrm{PE}(3)=-3\cdot(1/5)\log_{2}(1/5)-(2/5)\log_{2}(2/5)\approx 1.92192. \tag{7}\]  
The previous example clarifies how PE calculates the information of \(O_{p}!\) number of ordinal symbols \(\pi\) (permutation) on a \(\{x_{t}\}_{t=1,\ldots,T}\) discrete time signal. As seen, the PE calculation does not depend on the values; rather, it depends on the relative value among them (greater than, or less than). The relative frequency estimated for each permutation \(\pi\) is calculated as [56]  
\[p(\pi)=\frac{\#\left\{t\mid 1\leq t\leq T-O_{p}+1,(x_{t},x_{t+1},\ldots,x_{t+O_{ p}-1})\text{ has type }\pi\right\}}{T-O_{p}+1}, \tag{8}\]  
where \(\pi\) is the evaluated permutation, \(x_{t}\) is the value of the signal, \(T\) is the length of the signal, \(O_{p}\) is the order of PE, and \(\#\{\cdot\}\) represents the cardinal of a set [57]. Finally, PE is defined, for \(O_{p}\geq 2\), as the sum of all possible \(p(\pi)\)[56]  
\[\mathrm{PE}(O_{p})=-\sum_{i=1}^{O_{p}!}p_{i}(\pi)\log_{2}p_{i}(\pi), \tag{9}\]  
where \(i\) goes from the first permutation to \(O_{p}!\) permutation. From Equation (9), the lower bound marks a regular signal containing a few permutations, and the upper bound a completely random system where all \(O_{p}!\) possible permutations can come with the same probability. The higher the values, the more chaotic the signal is.