一、简介

【雷达通信】matlab模拟中重频PD雷达仿真系统_代码
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_02
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_03

二、源代码

function varargout = fig(varargin)
% 
% 
% 完成时间:2021.02.19
% FIG MATLAB code for fig.fig
%      FIG, by itself, creates a new FIG or raises the existing
%      singleton*.
%
%      H = FIG returns the handle to a new FIG or the handle to
%      the existing singleton*.
%
%      FIG('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in FIG.M with the given input arguments.
%
%      FIG('Property','Value',...) creates a new FIG or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before fig_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to fig_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help fig

% Last Modified by GUIDE v2.5 19-Feb-2021 08:14:13

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @fig_OpeningFcn, ...
                   'gui_OutputFcn',  @fig_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before fig is made visible.
function fig_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to fig (see VARARGIN)

% Choose default command line output for fig
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes fig wait for user response (see UIRESUME)
% uiwait(handles.figure1);

%设置背景图片
ha=axes('units','normalized','position',[0 0 1 1]); 
uistack(ha,'down') 
II=imread('radar.jpg'); 
image(II) 
colormap gray 
set(ha,'handlevisibility','off','visible','off'); 



% --- Outputs from this function are returned to the command line.
function varargout = fig_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;





% 
% --- Executes on button press in startbutton.
function startbutton_Callback(hObject, eventdata, handles)
% hObject    handle to startbutton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)




% clear all
% clc
% close all

%获取发射功率
Pt=str2double(get(handles.Ptinput,'String'));

%获取中心频率
Fc=str2double(get(handles.Fcinput,'String'))*1e6;

%获取脉冲宽度
Tp=str2double(get(handles.Tpinput,'String'))*1e-6;

%获取脉冲重复频率
Fr=1e3*[str2double(get(handles.Frinput1,'String')) str2double(get(handles.Frinput2,'String')) str2double(get(handles.Frinput3,'String'))];

%获取带宽
B=1e6*str2double(get(handles.Binput,'String'));



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%    雷达系统仿真参数    %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c=3e8;                           % 光速
k=1.38e-23;                      % 玻尔兹曼常数

% Pt=20e3;                         % 发射功率【W】

% Fc=1e9;                          % 中心频率【Hz】
Wavelength=c/Fc;                 % 工作波长【m】

% Tp=8e-6;                        % 脉冲宽度【微秒】
% Fr=[8e3 11e3 13e3];                         % 脉冲重复频率【Hz】

% B=10e6;                           % 带宽【Hz】
Fs=20e6;                         % 采样率【Hz】
F=10^(6.99/10);                     % 噪声系数
K=B/Tp;                          % 调频率【Hz】
Tr=1./Fr;% 脉冲重复周期【秒】
R_T=Tr*c/2;%最大模糊距离

Delta_t=1/Fs;                    % 时域采样点时间间隔【秒】
vv=Fr*Wavelength/2;  %最大模糊速度
D=5;                             % 天线孔径【m】
Ae=1*pi*(D/2)^2;                 % 天线有效面积【m^2】
% G=4*pi*Ae/Wavelength^2;          % 天线增益
G=10^(32/10);
BeamWidth=0.88*Wavelength/D;     % 天线3dB波束宽度【deg】
BeamShift=0.8*BeamWidth/2;         % A、B波束与天线轴向的夹角【deg】
Theta0=30*pi/180;                % 波束主瓣初始指向【度】
Wa=0;2*pi/1;                       % 天线波束转速【rad/sec】

Num_Tr_CPI=64;                      % CPI周期数


R_set=[70e3,7e3,10e3];          % 目标距离【m】         
RCS=[1,1,1];                 % 目标平均后向散射截面积【m^2】   
Theta_target_set=30.1*pi/180; % 目标方位角【deg】
V_set=[2100,1000,900];                % 目标速度【m/s】 

for a=1:length(Fr)
    
   R_A(a)=mod(R_set(1),R_T(a));%判断是否出现模糊
end
for a=1:length(Fr)
    
   v_A(a)=mod(V_set(1),vv(a));
end    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%      产生发射信号     %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
s=lfm(Pt,Tp,Fr,B,Fs,G,Num_Tr_CPI);

figure
s_plot(s);
title('雷达发射信号')
xlabel('time [sec]')
ylabel('magnitude [v]')
print(gcf,'-dbitmap','雷达发射信号.bmp')   % 保存为png格式的图片。


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%      目标回波     %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[s_A s_B] = target(G,Fc,Fs,Fr,Num_Tr_CPI,Theta0,Wa,BeamWidth,s,R_set,V_set,RCS,Theta_target_set);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%      仿真热噪声     %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[s_A s_B] = nose(s_A,s_B,k,B,F);

figure
subplot(2,1,1)
s_plot(s_A);
title('A通道回波信号')
xlabel('time [sec]')
ylabel('magnitude [v]')

subplot(2,1,2)
s_plot(s_B);
title('B通道回波信号')
xlabel('time [sec]')
ylabel('magnitude [v]')

print(gcf,'-dbitmap','雷达回波信号.bmp')   % 保存为png格式的图片。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%      和差波束调制    %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[s_Sigma s_Delta] =sigma_delta(s_A,s_B);


figure
subplot(2,1,1)
s_plot(s_Sigma);
title('和通道回波信号')
xlabel('time [sec]')
ylabel('magnitude [v]')

subplot(2,1,2)
s_plot(s_Delta);
title('差通道回波信号')
xlabel('time [sec]')
ylabel('magnitude [v]')
print(gcf,'-dbitmap','和差调制回波信号.bmp')   % 保存为png格式的图片。



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%  匹配滤波(脉冲压缩)  %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%]
[s_Sigma_rc s_Delta_rc] = match(s_Sigma,s_Delta,Tr,Fs,K,Num_Tr_CPI);

figure
s_plot(s_Sigma_rc);
title('和通道匹配滤波结果')
xlabel('time [sec]')
ylabel('magnitude [v]')


print(gcf,'-dbitmap','匹配滤波结果.bmp')   % 保存为png格式的图片。



三、运行结果

【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_04
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_05
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_06
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_07
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_06
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_09
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_07
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_11
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_12
【雷达通信】matlab模拟中重频PD雷达仿真系统_代码_13