function [] = detection_function(fr, fd1, fd2, M, N, n_reference, n_protect, alpha)
% This function shows the radar signal processing in MTI, MTD and CFAR.
% MTI is 3-pulse canceller, and MTD is N-point FFT, and then the GOCACFAR
% shows the result.
% fr ----------------------------- PRF
% fd1 ---------------------------- doppler frequency of moving target1
% fd2 ---------------------------- doppler frequency of moving target2
% M ------------------------------ number of range point
% N ------------------------------ number of tr
% n_reference -------------------- number of CFAR reference unit
% n_protect -------------------- number of CFAR protect unit
% alpha -------------------------- CFAR threshold factor
if nargin ~= 8
error('The number of input argument should be 8.');
end
%------------------------------参数设置------------------------------------------------------------------------------------------------------
fr = 200; % PRI(Hz)
tr = 1 / fr; % 导前周期,即脉冲重复周期(s)
fd1 = 90; % 动目标1的多普勒频移(Hz)
fd2 = 140; % 动目标2的多普勒频移(Hz)
M = 6700; % 回波信号的距离点数
N = 10; % 导前周期数
n_reference = 11; % CFAR待检单元每侧的参考单元数
n_protect = 2; % CFAR待检单元每侧的保护单元数
alpha = 2.9; % CFAR门限因子
%-----------------------------生成N个导前周期,每个导前周期含M个距离点的复数据,其中只包含动目标,无杂波------------------------------------------
for m = 1 : N
moving_target1(m) = 10 * exp(j * 2 * m * pi * fd1 * tr); % 第m个导前周期,动目标1在某距离点内的复数据
moving_target2(m) = 10 * exp(j * 2 * m * pi * fd2 * tr); % 第m个导前周期,动目标2在某距离点内的复数据
end
x = ones(1, 3); % 每个动目标占据三个距离点
n = length(x);
for m = 1 : N
sequence(m, :) = [[zeros(1, 1700), x, zeros(1, 3400 - 1700 - n)] * moving_target1(m), [zeros(1, 1600), x, zeros(1, M - 3400 - 1600 - n)] * moving_target2(m)];
% 第m个导前周期,令动目标1占据1701、1702和1703三个距离点,令动目标2占据第5001、5002和5003三个距离点
end
%------------------------------生成杂波,并将其加入到各个周期的数据序列,形成回波混合信号--------------------------------------------------------
for m = 1 : N
clutter_i(m, :) = randn(1, M);
clutter_q(m, :) = randn(1, M);
clutter(m, :) = 0.5 * (clutter_i(m, :) + j * clutter_q(m, :)); % 杂波
end
for m = 1 : N
mix_signal(m, :) = sequence(m, :) + clutter(m, :); % 生成混合信号
end
%------------------------------三脉冲对消(MTI)----------------------------------------------------------------------------------------------
for m = 1 : N - 2
mti(m, :) = mix_signal(m, :) - 2 * mix_signal(m + 1, :) + mix_signal(m + 2, :); % 三脉冲对消运算
end
%------------------------------FFT运算(MTD)------------------------------------------------------------------------------------------------
for n = 1 : M
mtd(:, n) = fft(mti(:, n) .* hamming(N - 2, 'periodic'), N - 2); % N-2点FFT运算
end
mtd_amplitude = abs(mtd); % MTD各通道直接输出模值
set(0, 'defaultfigurecolor', 'w');
for m = 1 : N - 2
figure(m + 5);
plot(mtd_amplitude(m, :), 'r');
grid on;
xlim([0, M]);
xlabel('距离点');
title(['MTD第 ' num2str(m - 1) ' 通道输出结果']);
end
%-----------GOCA CFAR---------------------------------------------------------------------------------------------------
for m = 1 : N - 2 % 分别对MTD N-2个通道内的距离点做过门限检测
z = mtd_amplitude(m, :);
for n = 1 : 1 + n_protect % 待检单元
b2(n) = mean(z(n + 1 + n_protect : n + n_protect + n_reference)); % 待检单元右侧的参考窗求均值
d(n) = b2(n);
end
for n = 1 + n_protect + 1 : n_reference + n_protect + 1
b1(n) = mean(z(1 : n - 1 - n_protect)); % 待检单元左侧的参考窗求均值
b2(n) = mean(z(n + 1 + n_protect : n + n_protect + n_reference));
d(n) = max(b1(n), b2(n)); % 两侧参考窗均值选大
end
for n = 1 + n_reference + n_protect + 1 : M - n_reference - n_protect
b1(n) = mean(z(n - n_protect - n_reference : n - 1 - n_protect));
b2(n) = mean(z(n + 1 + n_protect : M));
d(n) = max(b1(n), b2(n));
end
for n = M - n_reference - n_protect + 1 : M
b1(n) = mean(z(n - n_protect - n_reference : n - 1 - n_protect));
b2(n) = mean(z(n + 1 + n_protect : M));
d(n) = max(b1(n), b2(n));
end
s_cfar = zeros(1, M);
for n = 1 : M
T(n) = alpha * d(n); % 第n个距离点的检测门限
if z(n) > T(n) % 过门限
s_cfar(n) = z(n) - T(n); % 将该距离点的数据置为差值
end
end
temp(m, :) = s_cfar; % 存储各个通道的检测结果
figure(m + 40);
plot(z, 'r');
hold on;
plot(T, 'g');
xlabel('距离点');
grid on;
xlim([0, M]);
title(['MTD第 ' num2str(m - 1) ' 通道的门限设定']);
legend('混合信号', '门限');
figure(m + 80);
hold off;
plot(s_cfar, 'r');
xlabel('距离点');
grid on ;
xlim([0, M]);
title(['MTD第 ' num2str(m - 1) ' 通道检测结果']);
end
for n = 1 : M
cfar(:, n) = max(temp(:, n)); % 取N-2个通道中的最大值作为该距离点的检测结果
end
figure(115);
plot(cfar, 'r');
title('GOCA CFAR检测结果');
xlabel('距离点');
xlim([0, M]);
grid on ;
没有合适的资源?快使用搜索试试~ 我知道了~
基于MATLAB实现的雷达信号检测+使用说明文档.rar
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共3个文件
m:2个
md:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 98 浏览量
2024-05-23
15:03:49
上传
评论
收藏 8KB RAR 举报
温馨提示
CSDN IT狂飙上传的代码均可运行,功能ok的情况下才上传的,直接替换数据即可使用,小白也能轻松上手 【资源说明】 基于MATLAB实现的雷达信号检测+使用说明文档.rar 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2020b;若运行有误,根据提示GPT修改;若不会,私信博主(问题描述要详细); 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可后台私信博主; 4.1 期刊或参考文献复现 4.2 Matlab程序定制 4.3 科研合作 功率谱估计: 故障诊断分析: 雷达通信:雷达LFM、MIMO、成像、定位、干扰、检测、信号分析、脉冲压缩 滤波估计:SOC估计 目标定位:WSN定位、滤波跟踪、目标定位 生物电信号:肌电信号EMG、脑电信号EEG、心电信号ECG 通信系统:DOA估计、编码译码、变分模态分解、管道泄漏、滤波器、数字信号处理+传输+分析+去噪、数字信号调制、误码率、信号估计、DTMF、信号检测识别融合、LEACH协议、信号检测、水声通信 5、欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 3 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
IT狂飙
- 粉丝: 4778
- 资源: 2640
![benefits](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-1.c8e153b4.png)
下载权益
![privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-2.ec46750a.png)
C知道特权
![article](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-3.fc5e5fb6.png)
VIP文章
![course-privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-4.320a6894.png)
课程特权
![rights](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-icon.fe0226a8.png)
开通VIP
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)