# Demodulation of EM Telemetry Data Using Fuzzy Wavelet Neural Network with Logistic Response
## 3 Methodology
### Defining the Input  
In the input layer, the individual neurons are used for each input of an ANN. These inputs could be collected data or real-world inputs from physical sensors. However, in this study, pre-processing of the inputs is done to speed up the learning process and increase the accuracy of predictions of the network. Considering a binary phase modulation scheme, which is mostly chosen for electromagnetic telemetry (Figure 3), the phase-shift-characterizing section within a time series data is at or less than the quarter of a wavelength into and out of each signal being transmitted, meaning the optimal data requirement for an artificial intelligent demodulator system is only a fraction of the recorded signal, thereby reducing the training data and increasing the learning speed. However, digital demodulation requires bit-period synchronization; the receiver must be able to identify the boundaries between adjacent symbols. Therefore, extra sub-processing to obtain the correct start times for each representative wave of each symbol being transmitted is required. To address this problem, the cross-correlation technique is applied to determine the lag between a given transmitted correlation signal and the observed signal. Given a transmitted correlation signal S(t) and a received signal _Sbl(t)_ in discrete form, the time lag is determined as:  
\[\text{TLag}=\text{T(idxS)}-\text{T(idxbl)} \tag{11}\]  
where idxbl and idxS are the time index of the maximum value of the cross-correlation of signal S(t) with _Sbl(t)_ and itself, respectively, and _Sbl(t)_ is a time fraction of the recorded signal obtained as:  
\[S_{bl}(t)=data\Big{(}1 to\Big{(}f_{s}\Big{/}f_{c}\Big{)}*2\Big{)} \tag{12}\]  
where \(f_{s}\) is the sample frequency, and \(f_{c}\) is the center frequency. For every time segment, the first data is recorded as time t0, which has an index of 1. Figure 3: Description of the effect of time synchronization on EM telemetry signals and the effectiveness of the cross-correlation technique. A highly significant difference is observed between the variant of synchronized and non-synchronized signals, which could lead to misinterpretation. Finally, the time series is corrected as follows:  
\[T_{mw} = T_{lag}\pm T_{data} \tag{13}\]  
Additionally, the data can thus be separated into segments, starting from the corrected t0. The new signal is then formatted to match the neural network input. An example of the effect of time-shifted/sync data is shown in Figure 3.  
The number of inputs of the network dictates how many sampled data are fed to the network at a time. In general, when the length of the sampled symbol (that is, a single wavelength) is equal to the number of inputs, the entire symbol is presented to the network at the same time, and the neural network will output a single decision for every slice of data presented to it. However, a combination of the reduced data from the initial data point (which is three wavelengths long) is used as an input in this study for data pre-processing. To avoid the complexity in the network learning process of simply demodulating the noisy raw data itself as well as analyzing it, the signal subtraction technique is also introduced. Here, a normalized combined signal, representative of the given phase transition symbols, is selected as the base signal \(S_{sym}(t)\) and then subtracted from normalized time-synchronized field recordings:  
\[S_{att}(t)=S_{sym}(t)-S_{dat}(t)\pm\gamma \tag{14}\]  
where \(\gamma\) is a constant, with a value less than or equal to 0.05, used to ensure that the value of \(S_{att}(t)\) does not equal zero. As shown in Figure 4, this creates a new set of eight highly distinguishable and correlate-able combined two-phase transition signals (Figure 4). This process is introduced to further reduce the training time by introducing a variant of phase change in the network system to increase detectability, which is representative of binaries of ones and zeros for the full-wave regions and the almost-zero region, respectively.