✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
🔥 内容介绍
引言: 稀疏性度量是一种用于评估数据集中稀疏性的方法,可以帮助我们理解数据的特征和结构。RQAM(稀疏性度量的自适应权重算法)和AWSPT(自适应权重稀疏性度量的改进算法)是两种常用的稀疏性度量算法。本文将以西安交通大学轴承2-3数据集为例,介绍这两种算法的步骤和代码实现。
一、稀疏性度量 稀疏性度量是指通过计算数据集中非零元素的比例来评估数据集的稀疏性。稀疏性度量可以帮助我们了解数据集中的稀疏性程度,从而选择合适的算法进行处理。常用的稀疏性度量方法包括L0范数、L1范数和L2范数等。
二、RQAM算法步骤 RQAM算法是一种基于稀疏性度量的自适应权重算法,用于选择合适的权重矩阵。其步骤如下:
- 初始化权重矩阵W为单位矩阵。
- 计算数据集的稀疏性度量值,选择合适的度量方法。
- 根据稀疏性度量值对权重矩阵W进行更新,使得稀疏性度量值最小化。
- 重复步骤2和3,直到稀疏性度量值收敛或达到预设的迭代次数。
三、AWSPT算法步骤 AWSPT算法是一种改进的自适应权重稀疏性度量算法,用于进一步提高稀疏性度量的准确性。其步骤如下:
- 初始化权重矩阵W为单位矩阵。
- 计算数据集的稀疏性度量值,选择合适的度量方法。
- 根据稀疏性度量值对权重矩阵W进行更新,使得稀疏性度量值最小化。
- 根据更新后的权重矩阵W计算数据集的稀疏性度量值。
- 如果新的稀疏性度量值比之前的值更小,则继续更新权重矩阵W;否则,停止迭代。
- 重复步骤4和5,直到稀疏性度量值收敛或达到预设的迭代次数。
四、西安交通大学轴承2-3数据集 西安交通大学轴承2-3数据集是一个常用的实验数据集,用于测试稀疏性度量算法的性能。该数据集包含了轴承在不同工况下的振动信号,用于判断轴承的健康状态。通过对该数据集的稀疏性度量,可以更好地了解轴承的特征和结构。
五、代码实现 以下是RQAM算法和AWSPT算法的伪代码实现:
RQAM算法:
1. 初始化权重矩阵W为单位矩阵
2. 计算数据集的稀疏性度量值
3. while 稀疏性度量值未收敛 and 迭代次数小于预设次数:
4. 更新权重矩阵W
5. 计算新的稀疏性度量值
6. 输出最终的稀疏性度量值和权重矩阵W
AWSPT算法:
1. 初始化权重矩阵W为单位矩阵
2. 计算数据集的稀疏性度量值
3. while 稀疏性度量值未收敛 and 迭代次数小于预设次数:
4. 更新权重矩阵W
5. 计算新的稀疏性度量值
6. if 新的稀疏性度量值比之前的值更小:
7. 继续更新权重矩阵W
8. else:
9. 停止迭代
10. 输出最终的稀疏性度量值和权重矩阵W
结论: 稀疏性度量是一种重要的数据分析方法,可以帮助我们理解数据集的特征和结构。RQAM和AWSPT是常用的稀疏性度量算法,可以通过迭代更新权重矩阵来提高稀疏性度量的准确性。通过以西安交通大学轴承2-3数据集为例,我们可以更好地理解和应用这两种算法。
📣 部分代码
% This is an implementation example of the sparsity measures (SMs),
% Adaptive SMs, and Ratio of different quasi-arithmetic means (RQAM) for
% machine condition monitoring (especially focus on incipient fault
% detection and degradation assessment). More details of this codes can
% refer to the corresponding document titled "MATLAB Codes of Sparsity
% Measures and New Statistical Indices and Their Application Examples
% to Machinery Condition Monitoring"
%
% Hope this codes and the related document could accelerate the development
% of machine condition monitoring as well as the more general PHM.
% --------------------------
% Author: Bingchang Hou
% Time of this version: 2023-07
% --------------------------
%% Data loading
clc,clear all, close all
load XJTUBearing_2_3.mat % XJTU2_3
Fs = 25600;
Data = XJTU2_3; % Fs = 20000;
%% Parameter assignment
[L1,L2] = size(Data);
variance = std(Data(:,1)); constantM = -2*variance*log(1-0.3); HealthySignal = Data(:,1);
%% Run-to-failure assessment
for i = 1:L2
Sig = Data(:,i);
SE = (abs(hilbert(Sig))).^2;
% [f1,SES] = FreAm(SE,Fs);
% it is recommended to used SES(2:end) because SES(1) is the signal
% mean value, it not related to fault characteristic frequency (FCF) and
% may affect the quantification.
% PQMean(i) = pqMean(SE,2,1);
% KurC(i) = kurtosisCM(Sig);
% KurR(i) = kurtosisRM(SE.^(1/2));
% NegativeEn(i) = NegEn(SE);
% BCSMValue(i) = BCSM(SE,1);
% GI(:,i) = GINI(SE,4); % I = 4, It return original GI, and GI2, GI3
% GGIvalue(i) = GGI(SE,1);
%
% Aaptive_SE = AWSPT(SE,HealthySignal,'SP',0.15);
% A_NegEn(i) = NegEn(Aaptive_SE);
SparMeaVect(:,i) = RQAMfeature(SE); % It returns the SM feature vector, length =12
FeatureVect(:,i) = RQAMfeature(SE,HealthySignal); % % It returns the adaptive
% SM feature vector whose length =11 and RQAM feature whose length is
% also 12. So, FeatureVect(1:12,i) is adaptive SM feature vector,
% FeatureVect(13:end,i) is RQAM feature vector
end
%% Plot SM features for machine condition monitoring
figure,
for i = 1:12
subplot(3,4,i), plot(SparMeaVect(i,:))
end
%% Adaptive SM features for machine condition monitoring
figure,
for i = 1:12
subplot(3,4,i), plot(FeatureVect(i,:))
end
%% RQAM features for machine condition monitoring
figure,
for i = 1:11
subplot(3,4,i), plot(FeatureVect(12+i,:))
end
⛳️ 运行结果
🔗 参考文献
[1] B. Hou, D. Wang, T. Xia, Y. Wang, Y. Zhao, K. Tsui, Investigations on quasi-arithmetic means for machine condition monitoring, Mech. Syst. Signal Process. 151 (2021) 107451. https://doi.org/10.1016/j.ymssp.2020.107451
[2] B. Hou, D. Wang, Y. Wang, T. Yan, Z. Peng, K.-L. Tsui, Adaptive Weighted Signal Preprocessing Technique for Machine Health Monitoring, IEEE Trans. Instrum. Meas. 70 (2021) 1–11. https://doi.org/10.1109/TIM.2020.3033471
[3] B. Hou, D. Wang, T. Yan, Y. Wang, Z. Peng, K.-L. Tsui, Gini Indices Ⅱ and Ⅲ: Two New Sparsity Measures and Their Applications to Machine Condition Monitoring, IEEE/ASME Trans. Mechatronics. 4435 (2021) 1–1. https://doi.org/10.1109/TMECH.2021.3100532
[4] B. Hou, D. Wang, T. Xia, L. Xi, Z. Peng, K. Tsui, Generalized Gini indices: Complementary sparsity measures to Box-Cox sparsity measures for machine condition monitoring, Mech. Syst. Signal Process. 169 (2022) 108751. https://doi.org/10.1016/j.ymssp.2021.108751