Nonstationary signal extraction based on bat algorithm sparse decomposition technique

For nonstationary time series i.e. natural electromagnetic field and acoustical signal, effective signal extraction always requires prior knowledge or hypothesis, and hardly do without artificial judgment. We proposed bat algorithm sparse decomposition (BASD) to realize adaptive recognition and extraction of nonstationary signal in a noisy background. We designed two general atomics for typical signals, and developed dictionary training method based on correlation detection and Hilbert transform. The sparse decomposition was turned into an optimizing problem by introducing bat algorithm with optimized fitness function. By contrast with variational modal decomposition, it was indicated that BASD can effectively extract short time target without inducing global aliasing of local feature, and no preset mode number and late screening were needed.

Fourier transform is one of the most classic signal analysis and extraction method, but it cannot accurately describe nonstationary signals 4 . In recent years, new theories and technologies continue to appear in signal extraction. For example, wavelet decomposition (WD) 5,6 , empirical mode decomposition 7 , Hilbert-Huang Transform (HHT), variational mode decomposition (VMD) algorithm 8 .
These methods need to meet certain conditions to work, for example the decomposition levels, modal number, and termination thresholds.
To achieve a more flexible, concise and adaptive signal decomposition, researchers proposed sparse decomposition. This method represents the signal with as few atoms as possible in a given redundant dictionary by matching pursuit (MP) algorithm, which is a greedy algorithm for sparse decomposition. Various new evaluation criteria and basis pursuit, orthogonal matching pursuit algorithm (OMP), and time-frequency spectrum segmentation methods 9 were generated to select a set of optimal atoms from the constructed over-complete dictionary.
Aiming at two main research hotspots including sparse decomposition algorithm and over-complete atom dictionary of signal sparse decomposition 10 , we designed two typical universal signal atoms, and proposed an adaptive feature-based atom construction method.
Redundant dictionary was obtained by extending the feature-based atoms, which can balance the completeness and redundancy of the redundant dictionary. A signal matching tracking extraction algorithm was developed based on the bat algorithm, which could effectively realize nonstationary time domain signal extraction.

Bat algorithm sparse decomposition
General atomics designed for typical signals. For sinusoidal-like and one-sided decaying oscillatory signals, g-atoms were constructed： ( ) where c was the normalization factor to ensure that the original signal had the same energy as its sparse decomposition results; d was the attenuation factor; t was the sampling time; t1 was start point of atomic appearance; t2 was the ending point; f was frequency and φ was phase. The time domain waveforms of g-atoms with different parameters were shown in Fig. 1. When the attenuation factor d=0, the g-atom degenerated to standard sine wave; when d increased, the g-atom performed sinusoidal damped oscillation. Therefore, this atom had a strong match with sinusoidal signals, and single-sided oscillatory decay signals.
For kind of triangle waves, charge-discharge waves, and bilateral decay oscillation signals, tr atoms were constructed: where d1 and d2 were the bilateral damping factors; t0 was the bilateral boundary of the atomic; [t1 t2] was the atomic time range; and σ was the bilateral scaling factor.
The time domain waveforms of tr-atoms with different parameters were shown in Fig. 2. When the bilateral scaling factor σ=0, the tratom degenerated to single-sided oscillating atom (reverse-order g-atom); when 0<σ<1 and the atomic frequency was low enough, the tr-atom behaved as a charge-discharge triangle wave; when σ=1, the tr-atom with low-frequency behaved as a triangle-like wave, and behaved as bilateral oscillating decay signal with high-frequency. The above analysis showed that the constructed g-atoms and tr-atoms were very flexible and could matched almost typical testing signals by parameter adjustment. Dictionary training algorithm. A dictionary training algorithm based on feature parameters was studied to determine the key parameters of feature base-atom and to balance the completeness and redundancy for redundant dictionary library construction.
When constructing the redundancy dictionary, we firstly used the short-time Fourier transform to initially determine the frequency fs and Accurate time and frequency domain parameters were obtained by Hilbert transform of Ei.
Where: h(t) was the Hitch transform factor.

3
Complex analytic signal as follows was constructed: Where, A(t) was the amplitude function: The instantaneous frequency of Ei was given by (7): The base-atom was obtained with the time information gained by the correlation detection and localization algorithm and the timefrequency parameter information obtained by Hilbert transform as the reference. And the redundant dictionary of this feature atom was constructed by performing equal-step discrete expansion of the time-frequency parameters on both sides of the reference values.

Signal extraction based on bat algorithm sparse decomposition
Signal sparse decomposition represented a signal by specific combinations of some atoms in a dictionary. For a given dictionary, the optimal combination can be accurately determined when all possible combinations were calculated. However, exhausting all combinations in a dictionary is a non-deterministic polynomial problem that is almost impossible to achieve for large dictionary bases.
So, the requirement was changed to finding a suboptimal combination from the dictionary with the lowest possible number of atoms and the smallest possible extraction error. This will reduce the computational complexity significantly, and the MP algorithm is one of the algorithms that can achieve this requirement.
Assume that the represented signal is x with length of N. Let ℝ denote the Hilbert space in which a dictionary matrix D composed of a set of vectors {g1, g2,…,gn}. Each vector is an atom with the same length N and these vectors have been treated as normalized as With ξ1=x, the MP algorithm selects one atom at a time from the dictionary matrix D that best matches x, satisfying (9)， ( ) Where ibest is the index of the best matching atom in D.
The signal x is then decomposed into two parts, a sparse approximation x and an approximation residual ξ2: Continues to select the atoms that best matches ξ2, iterating repeatedly and eventually the signal x can be approximated as a linear sum of these atoms: For MP algorithm, the non-orthogonality between the vertical projection of the signal (or residuals) on the selected atoms and the residuals will lead to suboptimal iterative results instead of the best optimal, and convergence requires many iterations. The OMP algorithm is the orthogonalization of all selected atoms at each step of the decomposition, which makes the convergence faster with the same accuracy requirement. The convergence process of MP and OMP were described by a dictionary D with length of three, as shown in Fig. 3. However, although the OMP algorithm reduced iterations to some extent, it had to calculate the current residual and the inner product of all atoms within the current dictionary during each iteration, resulting in unsatisfied effectiveness. Therefore, this paper introduced the bat algorithm (BA) to optimize the matching tracking algorithm.
where: λi was the random number satisfying the Gaussian observation matrix. Λn was obtained by selecting q atoms gi from the candidate dictionary D according to the bat group position Pi.
The best matching atom gnbest in Λn was determined by the fitness function. In this paper, for noise-containing signal extraction, the fitness function of the traditional sparse decomposition was improved to take the ℓ-2 norm of the residual as the fitness function, and the smaller the fitness indicated that the residual sequence contains smaller effective signal components and higher signal-to-noise separation, so the optimal individual bat position Pb was determined and saved according to (13).
where r1 was a random number, satisfying r1∈[0,1]; fi was the search pulse frequency of the i-th bat; vi j denoted the velocity of the i-th bat at j-th iteration, Pi j denoted the position of the i-th bat at j-th iteration; and Pb was the current global optimal solution.
where，λ∈(0,1)，γ>0, when n →, The random perturbation of the current optimal solution in step 4 can effectively avoid the iterative result from falling into a local optimal solution, which helped to find the global optimal solution faster compared to the particle swarm algorithm (PSO).
The Ackley function was used to test the BA and PSO. The expression of the Ackley function was as follows: In this study, n=2, c1=20, e=2.71289. the Ackley function was taken as the fitness function and the global minimum of this function was searched using BA and PSO. The search paths and results were shown in Fig. 4.  The detailed values were shown in Table 1. The comparison of the tracking trajectory and the optimization results showed that BA had higher convergence speed and computational accuracy than PSO because the gradient of the optimization deviation was larger and the optimization results were closer to the true value.

Experiments
We constructed a nonstationary signal x to test the methods described above: x=s+ns, where s is nonstationary target signal including pulse signal and partial discharge signal at random positions, and ns is background noise.
The finesses of x in the space ℝ spread by different key parameters were calculated according to (13), as shown in Fig. 5.  Figure 5 showed that the global fitness was a multipolar, nonlinear function. When extracted s from x by BASD, the flow chart was shown in Table 2. Parameters calculated results were shown in Fig.6. The black cycle indicated the start-end of the target segment.
The first generation of the optimal trajectory was shown in Fig. 7. The final iteration number was 26 with a time of 10.7 s. Wavelet decomposition (WD), VMD, SD based on PSO were carried out to verify the performance of BASD. After several repeated attempts, sym3 wavelet basis and 3 decomposition layers were selected for WD. Intrinsic mode was set to be 4 for VMD. The extraction results obtained by different methods were shown in Fig.8. Corresponding error curves were shown in Fig. 9. In Fig.8, there were local feature aliasing in the results of VMD and WD and serious errors will occur if the parameters were preset unsuitably.
The PSO trapped into a locally optimal solution for some factors,leading to local maximum errors in Fig. 8. While results obtained by BASD is relatively ideal.

Conclusion
For nonstationary signal extraction, the dictionary training algorithm based on feature parameters is firstly used to determine the key parameter range of feature atoms, which can effectively reduce the redundancy while ensuring the completeness of the redundant dictionary; the bat algorithm is utilized to transform the signal sparse decomposition problem into an optimization problem with the ℓ-2 norm of residual as the fitness, which effectively improves the efficiency of the sparse decomposition algorithm. The experimental results showed that compared with other methods, the BASP algorithm is flexible and auto-adaptive, and can extract nonstationary signals form noise background without over constrained prior knowledges, and ensures maximum retention of other signal components, which is very important for weak signal detection under strong sparse interference.