Empirical Mode Decomposition (EMD)

Table of contents

1 background

2 Time series stationarity

3 EMD method

4 EMD process

5 Drawbacks of the EMD method

6 Python 


1 background

        In actual engineering measurement, because the measurement system is affected by the external environment, a trend item is often generated in the measurement signal. The trend item refers to the frequency component in the signal whose period is greater than the sampling length , and usually appears as a linear or slowly changing trend error. Extracting and eliminating the trend items in the signal is an important part of signal preprocessing. The trend items will seriously affect the signal time-domain correlation analysis and frequency-domain power spectrum estimation accuracy. Severe trend item interference will seriously distort the low frequency spectrum.

        At present, the methods for extracting trend items mainly include: average slope method , difference method , low-pass filtering method and least squares fitting method , etc. These methods usually need to pre-clarify the type of trend items in the signal, such as linear trend items, polynomial or exponential trend items, etc., which are not suitable for the extraction of trend items with complex changes, which greatly limits their application range.

         In recent years, there have been reports on the research results of using EMD to extract trend items. Using EMD to extract trend items does not consider the type of trend items , and it is self-adaptive, so it has a wider range of applications. However, there is a non-negligible prerequisite for using EMD to extract trend items: the test signal must be completely decomposed, that is, the decomposable condition must be met , otherwise it will cause modal aliasing. At this time, the trend item is likely to exist in the decomposition margin and the low-frequency IMF component at the same time . In this case, it will be difficult to use EMD to extract the trend item. Another factor that affects the performance of EMD decomposition: the endpoint effect will also affect the decomposition margin, resulting in inaccurate extraction of trend items.

        The most notable feature of EMD is that it overcomes the problem of non-adaptive basis functions. What do you mean? Recalling the content of the wavelet analysis part, we will know that wavelet analysis needs to select a certain wavelet base. The selection of the wavelet base has a great impact on the results of the entire wavelet analysis. Once the wavelet base is determined, it will not be replaced during the entire analysis process. , even if the wavelet basis may be optimal globally, it may not be optimal locally, so the basis function of wavelet analysis lacks adaptability.

        In layman's terms, what are the benefits of using EMD? For an unknown signal, the decomposition can be started directly without pre-analysis and research. This method will automatically divide into layers according to some fixed patterns, without human settings and intervention.

        To put it more simply, EMD is like a machine. Throw in a pile of mixed coins, and he will automatically divide them into several shares according to 1 yuan, 5 cents, 1 cent, 5 cents, and 1 cent.

Time series stationarity

         The so-called stationarity of time series generally refers to wide stationarity, that is, the mean and variance of time series are constants independent of time , and its covariance is related to time interval but also independent of time. To put it simply, a stationary time series refers to: thinking about the sample time series that can be obtained in the future, we can conclude that its mean, variance, and covariance must be equal to the sample time series that has been obtained now. 
        Conversely, if the essential characteristics of the sample time series only exist in the current period and will not continue into the future, that is, the mean, variance, and covariance of the sample time series are non-constant, then such a time series is not enough to indicate the future, we Such a sample time series is said to be non-stationary. 
        Visually understood, stationarity is the requirement that the fitted curve obtained through the sample time series can continue to follow the existing form of "inertia" for a period of time in the future; if the data is non-stationary, it means that the sample fitted curve The shape of the model does not have the characteristics of "inertial" continuation, that is, the curve fitted based on the sample time series to be obtained in the future will be very different from the current sample fitting curve. 
        In fact, ideal "stationary" time series hardly exist in the world. Professor Ouyang Shoucheng once pointed out: "Stationary sequence eliminates small probability events". That is to say, in the view of Professor Ouyang's collapse theory, the method of EMD is also problematic. However, this method does extend the scope of application of the traditional idea of ​​stabilization to the processing of any type of time series, which is also a remarkable new development.

3 EMD method

The EMD method is an analysis method          for non-stationary signals proposed by Dr. E Huang of NASA . The EMD process is essentially a means of smoothing non-stationary signals. The result is to decompose the fluctuations and trends of different scales in the signal step by step, and generate a series of data sequences with different characteristic scales. Each sequence is called an intrinsic mode function IMF .

         Every IMF must meet 2 conditions:

  1. In the whole time course, the number of extreme points is equal to the number of zero-crossing points or the difference is at most 1;
  2. At any moment, the average value of the upper envelope formed by the local maximum points and the lower envelope formed by the local minimum points is zero, that is, the upper and lower envelopes are locally symmetrical with respect to the time axis.

What do you mean?

1) The graph line should repeatedly cross the x-axis, like this:

       Instead of multiple poles appearing after a certain crossing of zero like this:

 2) The envelope should be symmetrical, like this:

Instead of something like this:

Example of EMD decomposition:

         The picture above consists of 7 pictures,

  • The first one is the original signal,
  • The following are the six components obtained after EMD decomposition, which are called IMF1~IMF5, respectively.
  • The last picture is the residual,

        Each IMF component represents an intrinsic mode component existing in the original signal. It can be seen that each IMF component satisfies these two constraints. 

Assumptions in the EMD method:

  (1) Any signal can be decomposed into several IMF components;

  (2) Each IMF component can be linear or nonlinear, the number of local zero points and the number of extreme points are the same, and the upper and lower envelopes are locally symmetrical about the time axis;

  (3) A signal can contain several IMF components.

4 EMD process

        Any complex signal can be regarded as the sum of multiple different intrinsic mode functions. Any mode function can be linear or nonlinear, and any two modes are independent of each other. Based on this assumption, the EMD decomposition steps of the complex signal x(t) are as follows:

step 1:

        Find all the extreme points of the signal, connect the local maximum points to form the upper envelope, and connect the local minimum points to form the lower envelope through the cubic spline curve . The upper and lower envelopes contain all data points.

        

Step 2:

       From the average of the upper and lower envelopes , we get

         

          

 Step 3:

         Subtract the mean envelope from the original signal to get the intermediate signal. 

          

         This process is called "sieving" the original signal x(t) to get a new signal after one "sieving" .

         

 Step 4:

         Judging whether the intermediate signal meets the two conditions of IMF , if so, the signal is an IMF component ; if not, based on the signal, re-do the analysis of 1)~4). That is, continue to carry out "screening" until the decomposed signal satisfies the IMF condition after k times of decomposition to obtain the first IMF component of the original signal .

           

          The IMF component representing the highest frequency in the original signal x(t) is subtracted from the original signal x(t) to obtain the residual component r1(t) .

        Acquisition of IMF components usually requires several iterations. 

      

 Step 5:

        The above "sieving" processing is performed on r1(t), and the second IMF component I2(t) can be obtained, and then r1(t) is subtracted from I2(t) to obtain the remaining component r2(t). This decomposition continues until the last residual signal rn(t) can no longer be decomposed, and the EMD process on the signal x(t) is completed:

         

 Step 6:

         After becoming a monotonic function, the rest becomes the residual component. The sum of all IMF components and residual components is the original signal x(t):

          

         In the "screening" process of EMD, it can be seen that compared with Fourier transform and wavelet decomposition, EMD does not need to set basis functions, so it has a wider application range.

        After decomposing the original signal x(t), the first IMF component contains the component with the smallest time scale (highest frequency) in the original signal x(t), and its corresponding frequency component gradually decreases with the increase of the IMF order. Among them, the frequency components of the margin are the lowest. According to the convergence condition of EMD decomposition, the decomposition margin is a monotone function, and the period is greater than the record length of the signal, so it can be used as a trend item.

5 Drawbacks of the EMD method

        The EMD method is applicable to a wide range of signals and is independent of the type of signals and trend items. But using the EMD method has two drawbacks:

(1) Extracting the trend item must require the original signal itself to satisfy the decomposable condition, that is, where,represents the amplitude and frequency of component 1 in the multi-component signal, andrepresents the amplitude and frequency of component 2 in the multi-component signal. If the decomposability condition is not satisfied, mode aliasing will occur during the EMD process, resulting in the coexistence of different frequency components in the same IMF component. Then the low-frequency trend item component may also be aliased in the low-frequency IMF component that is close to it. At this time, using the decomposition marginas the trend item will make the trend item extraction incomplete.

(2) Another defect of EMD is the problem of endpoint effect . A key step in EMD decomposition is to use the cubic spline method to obtain the average value of the upper and lower envelopes. The cubic spline curve has the characteristics of smooth first differential and continuous second differential. Due to the limited length of the analyzed signal, the two ends of the signal cannot be determined to be extreme values. Therefore, when performing cubic spline interpolation, the upper and lower envelopes of the signal must be
severely distorted near the two ends of the signal. In the high-frequency component of the signal, due to the small time scale and the small distance between extreme values, the edge effect at the end is only limited to a small part at both ends of the signal. But for low-frequency components, the time scale is large, the distance between extreme values ​​is large, and the edge effect at the end propagates into the signal, especially when the original signal data set is relatively short, which will seriously affect the quality of EMD decomposition. As the decomposition margin, it is also affected by the endpoint effect. In this case, it is simplytreated as a trend item, which will also affect the extraction accuracy of the trend item.

endpoint effect:

6 Python 

pip install EMD-signal == 0.2.10

import numpy as np
from PyEMD import EMD, Visualisation
import matplotlib.pyplot as plt

# data = np.random.randint(6, 10, 300)
# 构建信号
# t = np.arange(0,1, 0.01)
t = np.linspace(0, 100, 100)
data = 2*np.sin(2*np.pi*15*t) +4*np.sin(2*np.pi*10*t)*np.sin(2*np.pi*t*0.1)+np.sin(2*np.pi*5*t) + 0.05 * t + 1

# t = np.linspace(0, 100, 100)
# data = 0.05 * t + 1

plt.plot(data)
plt.show()

emd = EMD()
emd.emd(data)
imfs, res = emd.get_imfs_and_residue()
imf = imfs.sum(axis=0) - imfs[-1]
print(imf)
plt.plot(imf)
plt.show()
# 趋势画图
plt.plot(imfs[-1])
plt.show()

# 绘制 IMF
vis = Visualisation()
vis.plot_imfs(imfs=imfs, residue=res, t=t, include_residue=True)
# 绘制并显示所有提供的IMF的瞬时频率
vis.plot_instant_freq(t, imfs=imfs)
vis.show()

A method to improve the endpoint effect of EMD - Zhihu

What is the endpoint effect of EMD (Empirical Mode Decomposition)? - Know almost

EMD algorithm principle and python implementation_Blog of brain computer interface community-CSDN blog_emd python

2. Signal Decomposition —> Empirical Mode Decomposition (EMD) Study Notes

 This article will let you understand Empirical Mode Decomposition (EMD) - Basic Theory - Know about

YouDao Cloud Note

Guess you like

Origin blog.csdn.net/weixin_39910711/article/details/124661068