## 2 Methodology
### Generative Adversarial Network  
A Generative adversarial network consists of two models: the generative model G(\(z\)) and the discriminative model D(\(x\)). The goal of the generative model is to produce synthetic samples such that the discriminate model could not distinguish them from the real samples. At the same time, the objective of the discriminative model is to accept real samples and reject synthetic ones with the highest possible accuracy. In equilibrium, the discriminative model cannot identify the source of the  
Figure 1: The decomposition levels of a wavelet packet transform of the signal \(u(t)\). data, meaning that synthetic data are indistinguishable from real data. Figure 2 shows a block diagram of a GAN as used in this work  
For learning, a GAN implements an adversarial competition between the generator \(\mathrm{G}(z)\) and the discriminator \(\mathrm{D}(x)\). Initially, a real sample \(u(t)\) is processed by the above described WPT feature extraction technique, and (12) is set as the real input of \(\mathrm{D}(x)\). A random signal \(z(n)\) with a given distribution is input into the generator which in turn produces a synthetic feature vector \(\mathrm{G}(z)\). The discriminator is trained with a target value of 1 when a real sample is presented at its input, and with 0 for a synthetic example. This process repeats until a Nash equilibrium is reached. In general terms, the GAN optimization problem can be given by: In general terms, the GAN optimization problem can be given by:  
\[\mathcal{G}^{*}=\arg\min\max V(\mathrm{G},\mathrm{D}) \tag{13}\]  
where \(\max\) stands for the maximization of the probability of the generator \(\mathrm{G}\) while \(\min\) refers to the minimization of the probability in the discriminator \(\mathrm{D}\); \(V(\mathrm{G},\mathrm{D})\) is the GAN objective function that can be given by:  
\[V(\mathrm{G},\mathrm{D})=\underset{x\sim P_{data}}{\mathbb{E}}[\log(\mathrm{D }(x))]+\underset{x\sim P_{\mathrm{G}}}{\mathbb{E}}[\log(1-\mathrm{D}(\mathrm{G }(z)))] \tag{14}\]  
where \(E_{x\sim P_{data}}\) represents the expectation of real probability distribution, whereas \(E_{x\sim P_{G}}\) represents the expectation of the random distribution. Since \(x\) and \(z\) are real-value random variables on the probability space, the expect values of \(x\) and \(z\) can defined as the integral of \(x\) and \(z\), respectively. Therefore, (14) can be re-written as  
\[V(\mathrm{G},\mathrm{D})=\int_{x}[P_{data}(x)\log\mathrm{D}(x)+P_{\mathrm{G}}( x)\log(1-\mathrm{D}(x))]dx \tag{15}\]  
where \(\int_{x}P_{data}(x)dx\) stands for the expectation of \(E_{x\sim P_{data}}(. )\) and \(\int_{x}P_{G}(x)dx\) denote the expectation of \(E_{x\sim P_{G}}(.)\). Let \(f(x)=P_{data}(x)\log\mathrm{D}(x)+P_{G}(x)log(1-\mathrm{D}(x))\); then, the derivative of \(f(x)\) is given by  
\[\dot{f}(x)=\frac{P_{data}(x)}{\log\mathrm{D}(x)}+\frac{P_{\mathrm{G}}(x)}{ \log(1-\mathrm{D}(x))} \tag{16}\]  
where \(P_{data}(x)\) is the distribution of the real data while \(P_{\mathrm{G}}(x)\) is the distribution of generated data. When \(\dot{f}\to 0\), \(\mathrm{D}\) tends to the maximum value, which is given by  
\[\mathrm{D}^{*}=\frac{P_{data}(x)}{P_{data}(x)+P_{\mathrm{G}}(x)} \tag{17}\]  
When \(P_{G}(x)=0\), \(\mathrm{D}^{*}\) becomes 1 meaning that the discriminator can effectively recognize synthetic data, when \(P_{G}(x)\) is close to \(P_{data}(x)\), \(\mathrm{D}^{*}\) tends to the optimal value of 0.5, which means that synthetic data are indistinguishable from real data. Plugging in (17) into (15), one has:  
Figure 2: A block diagram of a GAN as used in this work.