clc;
clear;
close all;
warning off;
addpath(genpath(pwd));
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 1500; % Length of signal
t = (0:L-1)*T; % Time vector
% Form a signal containing a 50 Hz sinusoid of amplitude 0.7 and a 120 Hz
% sinusoid of amplitude 1.
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
% Corrupt the signal with zero-mean white noise with a variance of 4
X = S + 2*randn(size(t));
X_cfar = abs(X);
% Data_points
Ns = 1500; % let it be the same as the length of the signal
% Targets location. Assigning bin 100, 200, 300, and 700 as Targets
% with the amplitudes of 16, 18, 27, 22.
X_cfar([100 ,200, 300, 700])=[16 18 27 22];
% plot the output
figure(1);
tiledlayout(2,1)
nexttile
plot(X_cfar)
% Apply CFAR to detect the targets by filtering the noise.
% TODO: Define the number of Training Cells
T = 12;
% TODO: Define the number of Guard Cells
G = 4;
% TODO: Define Offset (Adding room above noise threshold for the desired SNR)
offset = 5;
% Initialize vector to hold threshold values
threshold_cfar = zeros(Ns-(G+T+1),1);
% Initialize Vector to hold final signal after thresholding
signal_cfar = zeros(Ns-(G+T+1),1);
% Slide window across the signal length
for i = 1:(Ns-(G+T+1))
% TODO: Determine the noise threshold by measuring it within
% the training cells
noise_level = sum(X_cfar(i:i+T-1));
% TODO: scale the noise_level by appropriate offset value and take
% average over T training cells
threshold = (noise_level/T)*offset;
% Add threshold value to the threshold_cfar vector
threshold_cfar(i) = threshold;
% TODO: Measure the signal within the CUT
signal = X_cfar(i+T+G);
% add signal value to the signal_cfar vector
signal_cfar(i) = signal;
end
% plot the filtered signal
plot(signal_cfar);
legend('Signal')
% plot original sig, threshold and filtered signal within the same figure.
nexttile
plot(X_cfar);
hold on
plot(circshift(threshold_cfar,G),'r--','LineWidth',2)
hold on
plot (circshift(signal_cfar,(T+G)),'g--','LineWidth',2);
legend('Signal','CFAR Threshold','detection')
没有合适的资源?快使用搜索试试~ 我知道了~
基于matlab的一维CA-CFAR算法实现恒虚警
共2个文件
m:1个
avi:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 14 浏览量
2022-10-15
02:05:45
上传
评论 2
收藏 398KB RAR 举报
温馨提示
1.版本:matlab2021a,我录制了仿真操作录像,可以跟着操作出仿真结果 2.领域:CA-CFAR恒虚警 3.内容:基于matlab的一维CA-CFAR算法实现恒虚警 4.适合人群:本,硕等教研学习使用
资源推荐
资源详情
资源评论
收起资源包目录
基于matlab的一维CA-CFAR算法实现恒虚警.rar (2个子文件)
基于matlab的一维CA-CFAR算法实现恒虚警
操作录像0031.avi 2.29MB
Runme_CA_CFAR.m 2KB
共 2 条
- 1
资源评论
- shoidinger2023-03-24发现一个宝藏资源,赶紧冲冲冲!支持大佬~
fpga和matlab
- 粉丝: 17w+
- 资源: 2637
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功