时序分解 | Matlab实现RLMD鲁棒性局部均值分解

2024-04-27 16:12

本文主要是介绍时序分解 | Matlab实现RLMD鲁棒性局部均值分解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

时序分解 | Matlab实现RLMD鲁棒性局部均值分解

目录

    • 时序分解 | Matlab实现RLMD鲁棒性局部均值分解
      • 效果一览
      • 基本介绍
      • 程序设计
      • 参考资料

效果一览

在这里插入图片描述

基本介绍

Matlab实现RLMD鲁棒性局部均值分解,可直接替换 Matlab语言
1.算法新颖小众,用的人很少,包含分解图
2.直接替换数据即可用 适合新手小白 注释清晰~
3.附赠excel测试数据 直接运行main一键出图~

鲁棒性局部均值分解(Robust Locally Mean Decomposition,简称RLMD)是一种信号处理方法,用于对复杂信号进行分解和分析。它是局部均值分解(Locally Mean Decomposition,简称LMD)的改进版本,旨在提高对噪声和干扰的鲁棒性。

局部均值分解是一种将信号分解为局部平稳信号和调制信号的技术。它通过对信号进行迭代滤波和振幅调整来实现分解。然而,传统的局部均值分解对于存在噪声和干扰的信号可能会产生较差的分解结果。

RLMD的主要目标是提高对噪声和干扰的抵抗力。它在局部均值分解的基础上引入了鲁棒性因子,通过自适应调整滤波器的参数来减小噪声和干扰对分解结果的影响。这种方法可以提高信号分解的准确性和稳定性,使得分解结果更加可靠。

程序设计

  • 完整源码和数据获取方式资源处下载Matlab实现RLMD鲁棒性局部均值分解。
%%  清空环境变量
warning off             % 关闭报警信息
close all               % 关闭开启的图窗
clear                   % 清空变量
clc                     % 清空命令行
function [pfs, ams, fms, ort, fvs, iterNum] = lmd_public(x,varargin)
switch ma_iter_mode  case 'fixed' % stick stepcntr = 0; % count times of moving averagemax_c = ceil(smax/span)*15; % theoretic%         max_c = ceil(smax/(span-1));%         nm = length(x);k = (span+1)/2;kmax = nm - (span-1)/2;while (k < kmax) && (cntr < max_c) % find flat stepif x(k) == x(k+1);x = smooth(x, span);cntr = cntr+1;k = k-1;endk = k+1;end%         while ~isempty(find(diff(x)==0)) && (cntr < max_c)% %             find(diff(x)==0)%             x = smooth(x, span);%             cntr = cntr+1;%         endotherwiseerror('No specifications for ma_iter_mode.');end
end% Extend original data to refrain end effect
% ** Modified on emd by G.Rilling and P.Flandrin
% ** http://perso.ens-lyon.fr/patrick.flandrin/emd.html
function [ext_indmin, ext_indmax, ext_x, cut_index] = extend(x, indmin,...indmax, extd_r)
if extd_r == 0 % do not extend xext_indmin = indmin;ext_indmax = indmax;ext_x = x;cut_index = [1,length(x)];return
end
nbsym = ceil(extd_r*length(indmax)); % number of extrema in extending endif x(1) < x(indmax(1)) % first point < first maximumlmax = fliplr(indmax(1:min(end,nbsym)));lmin = fliplr(indmin(2:min(end,nbsym+1)));lsym = indmin(1);else                   % first point > first minimumlmax = [fliplr(indmax(1:min(end,nbsym-1))),1];lmin = fliplr(indmin(1:min(end,nbsym)));lsym = 1;end
end% right end extension
if indmax(end) < indmin(end) % last extremum is minimumif x(end) < x(indmax(end)) % last point < last maximumrmax = fliplr(indmax(max(end-nbsym+1,1):end));rmin = fliplr(indmin(max(end-nbsym,1):end-1));rsym = indmin(end);else                       % last point > last maximumrmax = [xlen, fliplr(indmax(max(end-nbsym+2,1):end))];rmin = fliplr(indmin(max(end-nbsym+1,1):end));rsym = xlen;end
else                         % last extremum is maximumif x(end) > x(indmin(end)) % last point > last minimumrmax = fliplr(indmax(max(end-nbsym,1):end-1));rmin = fliplr(indmin(max(end-nbsym+1,1):end));rsym = indmax(end);else                       % last point < last minimumrmax = fliplr(indmax(max(end-nbsym+1,1):end));rmin = [xlen, fliplr(indmin(max(end-nbsym+2,1):end))];rsym = xlen;end
end% when two or more successive points have the same value we consider only
% one extremum in the middle of the constant area (only works if the signal
% is uniformly sampled)if any(d==0)imax = [];imin = [];bad = (d==0);dd = diff([0 bad 0]);debs = find(dd == 1);fins = find(dd == -1);if debs(1) == 1if length(debs) > 1debs = debs(2:end);fins = fins(2:end);elsedebs = [];fins = [];endendif ~isempty(debs)if fins(end) == mif length(debs) > 1debs = debs(1:(end-1));fins = fins(1:(end-1));elsedebs = [];fins = [];endendendlc = length(debs);if lc > 0for k = 1:lcif d(debs(k)-1) > 0if d(fins(k)) < 0%           imax = [imax round((fins(k)+debs(k))/2)];endelseif d(fins(k)) > 0%           imin = [imin round((fins(k)+debs(k))/2)];endendendendif ~isempty(imax)indmax = sort([indmax imax]);endif ~isempty(imin)indmin = sort([indmin imin]);endend
end% Compute the index of orthogonality
% ** Copied from emd toolbox by G.Rilling and P.Flandrin
% ** http://perso.ens-lyon.fr/patrick.flandrin/emd.html
function ort = io(x,pfs)
% ort = IO(x,pfs) computes the index of orthogonality
%
% inputs : - x   : analyzed signal
%          - pfs  : production functionn = size(pfs,1);s = 0;for i = 1:nfor j =1:nif i~=js = s + abs(sum(pfs(i,:).*conj(pfs(j,:)))/sum(x.^2));endend
endort = 0.5*s;
end% Plot PF, Amplititude Signal and FM Signal
function lmdplot(pfs, ams, fms, smooth_mode)
t = 1:size(pfs,2);
pfn = size(pfs,1);
figure
for pfi = 1:pfnsubplot(pfn,1,pfi);plot(t,pfs(pfi,:));if pfi < pfntitle(['PF',num2str(pfi),' (',smooth_mode,')']);elsetitle(['Residual',' (',smooth_mode,')']);end
end
figure
for ai = 1:pfn-1subplot(pfn-1,1,ai);plot(t,ams(ai,:));title(['Amplititude Signal',num2str(ai),' (',smooth_mode,')']);
end
figure
for fsi = 1:pfn-1subplot(pfn-1,1,fsi);plot(t,fms(fsi,:));title(['FM Signal',num2str(fsi),' (',smooth_mode,')']);
endend

参考资料

[1] https://blog.csdn.net/kjm13182345320/article/details/129215161
[2] https://blog.csdn.net/kjm13182345320/article/details/128105718

这篇关于时序分解 | Matlab实现RLMD鲁棒性局部均值分解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/940952

相关文章

分布式锁在Spring Boot应用中的实现过程

《分布式锁在SpringBoot应用中的实现过程》文章介绍在SpringBoot中通过自定义Lock注解、LockAspect切面和RedisLockUtils工具类实现分布式锁,确保多实例并发操作... 目录Lock注解LockASPect切面RedisLockUtils工具类总结在现代微服务架构中,分布

Java使用Thumbnailator库实现图片处理与压缩功能

《Java使用Thumbnailator库实现图片处理与压缩功能》Thumbnailator是高性能Java图像处理库,支持缩放、旋转、水印添加、裁剪及格式转换,提供易用API和性能优化,适合Web应... 目录1. 图片处理库Thumbnailator介绍2. 基本和指定大小图片缩放功能2.1 图片缩放的

Python使用Tenacity一行代码实现自动重试详解

《Python使用Tenacity一行代码实现自动重试详解》tenacity是一个专为Python设计的通用重试库,它的核心理念就是用简单、清晰的方式,为任何可能失败的操作添加重试能力,下面我们就来看... 目录一切始于一个简单的 API 调用Tenacity 入门:一行代码实现优雅重试精细控制:让重试按我

Redis客户端连接机制的实现方案

《Redis客户端连接机制的实现方案》本文主要介绍了Redis客户端连接机制的实现方案,包括事件驱动模型、非阻塞I/O处理、连接池应用及配置优化,具有一定的参考价值,感兴趣的可以了解一下... 目录1. Redis连接模型概述2. 连接建立过程详解2.1 连php接初始化流程2.2 关键配置参数3. 最大连

Python实现网格交易策略的过程

《Python实现网格交易策略的过程》本文讲解Python网格交易策略,利用ccxt获取加密货币数据及backtrader回测,通过设定网格节点,低买高卖获利,适合震荡行情,下面跟我一起看看我们的第一... 网格交易是一种经典的量化交易策略,其核心思想是在价格上下预设多个“网格”,当价格触发特定网格时执行买

python设置环境变量路径实现过程

《python设置环境变量路径实现过程》本文介绍设置Python路径的多种方法:临时设置(Windows用`set`,Linux/macOS用`export`)、永久设置(系统属性或shell配置文件... 目录设置python路径的方法临时设置环境变量(适用于当前会话)永久设置环境变量(Windows系统

Python对接支付宝支付之使用AliPay实现的详细操作指南

《Python对接支付宝支付之使用AliPay实现的详细操作指南》支付宝没有提供PythonSDK,但是强大的github就有提供python-alipay-sdk,封装里很多复杂操作,使用这个我们就... 目录一、引言二、准备工作2.1 支付宝开放平台入驻与应用创建2.2 密钥生成与配置2.3 安装ali

Spring Security 单点登录与自动登录机制的实现原理

《SpringSecurity单点登录与自动登录机制的实现原理》本文探讨SpringSecurity实现单点登录(SSO)与自动登录机制,涵盖JWT跨系统认证、RememberMe持久化Token... 目录一、核心概念解析1.1 单点登录(SSO)1.2 自动登录(Remember Me)二、代码分析三、

PyCharm中配置PyQt的实现步骤

《PyCharm中配置PyQt的实现步骤》PyCharm是JetBrains推出的一款强大的PythonIDE,结合PyQt可以进行pythion高效开发桌面GUI应用程序,本文就来介绍一下PyCha... 目录1. 安装China编程PyQt1.PyQt 核心组件2. 基础 PyQt 应用程序结构3. 使用 Q

Python实现批量提取BLF文件时间戳

《Python实现批量提取BLF文件时间戳》BLF(BinaryLoggingFormat)作为Vector公司推出的CAN总线数据记录格式,被广泛用于存储车辆通信数据,本文将使用Python轻松提取... 目录一、为什么需要批量处理 BLF 文件二、核心代码解析:从文件遍历到数据导出1. 环境准备与依赖库