⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 radar_design.m

📁 这个是设计满足一定载频
💻 M
字号:
function  [r,radar,tt]=radar_design(categories_pulse,TM)
%    This function uses the categories and TM that the users specified to creat 
%    a matrix of three by num_pulses which contains the data of radar parameters. 
%
% The input parameters are as follows:
%    The Categories is the number of the radar pulse types, TM is the length of
%    The Time that the ESM intercepts the radar pulses, whose unit is ms.
% The output parameters are as follows:
%    The r is the number of pulse 
%    The radar is a matrix, which contains the data of radar parameters
%    The tt is the lable of categories
%    
% Initialization of the parameters
% categories_pulse=5;          %  the categories of radar pulses
% TM=10;                       %  截取脉冲时间段长度 单位为 ms
T=zeros(categories_pulse,100000);
% tic;                      
PRI=unifrnd(0.1,1,1,categories_pulse);      %均匀产生 categories_pulse 种脉冲到达时间间隔 PRI
PW=unifrnd(0.1,10,1,categories_pulse);      %均匀产生 categories_pulse 种脉冲宽度 PW
RF=unifrnd(1,2,1,categories_pulse);         %均匀产生 categories_pulse 种载频数据 RF

%Set up the time sequence
T0=rand(1)*PRI(unidrnd(categories_pulse));            % specify the initial time

%Specify the initial time
T(:,1)=T0;
K=zeros(1,categories_pulse);    % 记录每种类型雷达的脉冲数目
for j=1:categories_pulse        % 以每一类脉冲为一行,构建TM时间内的脉冲到达时间矩阵 
    i=1;
     while T(j,i)<=TM
          i=i+1;
          T(j,i)=T0+(K(j)+1)*PRI(j);   %计算一类脉冲的相继到达时间
          K(j)=K(j)+1;
     end
end
num_pulse=0;       
for i=1:categories_pulse
    num_pulse=num_pulse+K(i);      
end
% output the total number of radar pulses
r=num_pulse-categories_pulse+1;
fprintf('The total number of pulses is %d\n',r);  


% Set up some matrixs of 4*num_pulse which contains the radar data
Temp_radar_data=zeros(4,num_pulse);  % 存储按照时间排序后的雷达数据
Temp=zeros(4,num_pulse);             % 存储以脉冲类型为顺序的雷达数据
radar_data=zeros(4,r);               % 存储未加噪声的雷达数据
radar=zeros(3,r);                    % 存储最终产生的雷达数据,不包含时间
tt0=zeros(1,num_pulse);              % 记录最原始脉冲分类结果
tt1=zeros(1,num_pulse);              % 记录按时间排序后的分类结果
tt=zeros(1,r);                       % 记录最终的脉冲分类结果(仅保留第一类的脉冲初始值)

% 构造时间顺序参数矩阵
m=1;
for j=1:categories_pulse
    for i=1:K(j)
           Temp(1,m)=T(j,i);
           Temp(2,m)=PRI(j);
           Temp(3,m)=PW(j);
           Temp(4,m)=RF(j);
           tt0(1,m)=j;
           m=m+1;
    end    
end   
 

% 对new_Temp的第一行进行排序,并返回排序后结果和原来位置
time_PRI=zeros(1,num_pulse);
time_PRI=Temp(1,:);           % 单独存储时间信息
[time_value,old_position]=sort(time_PRI);  %对时间信息进行排序


% 按照时间顺序对 Temp 进行重排序
for j=1:num_pulse
    Temp_radar_data(:,j)=Temp(:,old_position(j));         % 存储按照时间排序后的雷达数据
    tt1(1,j)=tt0(1,old_position(j));                      % 记录按时间排序后的分类结果
end
    

% 保留第一类脉冲初始值,去掉其它种类脉冲
radar_data(:,1)=Temp_radar_data(:,1);
tt(1,1)=tt1(1,1);
for i=2:r
    radar_data(:,i)=Temp_radar_data(:,i+categories_pulse-1);   % 存储未加噪声的雷达数据
    tt(1,i)=tt1(1,i+categories_pulse-1);      % 记录最终的脉冲分类结果(仅保留第一类的脉冲初始值)
end


%Add the rand noise 
for i=1:3
    for j=1:r
        radar(i,j)=normrnd(radar_data(i+1,j),0.03*radar_data(i+1,j));  %加入随机噪声影响
    end
    aa=max(radar(i,:));                                                %进行归一化
    bb=min(radar(i,:));
    for j=1:r
        radar(i,j)=(radar(i,j)-bb)/(aa-bb);
    end
end

% toc;

return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -