EMD function: boundary treatment
显示 更早的评论
I would like to have some precise information on how the MATLAB function EMD treats the boundary of the input signal.
There is no such information oin the help, and I believe this is a very important point.
Thanks in advance
回答(1 个)
Shubham
2024-12-3
Hi Emanuele,
Here's a simplified explanation of how MATLAB's EMD function handles boundaries:
- Envelope Interpolation: This function identifies local maxima and minima to create upper and lower envelopes using methods like spline or pchip. This helps avoiding artifacts when there aren't enough extrema for smooth interpolation.
- Boundary Extension: To reduce edge effects, the signal is extended by reflecting it at the edges. The emdWaveExtension method helps simulates continuation of the signal at both ends.
% extended waves on the left
[lpksLoc, lpksVal, lbtmLoc, lbtmVal] = signalwavelet.internal.emd.emdWaveExtension(t(1), rsigL(1),...
pksLoc(1), rsigL(pksIdx(1)),...
btmsLoc(1), rsigL(btmsIdx(1)),...
-1);
% extended waves on the right
[rpksLoc, rpksVal, rbtmLoc, rbtmVal] = signalwavelet.internal.emd.emdWaveExtension(t(end), rsigL(end),...
pksLoc(end), rsigL(pksIdx(end)),...
btmsLoc(end), rsigL(btmsIdx(end)),...
1);
- Extrapolation using interp1: The interp1 function is used for extrapolation, choosing spline for smoothness or pchip to avoid overshoots.
Here's a code example of how to do the interpolation:
% Interpolate the upper envelope using spline or pchip
upperEnvelope = interp1(uLoc, uVal, t, 'spline'); % or 'pchip'
% Interpolate the lower envelope using spline
lowerEnvelope = interp1(bLoc, bVal, t, 'spline');
For more informatin on spline and pchip, refer to the following documentation links:
- spline: https://mathworks.com/help/matlab/ref/spline.html
- pchip: https://mathworks.com/help/matlab/ref/pchip.html
Hope this helps.
类别
在 帮助中心 和 File Exchange 中查找有关 Multirate Signal Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!