You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
2.0 KiB
45 lines
2.0 KiB
%%************************【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
|
|
|