## 2 Principles of Improved Wavelet Energy Entropy and LSTM Neural Network  
### Wavelet Transform  
Due to the strong random fluctuation of new energy, a high proportion of new energy connected to the grid will lead to a significant increase in power generation fluctuation and a change in the harmonic components of voltage and current in the grid. Therefore, in order to study the external characteristics of current, power, and frequency of new energy sources (such as distributed photovoltaic and wind power after grid connection), extract their typical features, and construct filtering algorithms and frequency analysis algorithms suitable for end-user load current analysis, suitable feature extraction algorithms should be selected. Wavelet transform--which is a local transformation of time and frequency and can simultaneously analyze the data jointly in the time domain and frequency at multiple scales with multi-scale refinement analysis--is based on various specific functions to expand the data signal into a series of levels. Therefore, the signal can be analyzed effectively at different decomposition levels and with different wavelet basis functions. In this paper, the wavelet transform approach is chosen as a major tool for spectral analysis. The method of signal processing requires a basis function as a tool for the transform. The basis function used in wavelet transform, on the other hand, is different from the stable and periodic sinusoidal function in Fourier transform, except for a small segment of the signal, thus reflecting the local characteristics. Suppose \(\psi(t)\in L^{2}(R)\), if it satisfies [17]. \[\int\psi(t)\mathrm{d}t=0 \tag{1}\]  
Then, \(\psi(t)\) can be used as the base wavelet (or mother wavelet). If the basis wavelet is scaled and translated, a series of wavelet families can be obtained as \(\psi_{a,\tau}(t)\):  
\[\psi_{a,\tau}(t)=|a|^{-1/2}\psi\left(\frac{t-\tau}{a}\right) \tag{2}\]  
where \(a\) and \(\tau\) are the scale parameter and the translation parameter, respectively, and \(t\) is the time. The scale parameter determines the degree of scaling of the fundamental wavelet. However, in general practical calculations, the data are stored in discrete form; therefore, the discrete wavelet transform is generally chosen to change the parameters using the dichotomy method. Take \(a=2^{j}\), \(\tau=2^{j}k\), the discrete wavelet family is given by  
\[\psi_{j,k}(t)=2^{-j/2}\psi\left(2^{-j}t-k\right) \tag{3}\]  
For a certain signal \(f(t)\in L^{2}(R)\) the discrete wavelet transform is calculated as follows:  
\[W_{f}\left(2^{j},2^{j}k\right)=2^{-j/2}\int_{R}f(t)\psi^{*}\left(2^{-j}t-k \right)dt=f(t),\psi_{j,k}(t)=d_{j}(k) \tag{4}\]  
where \(d_{j}(k)\) denotes the wavelet coefficients, and its expression is given by:  
\[d_{j}(k)=\int_{R}f(t)\psi^{*}{}_{jk}(t)dt \tag{5}\]  
Multi-resolution analysis, also known as multi-scale analysis, is able to decompose the signal well in both the low- and high-frequency bands, showing the details and the full picture of the signal. Its reconstruction equation is:  
\[f(t)=\frac{1}{C_{\varphi}}\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty} \frac{1}{a^{2}}W_{f}(a,\tau)\psi\left(\frac{t-\tau}{a}\right)dad\tau \tag{6}\]  
Using the decomposition and reconstruction of the signal, multi-resolution decomposition can be achieved. Let \(W_{j}\) denote the high-frequency part of the multi-resolution decomposition and \(V_{j}\) denote the low-frequency part. Then, \(W_{j}\) is \(V_{j}\) in \(V_{j+1}\), the orthogonal complement in  
\[V_{j}\oplus W_{j}=V_{j+1},j\in Z \tag{7}\]Therefore, for an arbitrary signal, the multi-resolution decomposition can be divided into a high-frequency detail part and a low-frequency approximation part, which is implemented as follows:  
Suppose that the frequency distribution of a signal \(f(t)\) has a frequency distribution in (0, \(\pi\)) above; then, this frequency band is defined as the space \(V_{0}\).