【雷達通訊】基於Matlab GUI中重頻PD雷達模擬系統【含Matlab原始碼 1055期】
阿新 • • 發佈:2021-06-25
一、簡介
二、原始碼
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格式的圖片。
三、執行結果
四、備註
版本:2014a
完整程式碼或代寫加1564658423