今天给大家分享多点最优调整的最小熵解卷积算法 ,主要从算法原理和代码实战展开。需要了解更多算法代码的,可以点击文章左下角的阅读全文,进行获取哦~需要了解智能算法、机器学习、深度学习和信号处理相关理论的可以后台私信哦,下一期分享的内容就是你想了解的内容~
一、算法原理
2016年McDonald等提出了多点最优最小熵解卷积(multipoint optimal minimum entropy deconvolution adjusted,MOMEDA)算法,该算法通过引入时间目标向量来定义解卷积,从而得到脉冲序列的位置和权重。相对于MCKD方法,MOMEDA不仅可以设置非整数的故障周期,而且不需要通过迭代就可获取最佳的FIR滤波器。
MOMEDA算法的思想是通过非迭代的方式寻找一个最优滤波器f,通过采集到的振动信号x重构系统卷积前的冲击信号y,即
MOMEDA算法根据旋转机械故障信号中存在周期性冲击的特点,提出了多点D范数,即
其中,t为定义了解卷积目标冲击成分的位置和权重 的常向量。当目标向量t与原冲击信号完全契合时,解卷积效果最好。此时多点D范数最大,与之对应的滤波器就是一组最优滤波器。等价求解上式,即为
求解可得
二、代码实战
Simple vibration fault model
close all
n = 0:4999;
h = [-0.05 0.1 -0.4 -0.8 1 -0.8 -0.4 0.1 -0.05];
faultn = 0.05*(mod(n,50)==0);
fault = filter(h,1,faultn);
noise = wgn(1,length(n),-25);
x = sin(2*pi*n/30) + 0.2*sin(2*pi*n/60) + 0.1*sin(2*pi*n/15) + fault;
xn = x + noise;
No window. A 5-sample recangular window would be ones(5,1).
window = ones(1,1);
1000-sample FIR filters will be designed
L = 1000;
Recover the fault signal of period 50
f y] = momeda(xn,L,window,50,1);
function [MKurt f y] = momeda(x,filterSize,window,period,plotMode)
% MULTIPOINT OPTIMAL MINUMUM ENTROPY DECONVOLUTION ADJUSTED
% code by Geoff McDonald (glmcdona@gmail.com), 2015
% Used in my research with reference to paper:
%
% momeda(x,filterSize,window,period,plotMode)
% Multipoint Optimal Minimum Entropy Deconvolution (MOMEDA) computation algorithm. This proposed
% method solves the optmial solution for deconvolving a periodic train of impulses from a signal.
% It is best-suited in application to rotating machine faults from vibration signals, to deconvolve
% the impulse-like vibration associated with many gear and bear faults.
%
% This method is derived in the Algorithm Reference section.
%
%
% Algorithm Reference:
% Preparing to publish.
% G.L. McDonald, <others>, Multipoint Optimal Minimum Entropy Deconvolution and Convolution
% Fix: Application to Vibration Fault Detection, unpublished
%
% Inputs:
% x:
% Signal to generate apply MOMEDA on. Generally this should be around the range
% of 1000 to 10,000 samples covering at least 5 rotations of the elements in the machine.
%
% filterSize:
% This is the length of the finite inpulse filter filter to
% design. Generally a number on the order of 500 or 1000 is good, but may
% depend on the dataset length.
%
% window:
% This is the window that be convolved with the impulse train target. Generally, a
% rectangular window works well, eg [1 1 1 1 1].
%
% period:
% This is the periods to test as the spectrum x-axis. It should be a decimal range, like:
% range = 5:0.1:300;
%
% plotMode:
% If this value is > 0, plots will be generated of the iterative
% performance and of the resulting signal.
%
% Outputs:
% MKurt:
% The Multipoint Kurtosis of the Deconvolution result.
%
% f:
% Optimal FIR filter designed.
%
% y:
% Filtered output signal.
%
% Assign default values for inputs
if( isempty(filterSize) )
filterSize = 300;
end
if( isempty(plotMode) )
plotMode = 0;
end
if( isempty(window) )
window = ones(1,1);
end
if( sum( size(x) > 1 ) > 1 )
error('MOMEDA:InvalidInput', 'Input signal x must be 1d.')
elseif( sum(size(plotMode) > 1) ~= 0 )
error('MOMEDA:InvalidInput', 'Input argument plotMode must be a scalar.')
elseif( sum(size(filterSize) > 1) ~= 0 || filterSize <= 0 || mod(filterSize, 1) ~= 0 )
error('MOMEDA:InvalidInput', 'Input argument filterSize must be a positive integer scalar.')
elseif( sum(size(window) > 1) > 1 )
error('MOMEDA:InvalidInput', 'Input argument window must be 1d.')
elseif( period <= length(window) )
error('MOMEDA:InvalidInput', 'Period should be larger than the length of the window.')
elseif( filterSize >= length(x) )
error('MOMEDA:InvalidInput', 'Input argument filterSize must be smaller than the length of input signal x.')
end
L = filterSize;
x = x(:); % A column vector
%%% Calculte X0 matrix
N = length(x);
X0 = zeros(L,N);
for( l =1:L )
if( l == 1 )
X0(l,1:N) = x(1:N);
else
X0(l,2:end) = X0(l-1, 1:end-1);
end
end
% "valid" region only
X0 = X0(:,L:N-1); % y = f*x where only valid x is used
% y = Xm0'*x to get valid output signal
autocorr = X0*X0';
autocorr_inv = pinv(autocorr);
% Built the impulse train vector separated the by periods
t = zeros(N-L,1);
points{1} = 1:period:(size(X0,2)-1);
points{1} = round(points{1});
t(points{1},1) = 1;
% Apply the windowing function to the target vectors
t = filter(window, 1, t);
% Calculate the spectrum of optimal filters
f = autocorr_inv * X0 * t;
% Calculate the spectrum of outputs
y = X0'*f;
% Calculate the spectrum of PKurt values for each output
MKurt = mkurt(y,t);
% Plot the result
if( plotMode > 0 )
figure;
subplot(3,1,1)
plot(x)
title('Input signal');
xlabel('Sample number');
subplot(3,1,2)
plot(y)
title('Output signal');
xlabel('Sample number');
subplot(3,1,3)
stem(f)
title('Designed optimal FIR filter');
xlabel('Sample number');
end
end
function [result] = mkurt(x,target)
% This function simply calculates the summed kurtosis of the input
% signal, x, according to the target vector positions.
result = zeros(size(x,2),1);
for i = 1:size(x,2)
result(i) = ( (target(:,i).^4)'*(x(:,i).^4) )/(sum(x(:,i).^2)^2) * sum(abs(target(:,i)));
end
end
仿真结果:
参考文献
[1]MCDONALD G L, ZHAO Q. Multipoint optimal minimum entropy deconvolution and convolution fix: application to vibration fault detection[J]. Mechanical Systerns and Signal Processing, 2016, 82: 461-477.
[2]宋宇博, 张宇飞. 应用CEEMD降噪与自适应MOMEDA的轴承故障特征提取方法[J]. 中国测试,2024, 50(2): 180
188.
部分知识来源于网络,如有侵权请联系作者删除~
今天的分享就到这里了,后续想了解智能算法、机器学习、深度学习和信号处理相关理论的可以后台私信哦~希望大家多多转发点赞加收藏,你们的支持就是我源源不断的创作动力!
作 者 | 华 夏
编 辑 | 华 夏
校 对 | 华 夏