# Demodulation of EM Telemetry Data Using Fuzzy Wavelet Neural Network with Logistic Response
## 3 Methodology
### Theory  
Suppose there are Nr fuzzy, the IF-THEN rules are given as Rj:IF x1 is _A1j_ AND x2 is _A2j_ AND xi is _Aij_...... then,  
\[y_{j}=\sum_{j=1}^{N_{\text{i}}}w_{j}\cdot\mu_{j} \tag{2}\]  
where xi is the i-th input variable of the system (i = 1:N\({}_{\text{in}}\)), \(A_{ij}\) is the fuzzy membership function, \(\mu A_{\bar{ij}}\) (xi) (\(j\) = 1:\(N_{\text{r}}\)) is a feature set of fuzzy languages, \(w_{j}\) is the weight between the fuzzy layer and the output layer, \(\mu_{j}\) is the output result of the fuzzy layer, and \(y_{j}\) is the output of the entire network. Since the Gaussian membership function can maintain the original distribution of the data, the Gaussian function is selected as the membership function in the second layer. Therefore, \(A_{ij}\), the fuzzy set, is characterized by the following Gaussian-type membership function, and \(\mu A_{\bar{ij}}\) (xi) is the grade of membership of xi in \(A_{\bar{ij}}\), denoted as  
\[\mu A_{ij}=e^{-}\bigg{(}\bigg{(}\big{(}(x_{i}-p_{ij}^{1})\bigg{/}p_{\bar{ij}}^{ 2}\bigg{)}^{2}\bigg{)}^{p_{\bar{ij}}^{1}/2} \tag{3}\]  
where \(p_{ij}^{1}\) represents the center of membership function, and \(p_{\bar{ij}}^{2}\), and \(p_{\bar{ij}}^{3}\) determines the width and shape of the Gaussian-type membership function, respectively. These are the free parameters of the membership functions, and these membership functions determine the contribution degree \(\mu_{j}\) of each sub-wavelet network with a particular resolution. Figure 2: Description of a fuzzy wavelet neural network for EM MWD response demodulation with a logistic response. For the third layer, each node in the layer represents a fuzzy rule R, and the output of each node can be expressed as:  
\[\mu_{j}(x)=\prod_{i}\mu A_{ij}(x_{i}) \tag{4}\]  
where \(\prod\) represents the logical \"and\" operation, that is, the small operation. Going into the fourth layer, wavelets are computed using the mother wavelet function. The selection of the mother wavelet depends on the application. Three mother wavelets are usually recommended: the Gaussian first-order partial derivative, the second derivative of the Gaussian (the so-called \"Mexican Hat\"), and the Morlet wavelet. The activation function can be a wavenet (orthogonal wavelets) or a wave frame (continuous wavelets) [16]. Based on previous studies [16; 23], two of the mother wavelets, the Mexican Hat and the Gaussian derivative, were initially selected, while the Mexican Hat function, which proved to be useful and to work satisfactorily in various applications, was finally adopted in this study. Therefore, the mother wavelet function is given as:  
\[\varphi(x)=\Big{(}1-x^{2}\Big{)}e^{-0.5x^{2}} \tag{5}\]  
As a mother wavelet function, this function has better fitting performance. According to the selected mother wavelet, the activation function in the neurons can be expressed as:  
\[\varphi_{j}(z_{ij})=\sum_{i=1}^{N_{m}}\Big{(}1-z_{ij}^{2}\Big{)}e^{-0.5z_{ij} ^{2}} \tag{6}\]  
where  
\[\forall z_{ij}=\Big{(}\big{(}x_{i}-t_{ij}\big{)}\bigg{/}d_{ij}\Big{)} \tag{7}\]  
Among them, \(t_{ij}\) and \(d_{ij}\) are the translation and dilation parameters of the wavelet, respectively, and the subscript \(ij\) indicates that the \(i\)th input corresponds to the \(j\)th wavelet neuron. The additional input of the fourth layer of the network is:  
\[v_{j}=\sum_{k=1}^{N_{j}}w_{j}\cdot\varphi_{jk} \tag{8}\]  
while \(wj\) is the weight of the link between the hidden layer and output layer. In the fourth layer, the input wavelet layer is multiplied by the node output of the third layer (fuzzy rule layer). The calculation formula is given as:  
\[y(k)=\sum_{j=1}^{N_{t}}\mu_{j}(x)\cdot v_{j}=\sum_{j=1}^{N_{t}}y_{j} \tag{9}\]  
Finally, the fifth layer combines the defuzzed output in profering a logical prediction of the signal characteristic using a sigmoid function  
\[Y(n)=g(w_{nk}\cdot y(k)) \tag{10}\]  
where \(g\) represents the sigmoid function.