MATLAB Implementation of the Original LMD Algorithm

Resource Overview

MATLAB code implementation of the original Local Mean Decomposition (LMD) algorithm

Detailed Documentation

The original Local Mean Decomposition (LMD) algorithm is a time-frequency analysis method commonly used in signal processing, particularly widely applied in mechanical fault diagnosis. This algorithm decomposes non-stationary signals into several Product Function (PF) components, facilitating the analysis of local signal characteristics. ### Common Implementation Issues Inadequate endpoint effect handling: LMD is sensitive to signal boundaries, and improper treatment can lead to distorted decomposition results. Code implementations should include symmetric extension or mirroring techniques at signal endpoints to mitigate edge artifacts. Inaccurate extremum point extraction: Accurate identification of local extremum points is crucial for LMD. Algorithms may fail due to noise interference or improper interpolation methods. Robust peak detection functions like findpeaks() with appropriate threshold settings are essential. Loose iteration convergence criteria: Unreasonable termination conditions (such as residual thresholds or maximum iteration counts) can cause over-decomposition or premature termination. Implementing adaptive tolerance checks based on signal energy ratios improves reliability. ### Improvement Recommendations Optimize moving average calculation: Use symmetric window functions (e.g., Hanning window) to smooth local mean lines and reduce boundary oscillations. The movmean() function with centered windowing provides better boundary handling. Introduce envelope correction: After cubic spline interpolation of extracted extremum points, apply low-pass filtering (using filtfilt() for zero-phase distortion) to eliminate high-frequency noise effects. Dynamic convergence judgment: Combine relative error and component orthogonality (such as correlation coefficients) as dual stopping criteria. Implementing cross-validation between successive PF components enhances decomposition quality. ### Debugging Directions If the algorithm fails to run, progressively check: Whether the input signal is a non-stationary time series (e.g., vibration signals) - validate using stationarity tests like Augmented Dickey-Fuller test; Whether the extremum point detection function correctly identifies peaks/valleys - visualize detected points using plot() against original signal; Whether decomposed PF components satisfy physical meaning of instantaneous frequency - verify monotonicity of instantaneous phase derivatives. Original LMD MATLAB implementation typically requires nested custom functions, with emphasis on validating intermediate outputs at each step against expected results. Key functions should include extremum detection, envelope calculation, and component separation loops with proper termination checks.