HE/FCME.m
2024-03-30 16:35:40 +08:00

46 lines
2.0 KiB
Matlab
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

%%************************【FCME检测算法函数】****************************%%
%%=============================参数说明===================================%%
% data 待检测的频域信号
% Pf 虚警概率
% J 检测出来的干扰点集合
%%========================================================================%%
function J = FCME(data,Pf)
T = sqrt(-1*(4/pi)*log(Pf)); %%门限因子
J = [];
L = length(data);
fi = [];
[y_sort,index] = sort(abs(data),'ascend'); %%按幅度值升序排列
%%求每个频点的幅值
for k = 1:L
fi(k)=abs(data(k));
end
%%%%初始化两个集合
J = index(round(L/10)+1:end); %%剩余有干扰集合
I = index(1:round(L/10)); %%无干扰集合\
S = mean(fi(I));
%%迭代求出干扰点集合
for m = 1:50 %%FCME迭代次数
length_J = length(J); %%J集合的长度
ii = 1;
jj = 1;
new_I = [];
new_J = [];
for j1 = 1:length_J
J1 = J(j1); %%J集合的索引
if fi(J1) < T*S %%如果小于门限则移到I集合从J集合剔除
new_I(ii) = J1;
ii = ii +1;
else %%如果大于于门限则继续留在J集合
new_J(jj) = J1;
jj = jj + 1;
end
end
if isempty(new_I) %%如果new_I为空直接跳出
break;
end
J = new_J;
I = union(I,new_I);
S = mean(fi(I)); %%干扰频点
end
end