[Signal Decomposition] Optimization of variational modal decomposition VMD based on genetic algorithm to achieve signal denoising with matlab code

1 Introduction

There is usually noise interference in the echo signal of ultrasonic flowmeter, which makes it difficult to locate the echo signal accurately. In order to filter out the noise in the ultrasonic echo signal, a signal decompression method based on the optimal variational mode decomposition (VMD) algorithm is proposed. The proposed method first uses the information entropy of the mutual information criterion to associate the genetic algorithm with the VMD. Then, the sample entropy is used as the fitness function to adaptively optimize the parameter combination in the VMD algorithm. Decomposition, using the correlation coefficient to calculate the effective signal, and further denoising the effective signal for reconstruction. The simulation results show that the proposed method can effectively filter out the noise in the ultrasonic echo signal and can completely retain the useful signal.

When using VMD algorithm to decompose the original signal, parameters need to be set. In the research process, it is found that if one parameter is set unchanged and the other parameter is optimized, the interaction between the two parameters will be ignored, and the final result will fall into the dilemma of local optimization. Genetic algorithm is an intelligent optimization algorithm with strong global nonlinear ability. Combining the genetic algorithm with the adaptability of MI can realize the global optimization of the objective function (original signal). The process of using the genetic algorithm to solve the optimization problem is to use the population search technology to solve the population as a set of problems, and to generate a new generation of population by applying a series of genetic operations such as selection, crossover, and mutation of similar biological genetic environmental factors to the current population. And gradually bring the population to a state containing an approximate optimal solution. The population in the genetic algorithm is the feasible solution set (objective function), and the fitness function is the function value used for evaluation, so it is particularly important to construct a fitness function to be used as the decision function to generate the optimal solution. In this paper, the sample entropy is used as the fitness function. The sample entropy measures the complexity of the time series by the probability of generating a new pattern in the signal. When the entropy value is the smallest, the complexity of the signal is the lowest. The sample entropy is defined as


2 Simulation code

<span style="color:#333333"><span style="background-color:rgba(0, 0, 0, 0.03)"><code>function ret = Cross(pcross, lenchrom, chrom, sizepop, bound)</code><code>​</code><code>    <span style="color:#ca7d37">for</span> i = <span style="color:#0e9ce5">1</span>:sizepop</code><code>​</code><code>        pick = <span style="color:#ca7d37">rand</span>(<span style="color:#0e9ce5">1</span>, <span style="color:#0e9ce5">2</span>);</code><code>​</code><code>        <span style="color:#ca7d37">while</span> prod(pick) == <span style="color:#0e9ce5">0</span></code><code>            pick = <span style="color:#ca7d37">rand</span>(<span style="color:#0e9ce5">1</span>, <span style="color:#0e9ce5">2</span>);</code><code>        end</code><code>​</code><code>        <span style="color:#ca7d37">index</span> = ceil(pick .* sizepop);</code><code>​</code><code>        pick = <span style="color:#ca7d37">rand</span>;</code><code>​</code><code>        <span style="color:#ca7d37">while</span> pick == <span style="color:#0e9ce5">0</span></code><code>            pick = <span style="color:#ca7d37">rand</span>;</code><code>        end</code><code>​</code><code>        <span style="color:#ca7d37">if</span> pick > pcross</code><code>            <span style="color:#ca7d37">continue</span>;</code><code>        end</code><code>​</code><code>        flag = <span style="color:#0e9ce5">0</span>;</code><code>​</code><code>        <span style="color:#ca7d37">while</span> flag == <span style="color:#0e9ce5">0</span></code><code>​</code><code>            pick = <span style="color:#ca7d37">rand</span>;</code><code>​</code><code>            <span style="color:#ca7d37">while</span> pick == <span style="color:#0e9ce5">0</span></code><code>                pick = <span style="color:#ca7d37">rand</span>;</code><code>            end</code><code>​</code><code>            <span style="color:#ca7d37">pos</span> = ceil(pick .* sum(lenchrom));</code><code>            pick = <span style="color:#ca7d37">rand</span>;</code><code>            v1 = chrom(<span style="color:#ca7d37">index</span>(<span style="color:#0e9ce5">1</span>), <span style="color:#ca7d37">pos</span>);</code><code>            v2 = chrom(<span style="color:#ca7d37">index</span>(<span style="color:#0e9ce5">2</span>), <span style="color:#ca7d37">pos</span>);</code><code>            chrom(<span style="color:#ca7d37">index</span>(<span style="color:#0e9ce5">1</span>), <span style="color:#ca7d37">pos</span>) = pick * v2 + (<span style="color:#0e9ce5">1</span> - pick) * v1;</code><code>            chrom(<span style="color:#ca7d37">index</span>(<span style="color:#0e9ce5">2</span>), <span style="color:#ca7d37">pos</span>) = pick * v1 + (<span style="color:#0e9ce5">1</span> - pick) * v2;</code><code>            flag1 = test(lenchrom, bound, chrom(<span style="color:#ca7d37">index</span>(<span style="color:#0e9ce5">1</span>), :));</code><code>            flag2 = test(lenchrom, bound, chrom(<span style="color:#ca7d37">index</span>(<span style="color:#0e9ce5">2</span>), :));</code><code>​</code><code>            <span style="color:#ca7d37">if</span> flag1 * flag2 == <span style="color:#0e9ce5">0</span></code><code>                flag = <span style="color:#0e9ce5">0</span>;</code><code>            <span style="color:#ca7d37">else</span></code><code>                flag = <span style="color:#0e9ce5">1</span>;</code><code>            end</code><code>​</code><code>        end</code><code>​</code><code>    end</code><code>​</code><code>    ret = chrom;</code><code>end</code><code>​</code></span></span>

3 Running results

4 References

[1] Wang Qi, Wang Xiaopeng, Wang Bohui. Echo Signal Denoising Based on Optimal Variational Mode Decomposition Algorithm [J]. Advances in Lasers and Optoelectronics, 2021, 58(20):2007001.

[2] Bian Jie. "Bearing fault diagnosis based on variational modal decomposition based on genetic algorithm parameter optimization combined with 1.5-dimensional spectrum." Propulsion Technology 38.7(2017):7.

[3] Jianxiong Chu. Fault Diagnosis of Power Transformer Windings Based on Variational Mode Decomposition Energy Entropy and Support Vector Machines. Diss. Xi'an University of Technology, 2019.

About the blogger: He is good at Matlab simulation in various fields such as intelligent optimization algorithm, neural network prediction, signal processing, cellular automata, image processing, path planning, UAV, etc. The related matlab code questions can be exchanged privately.

Some theories refer to online literature. If there is any infringement, contact the blogger to delete it.

Tags: MATLAB programming language signal processing

Posted by sayoko on Tue, 12 Jul 2022 23:32:02 +0530