フィルターのクリア

Anti-spoofng algorithm design from the block diagram

13 ビュー (過去 30 日間)
zihan LI
zihan LI 2022 年 3 月 10 日
回答済み: Ravi 2024 年 1 月 25 日
I am currently working on designing an anti-spoofing algorithm, but I don't know how to write the code according to this block diagram from a literature. Would someone help me with it, how to transfer these information into coding or how to draw this block diagram on SIMULINK?
  2 件のコメント
Peter O
Peter O 2022 年 3 月 10 日
Can you post the block diagram?
zihan LI
zihan LI 2022 年 3 月 10 日
Oh I am so sorry i fogot this important part.

サインインしてコメントする。

回答 (1 件)

Ravi
Ravi 2024 年 1 月 25 日
Hi Zihan LI,
We can define a function that takes input the signals data ‘S’, the sampling number ‘N’, and the error threshold, ‘epsilon’. Here, S(i, k) represents the carrier frequency of the ith signal at the kth time slot.
Please note that MATLAB uses one-based indexing.
From the first flow chart, we can observe the following.
  1. Relative discrepancies are computed.
  2. Difference between relative discrepancies for every two signals ‘i', and ‘j’ at every time slot ‘k’ is calculated.
  3. For every pair of signals, the count of the number of time slots for which the relative difference falls with the threshold is maintained.
  4. If the count exceeds 2N/3, they are marked as spoofed signals.
The code for the first flow chart looks as follows:
function pair = spoofed(S, N, epsilon)
pair = [];
S_cap = abs(S(:, :) - S(:, 1));
for i = 1:N
for j = 1:N
Nij = 0;
for z = 1:N
diff = abs(S_cap(i, z) - S_cap(j, z));
if diff < epsilon
Nij = Nij + 1;
end
end
if Nij > (2 * N / 3)
disp('signal ' + num2str(i) + ' and signal ' + num2str(j) + ' are spoofed');
pair = [i, j];
end
end
end
end
In the second flow chart, we are computing the sum of squares of relative differences for every pair of signals at each time slot, and checking if the sum falls below the threshold. The code for the second flow chart looks as follows:
function pair = spoofed(S, N, epsilon)
S_cap = abs(S(:, :) - S(:, 1));
for i = 1:N
for j = 1:N
x = S_cap(i, :) - S_cap(j, :);
Eij = sum(x.*x);
if Eij < epsilon
disp('signal ' + num2str(i) + ' and signal ' + num2str(j) + ' are spoofed');
pair = [i, j];
end
end
end
end
I hope this answer helps!

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by