# Mechanical Fault Prognosis through Spectral Analysis of Vibration Signals
## 2 Key Algorithms Based on Spectral Analysis
### Envelope Spectrum  
The actual bearing modulation factors are very complicated, including amplitude modulation, frequency modulation and phase modulation in the mechanism, and shaft speed modulation and cage rotation frequency modulation in the source. The modulation frequency may also coincide the natural frequency, external excitation frequency, and harmonics, superimposing one another, making it difficult to differentiate. The envelope spectrum contains the modulation information of the original signal and is an important tool for bearing fault diagnosis. In this subsection, we first derive the relation between the envelope spectrum and the Fourier transform, and then give the formulae for calculating the envelope spectrum and the instantaneous frequency [23] after discretization. Given a real-valued function \(x(t)\), its Hilbert transform \(\hat{x}(t)\) is given as  
\[\hat{x}(t)=x(t)\otimes\frac{1}{\pi t}=\frac{1}{\pi}\int_{-\infty}^{+\infty}x( \tau)\frac{1}{t-\tau}\mathrm{d}\tau\, \tag{8}\]  
where \(\otimes\) denotes the convolution operation. The analytic signal of \(x(t)\) is  
\[z(t)=x(t)+j\hat{x}(t)=b(t)e^{j\varphi(t)}\, \tag{9}\]  
where \(b(t)\), \(\varphi(t)\) denote the envelope and phase of the analytic signal, respectively. It is difficult to calculate \(\hat{x}(t)\) by direct integration of Equation (8). Instead, it is convenient to use the property that its spectrum, \(Z(f)\), has only positive frequency bands, having an amplitude of twice the original one,  
\[Z(f)= \begin{cases}2X(f),&f>0\\ X(0),&f=0\\ 0,&f<0\end{cases} , \tag{10}\]  
where \(X(f)=\mathbb{F}[x(t)]=\int_{-\infty}^{+\infty}x(t)e^{-j2\pi ft}\mathrm{d}t\). Therefore, (9) can be rewritten as  
\[z(t)=\mathbb{F}^{-1}[Z(f)]. \tag{11}\]  
From (11), the envelope of \(x(t)\) is obtained,  
\[b(t)=\sqrt{x^{2}(t)+\hat{x}^{2}(t)}=\left|\mathbb{F}^{-1}[Z(f)]\right|\,. \tag{12}\]  
Correspondingly, its envelope spectrum is given as  
\[B(f)=\left|\mathbb{F}[b(t)]\right|=\left|\mathbb{F}\Big{[}\left|\mathbb{F}^{- 1}[Z(f)]\right|\Big{]}\right|\,, \tag{13}\]  
and its instantaneous frequency is derived,  
\[f(t)=\frac{1}{2\pi}\frac{\mathrm{d}}{\mathrm{d}t}\varphi(t)=\frac{1}{2\pi} \frac{\mathrm{d}}{\mathrm{d}t}\arctan\frac{\hat{x}(t)}{x(t)}=\frac{1}{2\pi b^ {2}(t)}\left[x(t)\hat{x}^{{}^{\prime}}(t)-\hat{x}(t)x^{{}^{\prime}}(t)\right]\,, \tag{14}\]where the superscript \({}^{art}\) indicates the derivative operation. Equations (10), (13), and (14) are performed in the analog domain and must be discretized for digital implementation. The whole process is described as follows. A real-valued function \(x(t)\) is sampled at a sampling rate of \(f_{s}\), denoted as \(\mathbf{x}=\{x_{0},\cdots,x_{N-1}\}\). Correspondingly, its frequency-domain sequence, \(\mathbf{X}=\{X_{0},\cdots,X_{N-1}\}\), is obtained by applying the discrete Fourier transform as  
\[X_{k}=\sum_{n=0}^{N-1}x_{n}W_{N}^{nk}\;\Rightarrow\;\mathbf{X}=\mathbb{F}[ \mathbf{x}]\;. \tag{15}\]  
Let  
\[H_{k}= \begin{cases}1,&k=0,\frac{N}{2}\\ 2,&k=1,\cdots,\frac{N}{2}-1\\ 0,&k=\frac{N}{2}+1,\cdots,N-1\end{cases}  \tag{16}\]  
for \(N\) even and  
\[H_{k}= \begin{cases}1,&k=0\\ 2,&k=1,\cdots,\frac{N-1}{2}\\ 0,&k=\frac{N+1}{2},\cdots,N-1\end{cases}  \tag{17}\]  
for \(N\) odd. The sequence of \(\{H_{0},\cdots,H_{N-1}\}\) is denoted as \(\mathbf{H}\). The spectrum sequence of the analytic signal as shown in (10), can be discretized as  
\[Z_{k}=X_{k}H_{k}\;\Rightarrow\;\mathbf{Z}=\mathbf{X}\mathbf{H}\;, \tag{18}\]  
where \(\mathbf{Z}=\{Z_{0},\cdots,Z_{N-1}\}\).