www.pudn.com > radarsignalprocessing.zip > radar_signal_detection.html, change:2013-11-05,size:42824b



<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
      <!--
This HTML is auto-generated from an M-file.
To make changes, update the M-file and republish this document.
      -->
      <title>radar_signal_detection</title>
      <meta name="generator" content="MATLAB 7.8">
      <meta name="date" content="2013-11-05">
      <meta name="m-file" content="radar_signal_detection"><style type="text/css">

body {
  background-color: white;
  margin:10px;
}

h1 {
  color: #990000; 
  font-size: x-large;
}

h2 {
  color: #990000;
  font-size: medium;
}

/* Make the text shrink to fit narrow windows, but not stretch too far in 
wide windows. */ 
p,h1,h2,div.content div {
  max-width: 600px;
  /* Hack for IE6 */
  width: auto !important; width: 600px;
}

pre.codeinput {
  background: #EEEEEE;
  padding: 10px;
}
@media print {
  pre.codeinput {word-wrap:break-word; width:100%;}
} 

span.keyword {color: #0000FF}
span.comment {color: #228B22}
span.string {color: #A020F0}
span.untermstring {color: #B20000}
span.syscmd {color: #B28C00}

pre.codeoutput {
  color: #666666;
  padding: 10px;
}

pre.error {
  color: red;
}

p.footer {
  text-align: right;
  font-size: xx-small;
  font-weight: lighter;
  font-style: italic;
  color: gray;
}

  </style></head>
   <body>
      <div class="content">
         <h2>Contents</h2>
         <div>
            <ul>
               <li><a href="#1">雷达信号检测与判决算法仿真实例</a></li>
               <li><a href="#2">动目标</a></li>
               <li><a href="#3">杂波</a></li>
               <li><a href="#4">动目标与杂波的混合信号</a></li>
               <li><a href="#5">MTI杂波抑制(三脉冲对消处理)</a></li>
               <li><a href="#6">脉冲多普勒处理(多普勒谱分析,也可理解为MTD多通道滤波处理,对每个样本点进行谱分析相当于数据块通过一个多通道的MTD滤波器组)</a></li>
               <li><a href="#7">自适应门限检测(单元平均CFAR处理)</a></li>
            </ul>
         </div>
         <h2>雷达信号检测与判决算法仿真实例<a name="1"></a></h2><pre class="codeinput">clear <span class="string">all</span>;
close <span class="string">all</span>;
clc;
</pre><h2>动目标<a name="2"></a></h2><pre class="codeinput">fr = 1e3;                                                                  <span class="comment">% 脉冲重复频率(Hz)</span>
tr = 1 / fr;                                                               <span class="comment">% 脉冲重复间隔(s)</span>
fs = 1e6;                                                                  <span class="comment">% 快时间维采样频率(Hz)(大于等于发射脉冲带宽,发射脉冲带宽几乎总是小于等于载波频率的10%,通常为载波频率的1%)</span>
ts = 1 / fs;                                                               <span class="comment">% 快时间维采样间隔(s)</span>
fc = 100e6;                                                                <span class="comment">% 载波频率(Hz)</span>
vr = 100;                                                                  <span class="comment">% 动目标相对雷达的径向速度(m/s)</span>
c = 3e8;                                                                   <span class="comment">% 电磁波速(m/s)</span>
lamada = c / fc;                                                           <span class="comment">% 载波波长(m)</span>
fd = 2 * vr / lamada;                                                      <span class="comment">% 动目标多普勒频率(Hz)(或多普勒移动,即发射频率与接收频率之差)</span>
M = fs / fr;                                                               <span class="comment">% 1个脉冲重复间隔内的采样点数(快时间维的距离点数)</span>
M10 = 10 * M;                                                              <span class="comment">% 10个脉冲重复间隔内的采样点数</span>

m = 1 : M10;
target = 20 * exp(j * (2 * m * pi * fd / fr));                             <span class="comment">% 动目标回波</span>

figure(1);
subplot(211);
plot(real(target));
title(<span class="string">'动目标——实部'</span>);
xlabel(<span class="string">'距离点'</span>);
grid <span class="string">on</span>;
subplot(212);
plot(imag(target));
title(<span class="string">'动目标——虚部'</span>);
xlabel(<span class="string">'距离点'</span>);
grid <span class="string">on</span>;
f1 = linspace(0, fr, length(target));
figure(2);
plot(f1, abs(fft(target)));
title(<span class="string">'动目标幅频特性'</span>);
xlabel(<span class="string">'频率(Hz)'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
</pre><img vspace="5" hspace="5" src="radar_signal_detection_01.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_02.png" alt=""> <h2>杂波<a name="3"></a></h2><pre class="codeinput">randn(<span class="string">'state'</span>, sum(100 * clock));
clutteri = 5 * randn(1, length(target));
randn(<span class="string">'state'</span>, sum(10 * clock));
clutterq = 5 * randn(1, length(target));
clutter = clutteri + j * clutterq;                                         <span class="comment">% 杂波</span>

figure(3);
subplot(211);
plot(real(clutter));
title(<span class="string">'杂波——实部'</span>);
xlabel(<span class="string">'距离点'</span>);
grid <span class="string">on</span>;
subplot(212);
plot(imag(clutter));
title(<span class="string">'杂波——虚部'</span>);
xlabel(<span class="string">'距离点'</span>);
grid <span class="string">on</span>;
f2 = linspace(0, fr, length(clutter));
figure(4);
plot(f2, abs(fft(clutter)));
title(<span class="string">'杂波幅频特性'</span>);
xlabel(<span class="string">'频率(Hz)'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
</pre><img vspace="5" hspace="5" src="radar_signal_detection_03.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_04.png" alt=""> <h2>动目标与杂波的混合信号<a name="4"></a></h2><pre class="codeinput">s = target + clutter;                                                      <span class="comment">% 动目标与杂波的混合信号</span>

figure(5);
subplot(211);
plot(real(s));
title(<span class="string">'动目标与杂波的混合信号——实部'</span>);
xlabel(<span class="string">'距离点'</span>);
grid <span class="string">on</span>;
subplot(212);
plot(imag(s));
title(<span class="string">'动目标与杂波的混合信号——虚部'</span>);
xlabel(<span class="string">'距离点'</span>);
grid <span class="string">on</span>;
f3 = linspace(0, fr, length(s));
figure(6);
plot(f3, abs(fft(s)));
title(<span class="string">'混合信号幅频特性'</span>);
xlabel(<span class="string">'频率(Hz)'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
</pre><img vspace="5" hspace="5" src="radar_signal_detection_05.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_06.png" alt=""> <h2>MTI杂波抑制(三脉冲对消处理)<a name="5"></a></h2><pre class="codeinput"><span class="comment">%————————————————对消运算—————————————————</span>
x = ones(1, 4);                                                            <span class="comment">% 动目标所在的距离点</span>
n = length(x);
points1 = [zeros(1, 300), x, zeros(1, M - 300 - n)];                       <span class="comment">% 1个脉冲重复间隔内M个距离点(区分动目标所在的距离点301、302、303、304和杂波所在距离点)</span>
points10 = repmat(points1, 1, 10);                                         <span class="comment">% 10个脉冲重复间隔内10*M个距离点</span>

s2 = points10 .* target + clutter;                                         <span class="comment">% 动目标与杂波的混合信号(确定动目标所在的距离点301、302、303、304,并为单元平均CFAR检测的假设提供前提,即动目标单纯占据4个距离点,其余距离点为杂波)</span>

mti_in = reshape(s2, length(s2) / 10, 10)';                                <span class="comment">% 形成由10个脉冲组成的二维数据矩阵(慢时间维10个脉冲,快时间维1000个距离点)</span>
<span class="keyword">for</span> t = 1 : 8
    mti_out(t, :) = mti_in(t, :) - 2 * mti_in(t + 1, :) + mti_in(t + 2, :);<span class="comment">% 三脉冲对消运算(同一距离点在3个相邻脉冲重复间隔内的数据做相减运算)</span>
<span class="keyword">end</span>

<span class="comment">%———————————二脉冲与三脉冲对消器的频率响应———————————</span>
f4 = -3 * fr : 0.01 : 3 * fr;
H2 = 1 - exp(-1 * j * 2 * pi * f4 / fr);                                   <span class="comment">% 二脉冲对消器的频率响应</span>
H3 = 1 - 2 * exp(-1 * j * 2 * pi * f4 / fr) + exp(-2 * j * 2 * pi * f4 / fr);  <span class="comment">% 三脉冲对消器的频率响应</span>

figure(7);
plot(f4, abs(H2), <span class="string">'b'</span>, f4, abs(H3), <span class="string">'r'</span>);
title(<span class="string">'二脉冲和三脉冲对消器的幅频特性'</span>);
xlabel(<span class="string">'频率(Hz)'</span>);
ylabel(<span class="string">'频响幅度'</span>);
legend(<span class="string">'二脉冲'</span>, <span class="string">'三脉冲'</span>);
grid <span class="string">on</span>;
figure(8);
plot(f4, 20 * log10(abs(H2)), <span class="string">'b'</span>, f4, 20 * log10(abs(H3)), <span class="string">'r'</span>);
title(<span class="string">'二脉冲和三脉冲对消器的幅频特性'</span>);
xlabel(<span class="string">'频率(Hz)'</span>);
ylabel(<span class="string">'频响幅度/dB'</span>);
legend(<span class="string">'二脉冲'</span>, <span class="string">'三脉冲'</span>);
grid <span class="string">on</span>;

<span class="comment">%————————————显示三脉冲对消杂波抑制效果————————————</span>
b = [1, -2, 1];                                                            <span class="comment">% 三脉冲对消器系统函数分子多项式系数向量</span>
a = [1];                                                                   <span class="comment">% 三脉冲对消器系统函数分母多项式系数向量</span>
y = filter(b, a, s);                                                       <span class="comment">% 混合信号s经过三脉冲对消器输出信号y</span>

f5 = linspace(0, fr, length(y));
figure(9);
plot(f5, abs(fft(y)));
title(<span class="string">'三脉冲对消器输出信号幅频特性'</span>);
xlabel(<span class="string">'频率(Hz)'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
</pre><img vspace="5" hspace="5" src="radar_signal_detection_07.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_08.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_09.png" alt=""> <h2>脉冲多普勒处理(多普勒谱分析,也可理解为MTD多通道滤波处理,对每个样本点进行谱分析相当于数据块通过一个多通道的MTD滤波器组)<a name="6"></a></h2><pre class="codeinput">K = 8;                                                                     <span class="comment">% FFT采样点数即MTD滤波器组滤波器个数</span>
<span class="keyword">for</span> m = 1 : M
    mtd_out(:, m) = fft(mti_out(:, m) .* hamming(K), K);                   <span class="comment">% 对同一距离点不同脉冲重复间隔的数据做K点FFT加窗运算</span>
<span class="keyword">end</span>
p = 1 : 1 : M;                                                             <span class="comment">% 距离点</span>

figure(10);
plot(p, abs(mtd_out(1, :)));
title(<span class="string">'脉冲多普勒处理第1通道结果'</span>);
xlabel(<span class="string">'距离点'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
figure(11);
plot(p, abs(mtd_out(2, :)));
title(<span class="string">'脉冲多普勒处理第2通道结果'</span>);
xlabel(<span class="string">'距离点'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
figure(12);
plot(p, abs(mtd_out(3, :)));
title(<span class="string">'脉冲多普勒处理第3通道结果'</span>);
xlabel(<span class="string">'距离点'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
figure(13);
plot(p, abs(mtd_out(4, :)));
title(<span class="string">'脉冲多普勒处理第4通道结果'</span>);
xlabel(<span class="string">'距离点'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
figure(14);
plot(p, abs(mtd_out(5, :)));
title(<span class="string">'脉冲多普勒处理第5通道结果'</span>);
xlabel(<span class="string">'距离点'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
figure(15);
plot(p, abs(mtd_out(6, :)));
title(<span class="string">'脉冲多普勒处理第6通道结果'</span>);
xlabel(<span class="string">'距离点'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
figure(16);
plot(p, abs(mtd_out(7, :)));
title(<span class="string">'脉冲多普勒处理第7通道结果'</span>);
xlabel(<span class="string">'距离点'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
figure(17);
plot(p, abs(mtd_out(8, :)));
title(<span class="string">'脉冲多普勒处理第8通道结果'</span>);
xlabel(<span class="string">'距离点'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
</pre><img vspace="5" hspace="5" src="radar_signal_detection_10.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_11.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_12.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_13.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_14.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_15.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_16.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_17.png" alt=""> <h2>自适应门限检测(单元平均CFAR处理)<a name="7"></a></h2><pre class="codeinput">nr = 8;                                                                    <span class="comment">% 待检测距离点每侧的参考点数</span>
np = 3;                                                                    <span class="comment">% 待检测距离点每侧的保护点数</span>
Pfa = 10e-3;                                                               <span class="comment">% 虚警概率</span>
alafa = 2 * nr * (Pfa ^ (-1 / (2 * nr)) - 1);                              <span class="comment">% 门限因子</span>
temp = zeros(K, M);

<span class="keyword">for</span> u = 1 : 8                                                              <span class="comment">% 分别对每个多普勒采样点做检测判决</span>
    z = mtd_out(u, :);

    <span class="keyword">for</span> i = 1 : 1 + np                                                     <span class="comment">% 第i个待检测距离点</span>
        sum = 0;
        <span class="keyword">for</span> t = i + 1 + np : i + 1 + nr                                    <span class="comment">% 第t个参考距离点</span>
            sum = sum + (abs(z(t))) .^ 2;
        <span class="keyword">end</span>
        itfPower(i) = sum / nr;                                            <span class="comment">% 估计第i个待检测距离点的干扰功率</span>
    <span class="keyword">end</span>

    <span class="keyword">for</span> i = 1 + 1 + np : np + nr
        sum1 = 0;
        <span class="keyword">for</span> t = i * 2 - 1 : (i * 2 - 1) + nr - 1
            sum1 = sum1 + (abs(z(t))) .^ 2;                                <span class="comment">% 第i个待检测距离点的右侧参考距离点干扰功率估计</span>
        <span class="keyword">end</span>
        sum2 = 0;
        <span class="keyword">for</span> t = 1 : i - 1 - np
            sum2 = sum2 + (abs(z(t))) .^ 2;                                <span class="comment">% 第i个待检测距离点的左侧参考距离点干扰功率估计</span>
        <span class="keyword">end</span>
        itfPower(i) = (sum1 + sum2) / 2;
    <span class="keyword">end</span>

    <span class="keyword">for</span> i = 1 + np + nr : M - np - nr
        sum4 = 0;
        <span class="keyword">for</span> t = i + 1 + np : i + 1 + nr;
            sum4 = sum4 + (abs(z(t))) .^ 2;
        <span class="keyword">end</span>
        sum3 = 0;
        <span class="keyword">for</span> t = i - np - nr : i - 1 - np
            sum3 = sum3 + (abs(z(t))) .^ 2;
        <span class="keyword">end</span>
        itfPower(i) = (sum4 + sum3) / 2;
    <span class="keyword">end</span>

    <span class="keyword">for</span> i = M - nr - np + 1 : M - np - 1
        sum5 = 0;
        <span class="keyword">for</span> t = i + 1 + np : M
            sum5 = sum5 + (abs(z(t))) .^ 2;
        <span class="keyword">end</span>
        sum6 = 0;
        <span class="keyword">for</span> t = i - np - nr : i - 1 - np
            sum6 = sum6 + (abs(z(t))) .^ 2;
        <span class="keyword">end</span>
        itfPower(i) = (sum5 + sum6) / 2;
    <span class="keyword">end</span>

    <span class="keyword">for</span> i = M - np : M
        sum7 = 0;
        <span class="keyword">for</span> t = i - nr - np : i - 1 - nr;
            sum7 = sum7 + (abs(z(t))) .^ 2;
        <span class="keyword">end</span>
        itfPower(i) = sum7 / nr;
    <span class="keyword">end</span>

    s_cfar = zeros(1, M);

    <span class="keyword">for</span> i = 1 : M
        T(i) = alafa * itfPower(i);                                        <span class="comment">% 第i个距离点的检测门限</span>
        <span class="keyword">if</span> (abs(z(i))) .^ 2 > T(i)                                         <span class="comment">% 判断第i个距离点的信号功率是否高于其检测门限</span>
            s_cfar(i) = z(i);                                              <span class="comment">% 若高于检测门限,判决该距离点存在动目标,将其输出</span>
        <span class="keyword">end</span>
    <span class="keyword">end</span>

    temp(u, :) = s_cfar;                                                   <span class="comment">% 将每个多普勒采样点的判决结果存储在临时矩阵中</span>

    figure(18);
    subplot(2, 4, u);
    plot(p, 10 * log10((abs(z)) .^ 2), <span class="string">'r'</span>, p, 10 * log10(T), <span class="string">'g'</span>);
    legend(<span class="string">'混合信号'</span>, <span class="string">'检测门限'</span>, 4);
    xlabel(<span class="string">'距离点'</span>);
    ylabel(<span class="string">'功率/dB'</span>);
    grid <span class="string">on</span>;
    figure(19);
    subplot(2, 4, u);
    plot(p, abs(s_cfar));
    xlabel(<span class="string">'距离点'</span>);
    ylabel(<span class="string">'幅度'</span>);
    grid <span class="string">on</span>;
<span class="keyword">end</span>

figure(18);
subplot(241);
title(<span class="string">'CA CFAR 第1通道混合信号与检测门限'</span>);
subplot(242);
title(<span class="string">'CA CFAR 第2通道混合信号与检测门限'</span>);
subplot(243);
title(<span class="string">'CA CFAR 第3通道混合信号与检测门限'</span>);
subplot(244);
title(<span class="string">'CA CFAR 第4通道混合信号与检测门限'</span>);
subplot(245);
title(<span class="string">'CA CFAR 第5通道混合信号与检测门限'</span>);
subplot(246);
title(<span class="string">'CA CFAR 第6通道混合信号与检测门限'</span>);
subplot(247);
title(<span class="string">'CA CFAR 第7通道混合信号与检测门限'</span>);
subplot(248);
title(<span class="string">'CA CFAR 第8通道混合信号与检测门限'</span>);
figure(19);
subplot(241);
title(<span class="string">'CA CFAR 第1通道检测判决结果'</span>);
subplot(242);
title(<span class="string">'CA CFAR 第2通道检测判决结果'</span>);
subplot(243);
title(<span class="string">'CA CFAR 第3通道检测判决结果'</span>);
subplot(244);
title(<span class="string">'CA CFAR 第4通道检测判决结果'</span>);
subplot(245);
title(<span class="string">'CA CFAR 第5通道检测判决结果'</span>);
subplot(246);
title(<span class="string">'CA CFAR 第6通道检测判决结果'</span>);
subplot(247);
title(<span class="string">'CA CFAR 第7通道检测判决结果'</span>);
subplot(248);
title(<span class="string">'CA CFAR 第8通道检测判决结果'</span>);

target_cfar = zeros(1, M);
<span class="keyword">for</span> i = 1 : M
    target_cfar(:, i) = max(temp(:, i));                                   <span class="comment">% 每个距离点取8个通道中的最大值作为动目标信号的最终判决结果</span>
<span class="keyword">end</span>

figure(20);
plot(p, abs(target_cfar));
title(<span class="string">'CA CFAR 8通道合成检测结果——动目标信号'</span>);
xlabel(<span class="string">'距离点'</span>);
ylabel(<span class="string">'幅度'</span>);
grid <span class="string">on</span>;
</pre><img vspace="5" hspace="5" src="radar_signal_detection_18.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_19.png" alt=""> <img vspace="5" hspace="5" src="radar_signal_detection_20.png" alt=""> <p class="footer"><br>
            Published with MATLAB® 7.8<br></p>
      </div>
      <!--
##### SOURCE BEGIN #####
%% 雷达信号检测与判决算法仿真实例 
 
clear all; 
close all; 
clc; 
 
%% 动目标 
 
fr = 1e3;                                                                  % 脉冲重复频率(Hz) 
tr = 1 / fr;                                                               % 脉冲重复间隔(s) 
fs = 1e6;                                                                  % 快时间维采样频率(Hz)(大于等于发射脉冲带宽,发射脉冲带宽几乎总是小于等于载波频率的10%,通常为载波频率的1%) 
ts = 1 / fs;                                                               % 快时间维采样间隔(s) 
fc = 100e6;                                                                % 载波频率(Hz) 
vr = 100;                                                                  % 动目标相对雷达的径向速度(m/s)                           
c = 3e8;                                                                   % 电磁波速(m/s)                                          
lamada = c / fc;                                                           % 载波波长(m) 
fd = 2 * vr / lamada;                                                      % 动目标多普勒频率(Hz)(或多普勒移动,即发射频率与接收频率之差) 
M = fs / fr;                                                               % 1个脉冲重复间隔内的采样点数(快时间维的距离点数) 
M10 = 10 * M;                                                              % 10个脉冲重复间隔内的采样点数 
 
m = 1 : M10; 
target = 20 * exp(j * (2 * m * pi * fd / fr));                             % 动目标回波 
 
figure(1); 
subplot(211); 
plot(real(target)); 
title('动目标——实部'); 
xlabel('距离点'); 
grid on; 
subplot(212); 
plot(imag(target)); 
title('动目标——虚部'); 
xlabel('距离点'); 
grid on; 
f1 = linspace(0, fr, length(target)); 
figure(2); 
plot(f1, abs(fft(target))); 
title('动目标幅频特性'); 
xlabel('频率(Hz)'); 
ylabel('幅度'); 
grid on; 
 
%% 杂波 
 
randn('state', sum(100 * clock)); 
clutteri = 5 * randn(1, length(target)); 
randn('state', sum(10 * clock)); 
clutterq = 5 * randn(1, length(target)); 
clutter = clutteri + j * clutterq;                                         % 杂波 
 
figure(3); 
subplot(211); 
plot(real(clutter)); 
title('杂波——实部'); 
xlabel('距离点'); 
grid on; 
subplot(212); 
plot(imag(clutter)); 
title('杂波——虚部'); 
xlabel('距离点'); 
grid on; 
f2 = linspace(0, fr, length(clutter)); 
figure(4); 
plot(f2, abs(fft(clutter))); 
title('杂波幅频特性'); 
xlabel('频率(Hz)'); 
ylabel('幅度'); 
grid on; 
 
%% 动目标与杂波的混合信号 
 
s = target + clutter;                                                      % 动目标与杂波的混合信号 
 
figure(5); 
subplot(211); 
plot(real(s)); 
title('动目标与杂波的混合信号——实部'); 
xlabel('距离点'); 
grid on; 
subplot(212); 
plot(imag(s)); 
title('动目标与杂波的混合信号——虚部'); 
xlabel('距离点'); 
grid on; 
f3 = linspace(0, fr, length(s)); 
figure(6); 
plot(f3, abs(fft(s))); 
title('混合信号幅频特性'); 
xlabel('频率(Hz)'); 
ylabel('幅度'); 
grid on; 
 
%% MTI杂波抑制(三脉冲对消处理) 
 
%————————————————对消运算————————————————— 
x = ones(1, 4);                                                            % 动目标所在的距离点 
n = length(x); 
points1 = [zeros(1, 300), x, zeros(1, M - 300 - n)];                       % 1个脉冲重复间隔内M个距离点(区分动目标所在的距离点301、302、303、304和杂波所在距离点) 
points10 = repmat(points1, 1, 10);                                         % 10个脉冲重复间隔内10*M个距离点 
 
s2 = points10 .* target + clutter;                                         % 动目标与杂波的混合信号(确定动目标所在的距离点301、302、303、304,并为单元平均CFAR检测的假设提供前提,即动目标单纯占据4个距离点,其余距离点为杂波) 
 
mti_in = reshape(s2, length(s2) / 10, 10)';                                % 形成由10个脉冲组成的二维数据矩阵(慢时间维10个脉冲,快时间维1000个距离点) 
for t = 1 : 8 
    mti_out(t, :) = mti_in(t, :) - 2 * mti_in(t + 1, :) + mti_in(t + 2, :);% 三脉冲对消运算(同一距离点在3个相邻脉冲重复间隔内的数据做相减运算) 
end 
 
%———————————二脉冲与三脉冲对消器的频率响应——————————— 
f4 = -3 * fr : 0.01 : 3 * fr; 
H2 = 1 - exp(-1 * j * 2 * pi * f4 / fr);                                   % 二脉冲对消器的频率响应 
H3 = 1 - 2 * exp(-1 * j * 2 * pi * f4 / fr) + exp(-2 * j * 2 * pi * f4 / fr);  % 三脉冲对消器的频率响应 
 
figure(7); 
plot(f4, abs(H2), 'b', f4, abs(H3), 'r'); 
title('二脉冲和三脉冲对消器的幅频特性'); 
xlabel('频率(Hz)'); 
ylabel('频响幅度'); 
legend('二脉冲', '三脉冲'); 
grid on; 
figure(8); 
plot(f4, 20 * log10(abs(H2)), 'b', f4, 20 * log10(abs(H3)), 'r'); 
title('二脉冲和三脉冲对消器的幅频特性'); 
xlabel('频率(Hz)'); 
ylabel('频响幅度/dB'); 
legend('二脉冲', '三脉冲'); 
grid on; 
 
%————————————显示三脉冲对消杂波抑制效果———————————— 
b = [1, -2, 1];                                                            % 三脉冲对消器系统函数分子多项式系数向量 
a = [1];                                                                   % 三脉冲对消器系统函数分母多项式系数向量 
y = filter(b, a, s);                                                       % 混合信号s经过三脉冲对消器输出信号y 
 
f5 = linspace(0, fr, length(y)); 
figure(9); 
plot(f5, abs(fft(y))); 
title('三脉冲对消器输出信号幅频特性'); 
xlabel('频率(Hz)'); 
ylabel('幅度'); 
grid on; 
 
%% 脉冲多普勒处理(多普勒谱分析,也可理解为MTD多通道滤波处理,对每个样本点进行谱分析相当于数据块通过一个多通道的MTD滤波器组) 
 
K = 8;                                                                     % FFT采样点数即MTD滤波器组滤波器个数 
for m = 1 : M 
    mtd_out(:, m) = fft(mti_out(:, m) .* hamming(K), K);                   % 对同一距离点不同脉冲重复间隔的数据做K点FFT加窗运算 
end 
p = 1 : 1 : M;                                                             % 距离点 
 
figure(10); 
plot(p, abs(mtd_out(1, :))); 
title('脉冲多普勒处理第1通道结果'); 
xlabel('距离点'); 
ylabel('幅度'); 
grid on; 
figure(11); 
plot(p, abs(mtd_out(2, :))); 
title('脉冲多普勒处理第2通道结果'); 
xlabel('距离点'); 
ylabel('幅度'); 
grid on; 
figure(12); 
plot(p, abs(mtd_out(3, :))); 
title('脉冲多普勒处理第3通道结果'); 
xlabel('距离点'); 
ylabel('幅度'); 
grid on; 
figure(13); 
plot(p, abs(mtd_out(4, :))); 
title('脉冲多普勒处理第4通道结果'); 
xlabel('距离点'); 
ylabel('幅度'); 
grid on; 
figure(14); 
plot(p, abs(mtd_out(5, :))); 
title('脉冲多普勒处理第5通道结果'); 
xlabel('距离点'); 
ylabel('幅度'); 
grid on; 
figure(15); 
plot(p, abs(mtd_out(6, :))); 
title('脉冲多普勒处理第6通道结果'); 
xlabel('距离点'); 
ylabel('幅度'); 
grid on; 
figure(16); 
plot(p, abs(mtd_out(7, :))); 
title('脉冲多普勒处理第7通道结果'); 
xlabel('距离点'); 
ylabel('幅度'); 
grid on; 
figure(17); 
plot(p, abs(mtd_out(8, :))); 
title('脉冲多普勒处理第8通道结果'); 
xlabel('距离点'); 
ylabel('幅度'); 
grid on; 
 
%% 自适应门限检测(单元平均CFAR处理) 
 
nr = 8;                                                                    % 待检测距离点每侧的参考点数 
np = 3;                                                                    % 待检测距离点每侧的保护点数 
Pfa = 10e-3;                                                               % 虚警概率 
alafa = 2 * nr * (Pfa ^ (-1 / (2 * nr)) - 1);                              % 门限因子 
temp = zeros(K, M); 
 
for u = 1 : 8                                                              % 分别对每个多普勒采样点做检测判决 
    z = mtd_out(u, :); 
     
    for i = 1 : 1 + np                                                     % 第i个待检测距离点 
        sum = 0; 
        for t = i + 1 + np : i + 1 + nr                                    % 第t个参考距离点 
            sum = sum + (abs(z(t))) .^ 2;                                   
        end 
        itfPower(i) = sum / nr;                                            % 估计第i个待检测距离点的干扰功率 
    end 
     
    for i = 1 + 1 + np : np + nr 
        sum1 = 0; 
        for t = i * 2 - 1 : (i * 2 - 1) + nr - 1 
            sum1 = sum1 + (abs(z(t))) .^ 2;                                % 第i个待检测距离点的右侧参考距离点干扰功率估计 
        end 
        sum2 = 0; 
        for t = 1 : i - 1 - np 
            sum2 = sum2 + (abs(z(t))) .^ 2;                                % 第i个待检测距离点的左侧参考距离点干扰功率估计 
        end 
        itfPower(i) = (sum1 + sum2) / 2; 
    end 
     
    for i = 1 + np + nr : M - np - nr 
        sum4 = 0; 
        for t = i + 1 + np : i + 1 + nr; 
            sum4 = sum4 + (abs(z(t))) .^ 2; 
        end 
        sum3 = 0; 
        for t = i - np - nr : i - 1 - np 
            sum3 = sum3 + (abs(z(t))) .^ 2; 
        end 
        itfPower(i) = (sum4 + sum3) / 2; 
    end 
     
    for i = M - nr - np + 1 : M - np - 1 
        sum5 = 0; 
        for t = i + 1 + np : M 
            sum5 = sum5 + (abs(z(t))) .^ 2; 
        end 
        sum6 = 0; 
        for t = i - np - nr : i - 1 - np 
            sum6 = sum6 + (abs(z(t))) .^ 2; 
        end 
        itfPower(i) = (sum5 + sum6) / 2; 
    end 
     
    for i = M - np : M 
        sum7 = 0; 
        for t = i - nr - np : i - 1 - nr; 
            sum7 = sum7 + (abs(z(t))) .^ 2; 
        end 
        itfPower(i) = sum7 / nr; 
    end 
     
    s_cfar = zeros(1, M); 
     
    for i = 1 : M                                                           
        T(i) = alafa * itfPower(i);                                        % 第i个距离点的检测门限 
        if (abs(z(i))) .^ 2 > T(i)                                         % 判断第i个距离点的信号功率是否高于其检测门限 
            s_cfar(i) = z(i);                                              % 若高于检测门限,判决该距离点存在动目标,将其输出 
        end 
    end 
     
    temp(u, :) = s_cfar;                                                   % 将每个多普勒采样点的判决结果存储在临时矩阵中 
     
    figure(18); 
    subplot(2, 4, u); 
    plot(p, 10 * log10((abs(z)) .^ 2), 'r', p, 10 * log10(T), 'g'); 
    legend('混合信号', '检测门限', 4); 
    xlabel('距离点'); 
    ylabel('功率/dB'); 
    grid on; 
    figure(19); 
    subplot(2, 4, u); 
    plot(p, abs(s_cfar)); 
    xlabel('距离点'); 
    ylabel('幅度'); 
    grid on; 
end 
 
figure(18); 
subplot(241); 
title('CA CFAR 第1通道混合信号与检测门限'); 
subplot(242); 
title('CA CFAR 第2通道混合信号与检测门限'); 
subplot(243); 
title('CA CFAR 第3通道混合信号与检测门限'); 
subplot(244); 
title('CA CFAR 第4通道混合信号与检测门限'); 
subplot(245); 
title('CA CFAR 第5通道混合信号与检测门限'); 
subplot(246); 
title('CA CFAR 第6通道混合信号与检测门限'); 
subplot(247); 
title('CA CFAR 第7通道混合信号与检测门限'); 
subplot(248); 
title('CA CFAR 第8通道混合信号与检测门限'); 
figure(19); 
subplot(241); 
title('CA CFAR 第1通道检测判决结果'); 
subplot(242); 
title('CA CFAR 第2通道检测判决结果'); 
subplot(243); 
title('CA CFAR 第3通道检测判决结果'); 
subplot(244); 
title('CA CFAR 第4通道检测判决结果'); 
subplot(245); 
title('CA CFAR 第5通道检测判决结果'); 
subplot(246); 
title('CA CFAR 第6通道检测判决结果'); 
subplot(247); 
title('CA CFAR 第7通道检测判决结果'); 
subplot(248); 
title('CA CFAR 第8通道检测判决结果'); 
 
target_cfar = zeros(1, M); 
for i = 1 : M 
    target_cfar(:, i) = max(temp(:, i));                                   % 每个距离点取8个通道中的最大值作为动目标信号的最终判决结果 
end 
 
figure(20); 
plot(p, abs(target_cfar)); 
title('CA CFAR 8通道合成检测结果——动目标信号'); 
xlabel('距离点'); 
ylabel('幅度'); 
grid on; 
 
 
 
     
     
 
 
 
 
 

##### SOURCE END #####
-->
   </body>
</html>