├── LICENSE ├── README.md ├── ca_CFAR.asv ├── ca_CFAR.m ├── cfar.asv ├── cfar.fig ├── cfar.m ├── cfar_ac.m ├── cfar_go.m ├── cfar_os.m ├── cfar_so.m ├── cfar_tc.m ├── env_edge.m └── env_uniform.m /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 fzzfbyx 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 1、内容简介 2 |        利用MATLAB GUI设计平台,设计多算法雷达一维恒虚警检测CFAR可视化界面,通过选择噪声类型、目标类型、算法类型,手动输入相关参数,可视化显示噪声波形与目标检测的回波-检测门限波形图。运行cfar.m即可调用GUI进行参数输入输出。 3 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/20200513184019391.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyNjc5NTcz,size_16,color_FFFFFF,t_70) 4 | ## 2、原理简介 5 |        恒虚警检测技术(CFAR)是指雷达系统在保持虚警概率恒定条件下对接收机输出的信号与噪声作判别以确定目标信号是否存在的技术。 6 |        前提:由于接收机输出端中肯定存有噪声(包括大气噪声、人为噪声、内部噪声和杂波等),而信号一般是叠加在噪声上的。这就需要在接收机输出的噪声或信号加噪声条件下,采用检测技术判别是否有目标信号。 7 |        误差概率:任何形式的判决必然存在着两种误差概率:发现概率和虚警概率。当接收机输出端存在目标回波信号,而判决时判为有目标的概率为Pd,判为无目标的概率为1-Pad。当接收机输出端只有噪声时,而判为有目标的概率为Pfa。由于噪声是随机变量,其特征可用概率密度函数表示,因此信号加噪声也是一随机变量 8 |         具体过程:恒虚警检测器首先对输入的噪声进行处理后确定一个门限,将此门限与输入端信号相比,如输入端信号超过了此门限,则判为有目标,否则,判为无目标。 9 |         算法:①均值类CFRA:核心思想是通过对参考窗内采样数据取平均来估计背景功率。CA-CFAR(单元平均恒虚警)、GO-CFAR(最大选择恒虚警)、SO-CFAR(最小选择恒虚警)算法这三个是最经典的均值类CFAR算法。 10 |                   ②统计有序CFAR:核心思想:通过对参考窗内的数据由小到大排序选取其中第K个数值假设其为杂波背景噪声。OS-CFAR(有序统计恒虚警)为其经典算法。 11 | 12 | ## 3、实现功能 13 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/20200513175854839.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyNjc5NTcz,size_16,color_FFFFFF,t_70) 14 | 实现的功能有: 15 | 16 | 1、类型选择:① 噪声类型:均匀背景噪声和杂波边缘背景噪声。均匀背景噪声为单一功率的噪声,在参数输入界面输入噪声功率2,噪声长度2,噪声方差即可(噪声功率1、噪声长度1被禁用);杂波边缘背景噪声为两种不同功率噪声的组合,需要分别输入噪声1和噪声2的功率与长度,方差两噪声共用。 17 |                          ②目标类型:单目标与多目标。选择单目标时只需输入目标1的信噪比与位置即可(其他目标被禁用);选择多目标时,需要分别输入目标1-4的信噪比与位置,其中当噪声类型为杂波边缘背景噪声时,还需分别输入靠近杂波边缘与杂波内目标的信噪比与位置,便于区别对比。 18 |                          ③算法类型:CA-CFAR、GO-CFAR、SO-CFAR、OS-CFAR,四种算法任选一种即可。 19 | 20 | 2、产生噪声&噪声波形图:完成噪声类型选择与噪声参数输入后,单击产生噪声按钮即可产生噪声波形图,在左下方进行显示。 21 | 22 | 3、参数输入:① 噪声功率1/2:噪声功率大小,单位db,变量名为db1、db2。 23 |                           ②噪声长度1/2:噪声的长度,其中噪声长度2为噪声总长(包括了噪声长度1),变量名为shape1、shape2。 24 |                           ③噪声方差:两段噪声共用的方差,变量名为varience。 25 |                           ④信噪比1/2/3/4/5/6:每个目标的信噪比,变量名为SNR1/2/3/4/5/6。 26 |                           ⑤目标位置1/2/3/4、杂波边缘位置,杂波内位置:各目标位置,需要小于最大噪声长度,其中杂波边缘位置应为两段噪声交界处,杂波内位置应在杂波内,变量名为des1/2/3/4/5/6。 27 |                           ⑥单元数目:总检测单元个数,变量名为N。 28 |                           ⑦保护单元数目:目标的功率可能泄露到相邻的单元中,所以和目标相邻的数个单元不作为背景杂波的估计,作为保护单元,变量名为pro_N。 29 |                           ⑧虚警概率:恒虚警检测保持的错误检测概率,变量名为PAD。 30 | 31 | 32 | 4、输出结果&回波-检测门限关系图:产生噪声,输入目标参数,选择算法后,单击输出结果按钮,即可在右侧得到回波-检测门限关系图。 33 | 34 | 5、左/右图导出:分别将噪声波形图与回波-检测门限关系图导出保存,可选的格式有jpg、png、bmp、eps。 35 | 36 | ## 4、操作实例 37 | 选取噪声类型为“杂波边缘背景噪声”,目标类型为多目标,算法类型选择CA-CFAR,参数输入为默认输入(噪声功率1/2:20db、30db;噪声长度1/2:100、200;噪声方差:200;信噪比1/2/3/4/5/6:15、12、8、5、5、5;目标位置1/2/3/4、杂波边缘位置、杂波内位置:30、40、50、60、95、120;单元个数:36;保护单元个数:2;虚警概率:0.001),得到结果如下图所示:![在这里插入图片描述](https://img-blog.csdnimg.cn/20200513183948353.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyNjc5NTcz,size_16,color_FFFFFF,t_70)从回波-检测门限图可以看出,该算法在低噪声环境中目标检测性能良好,实现恒虚警检测,但在杂波边缘与杂波内部检测性能显著下降。 38 | ## 5、算法与参数分析 39 | 算法分析: 40 | CA-CFAR:优点:损失率最少的一种算法; 41 |                       缺点:多目标遮掩,杂波边缘性能也欠佳; 42 | GO-CFAR:优点:杂波边缘区域虚警概率降低 43 |                       缺点:多目标遮掩 44 | SO-CFAR: 优点:多目标效果有改进; 45 |                       缺点:杂波边缘区域虚警概率提升; 46 | OS-CFAR:优点:多目标检测性能很好; 47 |                       缺点:杂波边缘区域虚警概率提高; 48 | 参数分析: 49 | 检测单元数:在相同信噪比下,检测单元数越多的CFAR对应的检测概率越高,但同时计算量加大。 50 | 虚警概率:在相同检测单元数目下,虚警概率的越高CFAR对应的检测概率越高,但虚警数也增多。 51 | 信噪比:当信噪比不断增加,检测概率也不断增加。 52 | 保护单元数:保护单元过大或过小都会使检测概率降低,应不同实验选取适中的保护单元数。 53 | ## 6、声明 54 | 55 | 本项目是本人基于其他CFAR文章的二次分析与开发,原文地址为:https://www.cnblogs.com/Mufasa/p/10900334.html,若有侵权请及时告知。 56 | 57 | CSDN地址为:https://blog.csdn.net/qq_42679573/article/details/106103729 58 | 59 | 新人学生博主,致力于信号分析。若觉得有用的话请关注一波呦~ -------------------------------------------------------------------------------- /ca_CFAR.asv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/ca_CFAR.asv -------------------------------------------------------------------------------- /ca_CFAR.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/ca_CFAR.m -------------------------------------------------------------------------------- /cfar.asv: -------------------------------------------------------------------------------- 1 | function varargout = cfar(varargin) 2 | %CFAR MATLAB code file for cfar.fig 3 | % CFAR, by itself, creates a new CFAR or raises the existing 4 | % singleton*. 5 | % 6 | % H = CFAR returns the handle to a new CFAR or the handle to 7 | % the existing singleton*. 8 | % 9 | % CFAR('Property','Value',...) creates a new CFAR using the 10 | % given property value pairs. Unrecognized properties are passed via 11 | % varargin to cfar_OpeningFcn. This calling syntax produces a 12 | % warning when there is an existing singleton*. 13 | % 14 | % CFAR('CALLBACK') and CFAR('CALLBACK',hObject,...) call the 15 | % local function named CALLBACK in CFAR.M with the given input 16 | % arguments. 17 | % 18 | % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one 19 | % instance to run (singleton)". 20 | % 21 | % See also: GUIDE, GUIDATA, GUIHANDLES 22 | 23 | % Edit the above text to modify the response to help cfar 24 | 25 | % Last Modified by GUIDE v2.5 12-May-2020 18:48:44 26 | 27 | % Begin initialization code - DO NOT EDIT 28 | gui_Singleton = 1; 29 | gui_State = struct('gui_Name', mfilename, ... 30 | 'gui_Singleton', gui_Singleton, ... 31 | 'gui_OpeningFcn', @cfar_OpeningFcn, ... 32 | 'gui_OutputFcn', @cfar_OutputFcn, ... 33 | 'gui_LayoutFcn', [], ... 34 | 'gui_Callback', []); 35 | if nargin && ischar(varargin{1}) 36 | gui_State.gui_Callback = str2func(varargin{1}); 37 | end 38 | 39 | if nargout 40 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 41 | else 42 | gui_mainfcn(gui_State, varargin{:}); 43 | end 44 | % End initialization code - DO NOT EDIT 45 | 46 | % --- Executes just before cfar is made visible. 47 | function cfar_OpeningFcn(hObject, eventdata, handles, varargin) 48 | % This function has no output args, see OutputFcn. 49 | % hObject handle to figure 50 | % eventdata reserved - to be defined in a future version of MATLAB 51 | % handles structure with handles and user data (see GUIDATA) 52 | % varargin unrecognized PropertyName/PropertyValue pairs from the 53 | % command line (see VARARGIN) 54 | 55 | % Choose default command line output for cfar 56 | handles.output = hObject; 57 | 58 | % Update handles structure 59 | guidata(hObject, handles); 60 | 61 | % UIWAIT makes cfar wait for user response (see UIRESUME) 62 | % uiwait(handles.figure1); 63 | 64 | 65 | % --- Outputs from this function are returned to the command line. 66 | function varargout = cfar_OutputFcn(hObject, eventdata, handles) 67 | % varargout cell array for returning output args (see VARARGOUT); 68 | % hObject handle to figure 69 | % eventdata reserved - to be defined in a future version of MATLAB 70 | % handles structure with handles and user data (see GUIDATA) 71 | 72 | % Get default command line output from handles structure 73 | varargout{1} = handles.output; 74 | 75 | 76 | % --- Executes on button press in pushbutton1. 77 | function pushbutton1_Callback(hObject, eventdata, handles) 78 | % hObject handle to pushbutton1 (see GCBO) 79 | % eventdata reserved - to be defined in a future version of MATLAB 80 | % handles structure with handles and user data (see GUIDATA) 81 | global noise_p; 82 | global xc; 83 | axes(handles.axes5); 84 | if get(handles.radiobutton4,'value') 85 | shape1=get(handles.edit9,'string'); 86 | shape1=str2double(shape1); 87 | shape2=get(handles.edit10,'string'); 88 | shape2=str2double(shape2); 89 | db1=get(handles.edit1,'string'); 90 | db1=str2double(db1); 91 | db2=get(handles.edit8,'string'); 92 | db2=str2double(db2); 93 | shape=[shape1,shape2]; 94 | variance=get(handles.edit2,'string'); 95 | variance=str2double(variance); 96 | noise_db=[db1,db2]; 97 | noise_p=10.^(noise_db./10); 98 | show_out=1; 99 | [ xc ] = env_edge(variance, shape, noise_db,show_out); 100 | end 101 | if get(handles.radiobutton3,'value') 102 | shape1=get(handles.edit10,'string'); 103 | shape1=str2double(shape1); 104 | variance=get(handles.edit2,'string'); 105 | variance=str2double(variance); 106 | db1=get(handles.edit1,'string'); 107 | db1=str2double(db1); 108 | noise_p=10.^(db1./10); 109 | show_out=1; 110 | [ xc ] = env_uniform(variance, shape1, db1,show_out); 111 | 112 | 113 | end 114 | % --- Executes on button press in pushbutton2. 115 | function pushbutton2_Callback(hObject, eventdata, handles) 116 | % hObject handle to pushbutton2 (see GCBO) 117 | % eventdata reserved - to be defined in a future version of MATLAB 118 | % handles structure with handles and user data (see GUIDATA) 119 | global noise_p; 120 | global xc; 121 | if get(handles.radiobutton3,'value')&&get(handles.radiobutton1,'value') 122 | SNR1=get(handles.edit4,'string'); 123 | SNR1=str2double(SNR1); 124 | signal1_p=10.^(SNR1./10).*noise_p; 125 | des1=get(handles.edit15,'string'); 126 | des1=str2double(des1); 127 | xc(1,des1)=signal1_p; 128 | N=get(handles.edit13,'string'); 129 | N=str2double(N); 130 | pro_N=get(handles.edit7,'string'); 131 | pro_N=str2double(pro_N); 132 | PAD=get(handles.edit14,'string'); 133 | PAD=str2double(PAD); 134 | k=2.*N./4; 135 | if get(handles.radiobutton5,'value')&&get(handles.radiobutton1,'value') 136 | [ index, XT ] = cfar_ac( xc, N, pro_N, PAD); 137 | end 138 | if get(handles.radiobutton6,'value')&&get(handles.radiobutton1,'value') 139 | [ index, XT ] = cfar_go( xc, N, pro_N, PAD); 140 | end 141 | if get(handles.radiobutton7,'value')&&get(handles.radiobutton1,'value') 142 | [ index, XT ] = cfar_os( abs(xc), N, k, pro_N, PAD); 143 | end 144 | if get(handles.radiobutton8,'value')&&get(handles.radiobutton1,'value') 145 | [ index, XT ] = cfar_so( xc, N, pro_N, PAD); 146 | end 147 | end 148 | if get(handles.radiobutton4,'value')&&get(handles.radiobutton1,'value') 149 | SNR1=get(handles.edit4,'string'); 150 | SNR1=str2double(SNR1); 151 | signal1_p=10.^(SNR1./10).*noise_p(1,end); 152 | des1=get(handles.edit15,'string'); 153 | des1=str2double(des1); 154 | xc(1,des1)=signal1_p; 155 | N=get(handles.edit13,'string'); 156 | N=str2double(N); 157 | pro_N=get(handles.edit7,'string'); 158 | pro_N=str2double(pro_N); 159 | PAD=get(handles.edit14,'string'); 160 | PAD=str2double(PAD); 161 | k=2.*N./4; 162 | if get(handles.radiobutton5,'value')&&get(handles.radiobutton1,'value') 163 | [ index, XT ] = cfar_ac( xc, N, pro_N, PAD); 164 | end 165 | if get(handles.radiobutton6,'value')&&get(handles.radiobutton1,'value') 166 | [ index, XT ] = cfar_go( xc, N, pro_N, PAD); 167 | end 168 | if get(handles.radiobutton7,'value')&&get(handles.radiobutton1,'value') 169 | [ index, XT ] = cfar_os( abs(xc), N, k, pro_N, PAD); 170 | end 171 | if get(handles.radiobutton8,'value')&&get(handles.radiobutton1,'value') 172 | [ index, XT ] = cfar_so( xc, N, pro_N, PAD); 173 | end 174 | end 175 | if get(handles.radiobutton3,'value')&&get(handles.radiobutton2,'value') 176 | SNR1=get(handles.edit4,'string'); 177 | SNR1=str2double(SNR1); 178 | SNR2=get(handles.edit5,'string'); 179 | SNR2=str2double(SNR2); 180 | SNR3=get(handles.edit11,'string'); 181 | SNR3=str2double(SNR3); 182 | SNR4=get(handles.edit12,'string'); 183 | SNR4=str2double(SNR4); 184 | signal1_p=10.^(SNR1./10).*noise_p; 185 | signal2_p=10.^(SNR2./10).*noise_p; 186 | signal3_p=10.^(SNR3./10).*noise_p; 187 | signal4_p=10.^(SNR4./10).*noise_p; 188 | des1=get(handles.edit15,'string'); 189 | des1=str2double(des1); 190 | des2=get(handles.edit16,'string'); 191 | des2=str2double(des2); 192 | des3=get(handles.edit17,'string'); 193 | des3=str2double(des3); 194 | des4=get(handles.edit18,'string'); 195 | des4=str2double(des4); 196 | xc(1,des1)=signal1_p; 197 | xc(1,des2)=signal2_p; 198 | xc(1,des3)=signal3_p; 199 | xc(1,des4)=signal4_p; 200 | N=get(handles.edit13,'string'); 201 | N=str2double(N); 202 | pro_N=get(handles.edit7,'string'); 203 | pro_N=str2double(pro_N); 204 | PAD=get(handles.edit14,'string'); 205 | PAD=str2double(PAD); 206 | k=2.*N./4; 207 | if get(handles.radiobutton5,'value')&&get(handles.radiobutton2,'value') 208 | [ index, XT ] = cfar_ac( xc, N, pro_N, PAD); 209 | end 210 | if get(handles.radiobutton6,'value')&&get(handles.radiobutton2,'value') 211 | [ index, XT ] = cfar_go( xc, N, pro_N, PAD); 212 | end 213 | if get(handles.radiobutton7,'value')&&get(handles.radiobutton2,'value') 214 | [ index, XT ] = cfar_os( abs(xc), N, k, pro_N, PAD); 215 | end 216 | if get(handles.radiobutton8,'value')&&get(handles.radiobutton2,'value') 217 | [ index, XT ] = cfar_so( xc, N, pro_N, PAD); 218 | end 219 | axes(handles.axes2); 220 | plot(des2,10.*log(abs(xc(1,des2)))./log(10),'r*', 'LineWidth',10),hold on; 221 | plot(des3,10.*log(abs(xc(1,des3)))./log(10),'r*', 'LineWidth',10),hold on; 222 | plot(des4,10.*log(abs(xc(1,des4)))./log(10),'r*', 'LineWidth',10),hold on; 223 | end 224 | if get(handles.radiobutton4,'value')&&get(handles.radiobutton2,'value') 225 | SNR1=get(handles.edit4,'string'); 226 | SNR1=str2double(SNR1); 227 | SNR2=get(handles.edit5,'string'); 228 | SNR2=str2double(SNR2); 229 | SNR3=get(handles.edit11,'string'); 230 | SNR3=str2double(SNR3); 231 | SNR4=get(handles.edit12,'string'); 232 | SNR4=str2double(SNR4); 233 | SNR5=get(handles.edit19,'string'); 234 | SNR5=str2double(SNR5); 235 | SNR6=get(handles.edit20,'string'); 236 | SNR6=str2double(SNR6); 237 | signal1_p=10.^(SNR1./10).*noise_p(1,end); 238 | signal2_p=10.^(SNR2./10).*noise_p(1,end); 239 | signal3_p=10.^(SNR3./10).*noise_p(1,end); 240 | signal4_p=10.^(SNR4./10).*noise_p(1,end); 241 | signal5_p=10.^(SNR4./10).*noise_p(1,end); 242 | signal6_p=10.^(SNR4./10).*noise_p(1,end); 243 | des1=get(handles.edit15,'string'); 244 | des1=str2double(des1); 245 | des2=get(handles.edit16,'string'); 246 | des2=str2double(des2); 247 | des3=get(handles.edit17,'string'); 248 | des3=str2double(des3); 249 | des4=get(handles.edit18,'string'); 250 | des4=str2double(des4); 251 | des5=get(handles.edit21,'string'); 252 | des5=str2double(des5); 253 | des6=get(handles.edit22,'string'); 254 | des6=str2double(des6); 255 | xc(1,des1)=signal1_p; 256 | xc(1,des2)=signal2_p; 257 | xc(1,des3)=signal3_p; 258 | xc(1,des4)=signal4_p; 259 | xc(1,des5)=signal5_p; 260 | xc(1,des6)=signal6_p; 261 | N=get(handles.edit13,'string'); 262 | N=str2double(N); 263 | pro_N=get(handles.edit7,'string'); 264 | pro_N=str2double(pro_N); 265 | PAD=get(handles.edit14,'string'); 266 | PAD=str2double(PAD); 267 | k=2.*N./4; 268 | if get(handles.radiobutton5,'value')&&get(handles.radiobutton2,'value') 269 | [ index, XT ] = cfar_ac( xc, N, pro_N, PAD); 270 | end 271 | if get(handles.radiobutton6,'value')&&get(handles.radiobutton2,'value') 272 | [ index, XT ] = cfar_go( xc, N, pro_N, PAD); 273 | end 274 | if get(handles.radiobutton7,'value')&&get(handles.radiobutton2,'value') 275 | [ index, XT ] = cfar_os( abs(xc), N, k, pro_N, PAD); 276 | end 277 | if get(handles.radiobutton8,'value')&&get(handles.radiobutton2,'value') 278 | [ index, XT ] = cfar_so( xc, N, pro_N, PAD); 279 | end 280 | axes(handles.axes2); 281 | plot(des2,10.*log(abs(xc(1,des2)))./log(10),'r*', 'LineWidth',10),hold on; 282 | plot(des3,10.*log(abs(xc(1,des3)))./log(10),'r*', 'LineWidth',10),hold on; 283 | plot(des4,10.*log(abs(xc(1,des4)))./log(10),'r*', 'LineWidth',10),hold on; 284 | plot(des5,10.*log(abs(xc(1,des5)))./log(10),'r*', 'LineWidth',10),hold on; 285 | plot(des6,10.*log(abs(xc(1,des6)))./log(10),'r*', 'LineWidth',10),hold on; 286 | end 287 | axes(handles.axes2); 288 | plot(10.*log(abs(xc))./log(10)),hold on; 289 | plot(des1,10.*log(abs(xc(1,des1)))./log(10),'r*', 'LineWidth',10),hold on; 290 | % if get(handles.radiobutton2,'value')&&get(handles.radiobutton3,'value') 291 | % plot(des2,10.*log(abs(xc(1,des2)))./log(10),'r*', 'LineWidth',10),hold on; 292 | % plot(des3,10.*log(abs(xc(1,des3)))./log(10),'r*', 'LineWidth',10),hold on; 293 | % plot(des4,10.*log(abs(xc(1,des4)))./log(10),'r*', 'LineWidth',10),hold on; 294 | % end 295 | % if get(handles.radiobutton2,'value')&&get(handles.radiobutton4,'value') 296 | % plot(des5,10.*log(abs(xc(1,des5)))./log(10),'r*', 'LineWidth',10),hold on; 297 | % plot(des6,10.*log(abs(xc(1,des6)))./log(10),'r*', 'LineWidth',10),hold on; 298 | % end 299 | plot(index,10.*log(abs(XT))./log(10),'y-'); 300 | legend('回波','目标位置','检测门限') 301 | 302 | 303 | 304 | function edit1_Callback(hObject, eventdata, handles) 305 | % hObject handle to edit1 (see GCBO) 306 | % eventdata reserved - to be defined in a future version of MATLAB 307 | % handles structure with handles and user data (see GUIDATA) 308 | 309 | % Hints: get(hObject,'String') returns contents of edit1 as text 310 | % str2double(get(hObject,'String')) returns contents of edit1 as a double 311 | 312 | 313 | % --- Executes during object creation, after setting all properties. 314 | function edit1_CreateFcn(hObject, eventdata, handles) 315 | % hObject handle to edit1 (see GCBO) 316 | % eventdata reserved - to be defined in a future version of MATLAB 317 | % handles empty - handles not created until after all CreateFcns called 318 | 319 | % Hint: edit controls usually have a white background on Windows. 320 | % See ISPC and COMPUTER. 321 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 322 | set(hObject,'BackgroundColor','white'); 323 | end 324 | 325 | 326 | 327 | 328 | function edit2_Callback(hObject, eventdata, handles) 329 | % hObject handle to edit2 (see GCBO) 330 | % eventdata reserved - to be defined in a future version of MATLAB 331 | % handles structure with handles and user data (see GUIDATA) 332 | 333 | % Hints: get(hObject,'String') returns contents of edit2 as text 334 | % str2double(get(hObject,'String')) returns contents of edit2 as a double 335 | 336 | 337 | % --- Executes during object creation, after setting all properties. 338 | function edit2_CreateFcn(hObject, eventdata, handles) 339 | % hObject handle to edit2 (see GCBO) 340 | % eventdata reserved - to be defined in a future version of MATLAB 341 | % handles empty - handles not created until after all CreateFcns called 342 | 343 | % Hint: edit controls usually have a white background on Windows. 344 | % See ISPC and COMPUTER. 345 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 346 | set(hObject,'BackgroundColor','white'); 347 | end 348 | 349 | 350 | 351 | function edit4_Callback(hObject, eventdata, handles) 352 | % hObject handle to edit4 (see GCBO) 353 | % eventdata reserved - to be defined in a future version of MATLAB 354 | % handles structure with handles and user data (see GUIDATA) 355 | 356 | % Hints: get(hObject,'String') returns contents of edit4 as text 357 | % str2double(get(hObject,'String')) returns contents of edit4 as a double 358 | 359 | 360 | % --- Executes during object creation, after setting all properties. 361 | function edit4_CreateFcn(hObject, eventdata, handles) 362 | % hObject handle to edit4 (see GCBO) 363 | % eventdata reserved - to be defined in a future version of MATLAB 364 | % handles empty - handles not created until after all CreateFcns called 365 | 366 | % Hint: edit controls usually have a white background on Windows. 367 | % See ISPC and COMPUTER. 368 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 369 | set(hObject,'BackgroundColor','white'); 370 | end 371 | 372 | 373 | 374 | function edit5_Callback(hObject, eventdata, handles) 375 | % hObject handle to edit5 (see GCBO) 376 | % eventdata reserved - to be defined in a future version of MATLAB 377 | % handles structure with handles and user data (see GUIDATA) 378 | 379 | % Hints: get(hObject,'String') returns contents of edit5 as text 380 | % str2double(get(hObject,'String')) returns contents of edit5 as a double 381 | 382 | 383 | % --- Executes during object creation, after setting all properties. 384 | function edit5_CreateFcn(hObject, eventdata, handles) 385 | % hObject handle to edit5 (see GCBO) 386 | % eventdata reserved - to be defined in a future version of MATLAB 387 | % handles empty - handles not created until after all CreateFcns called 388 | 389 | % Hint: edit controls usually have a white background on Windows. 390 | % See ISPC and COMPUTER. 391 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 392 | set(hObject,'BackgroundColor','white'); 393 | end 394 | 395 | 396 | 397 | function edit7_Callback(hObject, eventdata, handles) 398 | % hObject handle to edit7 (see GCBO) 399 | % eventdata reserved - to be defined in a future version of MATLAB 400 | % handles structure with handles and user data (see GUIDATA) 401 | 402 | % Hints: get(hObject,'String') returns contents of edit7 as text 403 | % str2double(get(hObject,'String')) returns contents of edit7 as a double 404 | 405 | 406 | % --- Executes during object creation, after setting all properties. 407 | function edit7_CreateFcn(hObject, eventdata, handles) 408 | % hObject handle to edit7 (see GCBO) 409 | % eventdata reserved - to be defined in a future version of MATLAB 410 | % handles empty - handles not created until after all CreateFcns called 411 | 412 | % Hint: edit controls usually have a white background on Windows. 413 | % See ISPC and COMPUTER. 414 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 415 | set(hObject,'BackgroundColor','white'); 416 | end 417 | 418 | 419 | 420 | function edit8_Callback(hObject, eventdata, handles) 421 | % hObject handle to edit8 (see GCBO) 422 | % eventdata reserved - to be defined in a future version of MATLAB 423 | % handles structure with handles and user data (see GUIDATA) 424 | 425 | % Hints: get(hObject,'String') returns contents of edit8 as text 426 | % str2double(get(hObject,'String')) returns contents of edit8 as a double 427 | 428 | 429 | % --- Executes during object creation, after setting all properties. 430 | function edit8_CreateFcn(hObject, eventdata, handles) 431 | % hObject handle to edit8 (see GCBO) 432 | % eventdata reserved - to be defined in a future version of MATLAB 433 | % handles empty - handles not created until after all CreateFcns called 434 | 435 | % Hint: edit controls usually have a white background on Windows. 436 | % See ISPC and COMPUTER. 437 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 438 | set(hObject,'BackgroundColor','white'); 439 | end 440 | 441 | 442 | 443 | function edit9_Callback(hObject, eventdata, handles) 444 | % hObject handle to edit9 (see GCBO) 445 | % eventdata reserved - to be defined in a future version of MATLAB 446 | % handles structure with handles and user data (see GUIDATA) 447 | 448 | % Hints: get(hObject,'String') returns contents of edit9 as text 449 | % str2double(get(hObject,'String')) returns contents of edit9 as a double 450 | 451 | 452 | % --- Executes during object creation, after setting all properties. 453 | function edit9_CreateFcn(hObject, eventdata, handles) 454 | % hObject handle to edit9 (see GCBO) 455 | % eventdata reserved - to be defined in a future version of MATLAB 456 | % handles empty - handles not created until after all CreateFcns called 457 | 458 | % Hint: edit controls usually have a white background on Windows. 459 | % See ISPC and COMPUTER. 460 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 461 | set(hObject,'BackgroundColor','white'); 462 | end 463 | 464 | 465 | 466 | function edit10_Callback(hObject, eventdata, handles) 467 | % hObject handle to edit10 (see GCBO) 468 | % eventdata reserved - to be defined in a future version of MATLAB 469 | % handles structure with handles and user data (see GUIDATA) 470 | 471 | % Hints: get(hObject,'String') returns contents of edit10 as text 472 | % str2double(get(hObject,'String')) returns contents of edit10 as a double 473 | 474 | 475 | % --- Executes during object creation, after setting all properties. 476 | function edit10_CreateFcn(hObject, eventdata, handles) 477 | % hObject handle to edit10 (see GCBO) 478 | % eventdata reserved - to be defined in a future version of MATLAB 479 | % handles empty - handles not created until after all CreateFcns called 480 | 481 | % Hint: edit controls usually have a white background on Windows. 482 | % See ISPC and COMPUTER. 483 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 484 | set(hObject,'BackgroundColor','white'); 485 | end 486 | 487 | 488 | 489 | function edit11_Callback(hObject, eventdata, handles) 490 | % hObject handle to edit11 (see GCBO) 491 | % eventdata reserved - to be defined in a future version of MATLAB 492 | % handles structure with handles and user data (see GUIDATA) 493 | 494 | % Hints: get(hObject,'String') returns contents of edit11 as text 495 | % str2double(get(hObject,'String')) returns contents of edit11 as a double 496 | 497 | 498 | % --- Executes during object creation, after setting all properties. 499 | function edit11_CreateFcn(hObject, eventdata, handles) 500 | % hObject handle to edit11 (see GCBO) 501 | % eventdata reserved - to be defined in a future version of MATLAB 502 | % handles empty - handles not created until after all CreateFcns called 503 | 504 | % Hint: edit controls usually have a white background on Windows. 505 | % See ISPC and COMPUTER. 506 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 507 | set(hObject,'BackgroundColor','white'); 508 | end 509 | 510 | 511 | 512 | function edit12_Callback(hObject, eventdata, handles) 513 | % hObject handle to edit12 (see GCBO) 514 | % eventdata reserved - to be defined in a future version of MATLAB 515 | % handles structure with handles and user data (see GUIDATA) 516 | 517 | % Hints: get(hObject,'String') returns contents of edit12 as text 518 | % str2double(get(hObject,'String')) returns contents of edit12 as a double 519 | 520 | 521 | % --- Executes during object creation, after setting all properties. 522 | function edit12_CreateFcn(hObject, eventdata, handles) 523 | % hObject handle to edit12 (see GCBO) 524 | % eventdata reserved - to be defined in a future version of MATLAB 525 | % handles empty - handles not created until after all CreateFcns called 526 | 527 | % Hint: edit controls usually have a white background on Windows. 528 | % See ISPC and COMPUTER. 529 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 530 | set(hObject,'BackgroundColor','white'); 531 | end 532 | 533 | 534 | 535 | function edit13_Callback(hObject, eventdata, handles) 536 | % hObject handle to edit13 (see GCBO) 537 | % eventdata reserved - to be defined in a future version of MATLAB 538 | % handles structure with handles and user data (see GUIDATA) 539 | 540 | % Hints: get(hObject,'String') returns contents of edit13 as text 541 | % str2double(get(hObject,'String')) returns contents of edit13 as a double 542 | 543 | 544 | % --- Executes during object creation, after setting all properties. 545 | function edit13_CreateFcn(hObject, eventdata, handles) 546 | % hObject handle to edit13 (see GCBO) 547 | % eventdata reserved - to be defined in a future version of MATLAB 548 | % handles empty - handles not created until after all CreateFcns called 549 | 550 | % Hint: edit controls usually have a white background on Windows. 551 | % See ISPC and COMPUTER. 552 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 553 | set(hObject,'BackgroundColor','white'); 554 | end 555 | 556 | 557 | 558 | function edit14_Callback(hObject, eventdata, handles) 559 | % hObject handle to edit14 (see GCBO) 560 | % eventdata reserved - to be defined in a future version of MATLAB 561 | % handles structure with handles and user data (see GUIDATA) 562 | 563 | % Hints: get(hObject,'String') returns contents of edit14 as text 564 | % str2double(get(hObject,'String')) returns contents of edit14 as a double 565 | 566 | 567 | % --- Executes during object creation, after setting all properties. 568 | function edit14_CreateFcn(hObject, eventdata, handles) 569 | % hObject handle to edit14 (see GCBO) 570 | % eventdata reserved - to be defined in a future version of MATLAB 571 | % handles empty - handles not created until after all CreateFcns called 572 | 573 | % Hint: edit controls usually have a white background on Windows. 574 | % See ISPC and COMPUTER. 575 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 576 | set(hObject,'BackgroundColor','white'); 577 | end 578 | 579 | 580 | % --- Executes on button press in radiobutton5. 581 | function radiobutton5_Callback(hObject, eventdata, handles) 582 | % hObject handle to radiobutton5 (see GCBO) 583 | % eventdata reserved - to be defined in a future version of MATLAB 584 | % handles structure with handles and user data (see GUIDATA) 585 | 586 | % Hint: get(hObject,'Value') returns toggle state of radiobutton5 587 | 588 | 589 | % --- Executes on button press in radiobutton6. 590 | function radiobutton6_Callback(hObject, eventdata, handles) 591 | % hObject handle to radiobutton6 (see GCBO) 592 | % eventdata reserved - to be defined in a future version of MATLAB 593 | % handles structure with handles and user data (see GUIDATA) 594 | 595 | % Hint: get(hObject,'Value') returns toggle state of radiobutton6 596 | 597 | 598 | % --- Executes on button press in radiobutton7. 599 | function radiobutton7_Callback(hObject, eventdata, handles) 600 | % hObject handle to radiobutton7 (see GCBO) 601 | % eventdata reserved - to be defined in a future version of MATLAB 602 | % handles structure with handles and user data (see GUIDATA) 603 | 604 | % Hint: get(hObject,'Value') returns toggle state of radiobutton7 605 | 606 | 607 | % --- Executes on button press in radiobutton8. 608 | function radiobutton8_Callback(hObject, eventdata, handles) 609 | % hObject handle to radiobutton8 (see GCBO) 610 | % eventdata reserved - to be defined in a future version of MATLAB 611 | % handles structure with handles and user data (see GUIDATA) 612 | 613 | % Hint: get(hObject,'Value') returns toggle state of radiobutton8 614 | 615 | 616 | % --- Executes on button press in radiobutton9. 617 | function radiobutton9_Callback(hObject, eventdata, handles) 618 | % hObject handle to radiobutton9 (see GCBO) 619 | % eventdata reserved - to be defined in a future version of MATLAB 620 | % handles structure with handles and user data (see GUIDATA) 621 | 622 | % Hint: get(hObject,'Value') returns toggle state of radiobutton9 623 | 624 | 625 | % --- Executes on button press in radiobutton4. 626 | function radiobutton4_Callback(hObject, eventdata, handles) 627 | % hObject handle to radiobutton4 (see GCBO) 628 | % eventdata reserved - to be defined in a future version of MATLAB 629 | % handles structure with handles and user data (see GUIDATA) 630 | 631 | % Hint: get(hObject,'Value') returns toggle state of radiobutton4 632 | if get(handles.radiobutton4,'value') 633 | set(handles.edit1,'enable','on') 634 | set(handles.edit9,'enable','on') 635 | end 636 | 637 | % --- Executes on button press in radiobutton3. 638 | function radiobutton3_Callback(hObject, eventdata, handles) 639 | % hObject handle to radiobutton3 (see GCBO) 640 | % eventdata reserved - to be defined in a future version of MATLAB 641 | % handles structure with handles and user data (see GUIDATA) 642 | 643 | % Hint: get(hObject,'Value') returns toggle state of radiobutton3 644 | if get(handles.radiobutton3,'value') 645 | set(handles.edit1,'enable','off') 646 | set(handles.edit9,'enable','off') 647 | end 648 | 649 | % --- Executes on button press in radiobutton1. 650 | function radiobutton1_Callback(hObject, eventdata, handles) 651 | % hObject handle to radiobutton1 (see GCBO) 652 | % eventdata reserved - to be defined in a future version of MATLAB 653 | % handles structure with handles and user data (see GUIDATA) 654 | 655 | % Hint: get(hObject,'Value') returns toggle state of radiobutton1 656 | if get(handles.radiobutton1,'value') 657 | set(handles.edit5,'enable','off') 658 | set(handles.edit11,'enable','off') 659 | set(handles.edit12,'enable','off') 660 | set(handles.edit19,'enable','off') 661 | set(handles.edit20,'enable','off') 662 | set(handles.edit16,'enable','off') 663 | set(handles.edit17,'enable','off') 664 | set(handles.edit18,'enable','off') 665 | set(handles.edit21,'enable','off') 666 | set(handles.edit22,'enable','off') 667 | end 668 | % --- Executes on button press in radiobutton2. 669 | function radiobutton2_Callback(hObject, eventdata, handles) 670 | % hObject handle to radiobutton2 (see GCBO) 671 | % eventdata reserved - to be defined in a future version of MATLAB 672 | % handles structure with handles and user data (see GUIDATA) 673 | 674 | % Hint: get(hObject,'Value') returns toggle state of radiobutton2 675 | if get(handles.radiobutton2,'value') 676 | set(handles.edit5,'enable','on') 677 | set(handles.edit11,'enable','on') 678 | set(handles.edit12,'enable','on') 679 | set(handles.edit19,'enable','on') 680 | set(handles.edit20,'enable','on') 681 | set(handles.edit16,'enable','on') 682 | set(handles.edit17,'enable','on') 683 | set(handles.edit18,'enable','on') 684 | set(handles.edit21,'enable','on') 685 | set(handles.edit22,'enable','on') 686 | end 687 | 688 | 689 | % --- Executes on button press in pushbutton3. 690 | function pushbutton3_Callback(hObject, eventdata, handles) 691 | % hObject handle to pushbutton3 (see GCBO) 692 | % eventdata reserved - to be defined in a future version of MATLAB 693 | % handles structure with handles and user data (see GUIDATA) 694 | 695 | 696 | % --- Executes on button press in pushbutton4. 697 | function pushbutton4_Callback(hObject, eventdata, handles) 698 | % hObject handle to pushbutton4 (see GCBO) 699 | % eventdata reserved - to be defined in a future version of MATLAB 700 | % handles structure with handles and user data (see GUIDATA) 701 | 702 | 703 | 704 | function edit15_Callback(hObject, eventdata, handles) 705 | % hObject handle to edit15 (see GCBO) 706 | % eventdata reserved - to be defined in a future version of MATLAB 707 | % handles structure with handles and user data (see GUIDATA) 708 | 709 | % Hints: get(hObject,'String') returns contents of edit15 as text 710 | % str2double(get(hObject,'String')) returns contents of edit15 as a double 711 | 712 | 713 | % --- Executes during object creation, after setting all properties. 714 | function edit15_CreateFcn(hObject, eventdata, handles) 715 | % hObject handle to edit15 (see GCBO) 716 | % eventdata reserved - to be defined in a future version of MATLAB 717 | % handles empty - handles not created until after all CreateFcns called 718 | 719 | % Hint: edit controls usually have a white background on Windows. 720 | % See ISPC and COMPUTER. 721 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 722 | set(hObject,'BackgroundColor','white'); 723 | end 724 | 725 | 726 | 727 | function edit16_Callback(hObject, eventdata, handles) 728 | % hObject handle to edit16 (see GCBO) 729 | % eventdata reserved - to be defined in a future version of MATLAB 730 | % handles structure with handles and user data (see GUIDATA) 731 | 732 | % Hints: get(hObject,'String') returns contents of edit16 as text 733 | % str2double(get(hObject,'String')) returns contents of edit16 as a double 734 | 735 | 736 | % --- Executes during object creation, after setting all properties. 737 | function edit16_CreateFcn(hObject, eventdata, handles) 738 | % hObject handle to edit16 (see GCBO) 739 | % eventdata reserved - to be defined in a future version of MATLAB 740 | % handles empty - handles not created until after all CreateFcns called 741 | 742 | % Hint: edit controls usually have a white background on Windows. 743 | % See ISPC and COMPUTER. 744 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 745 | set(hObject,'BackgroundColor','white'); 746 | end 747 | 748 | 749 | 750 | function edit17_Callback(hObject, eventdata, handles) 751 | % hObject handle to edit17 (see GCBO) 752 | % eventdata reserved - to be defined in a future version of MATLAB 753 | % handles structure with handles and user data (see GUIDATA) 754 | 755 | % Hints: get(hObject,'String') returns contents of edit17 as text 756 | % str2double(get(hObject,'String')) returns contents of edit17 as a double 757 | 758 | 759 | % --- Executes during object creation, after setting all properties. 760 | function edit17_CreateFcn(hObject, eventdata, handles) 761 | % hObject handle to edit17 (see GCBO) 762 | % eventdata reserved - to be defined in a future version of MATLAB 763 | % handles empty - handles not created until after all CreateFcns called 764 | 765 | % Hint: edit controls usually have a white background on Windows. 766 | % See ISPC and COMPUTER. 767 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 768 | set(hObject,'BackgroundColor','white'); 769 | end 770 | 771 | 772 | 773 | function edit18_Callback(hObject, eventdata, handles) 774 | % hObject handle to edit18 (see GCBO) 775 | % eventdata reserved - to be defined in a future version of MATLAB 776 | % handles structure with handles and user data (see GUIDATA) 777 | 778 | % Hints: get(hObject,'String') returns contents of edit18 as text 779 | % str2double(get(hObject,'String')) returns contents of edit18 as a double 780 | 781 | 782 | % --- Executes during object creation, after setting all properties. 783 | function edit18_CreateFcn(hObject, eventdata, handles) 784 | % hObject handle to edit18 (see GCBO) 785 | % eventdata reserved - to be defined in a future version of MATLAB 786 | % handles empty - handles not created until after all CreateFcns called 787 | 788 | % Hint: edit controls usually have a white background on Windows. 789 | % See ISPC and COMPUTER. 790 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 791 | set(hObject,'BackgroundColor','white'); 792 | end 793 | 794 | 795 | 796 | function edit19_Callback(hObject, eventdata, handles) 797 | % hObject handle to edit19 (see GCBO) 798 | % eventdata reserved - to be defined in a future version of MATLAB 799 | % handles structure with handles and user data (see GUIDATA) 800 | 801 | % Hints: get(hObject,'String') returns contents of edit19 as text 802 | % str2double(get(hObject,'String')) returns contents of edit19 as a double 803 | 804 | 805 | % --- Executes during object creation, after setting all properties. 806 | function edit19_CreateFcn(hObject, eventdata, handles) 807 | % hObject handle to edit19 (see GCBO) 808 | % eventdata reserved - to be defined in a future version of MATLAB 809 | % handles empty - handles not created until after all CreateFcns called 810 | 811 | % Hint: edit controls usually have a white background on Windows. 812 | % See ISPC and COMPUTER. 813 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 814 | set(hObject,'BackgroundColor','white'); 815 | end 816 | 817 | 818 | 819 | function edit20_Callback(hObject, eventdata, handles) 820 | % hObject handle to edit20 (see GCBO) 821 | % eventdata reserved - to be defined in a future version of MATLAB 822 | % handles structure with handles and user data (see GUIDATA) 823 | 824 | % Hints: get(hObject,'String') returns contents of edit20 as text 825 | % str2double(get(hObject,'String')) returns contents of edit20 as a double 826 | 827 | 828 | % --- Executes during object creation, after setting all properties. 829 | function edit20_CreateFcn(hObject, eventdata, handles) 830 | % hObject handle to edit20 (see GCBO) 831 | % eventdata reserved - to be defined in a future version of MATLAB 832 | % handles empty - handles not created until after all CreateFcns called 833 | 834 | % Hint: edit controls usually have a white background on Windows. 835 | % See ISPC and COMPUTER. 836 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 837 | set(hObject,'BackgroundColor','white'); 838 | end 839 | 840 | 841 | 842 | function edit21_Callback(hObject, eventdata, handles) 843 | % hObject handle to edit21 (see GCBO) 844 | % eventdata reserved - to be defined in a future version of MATLAB 845 | % handles structure with handles and user data (see GUIDATA) 846 | 847 | % Hints: get(hObject,'String') returns contents of edit21 as text 848 | % str2double(get(hObject,'String')) returns contents of edit21 as a double 849 | 850 | 851 | % --- Executes during object creation, after setting all properties. 852 | function edit21_CreateFcn(hObject, eventdata, handles) 853 | % hObject handle to edit21 (see GCBO) 854 | % eventdata reserved - to be defined in a future version of MATLAB 855 | % handles empty - handles not created until after all CreateFcns called 856 | 857 | % Hint: edit controls usually have a white background on Windows. 858 | % See ISPC and COMPUTER. 859 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 860 | set(hObject,'BackgroundColor','white'); 861 | end 862 | 863 | 864 | 865 | function edit22_Callback(hObject, eventdata, handles) 866 | % hObject handle to edit22 (see GCBO) 867 | % eventdata reserved - to be defined in a future version of MATLAB 868 | % handles structure with handles and user data (see GUIDATA) 869 | 870 | % Hints: get(hObject,'String') returns contents of edit22 as text 871 | % str2double(get(hObject,'String')) returns contents of edit22 as a double 872 | 873 | 874 | % --- Executes during object creation, after setting all properties. 875 | function edit22_CreateFcn(hObject, eventdata, handles) 876 | % hObject handle to edit22 (see GCBO) 877 | % eventdata reserved - to be defined in a future version of MATLAB 878 | % handles empty - handles not created until after all CreateFcns called 879 | 880 | % Hint: edit controls usually have a white background on Windows. 881 | % See ISPC and COMPUTER. 882 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 883 | set(hObject,'BackgroundColor','white'); 884 | end 885 | -------------------------------------------------------------------------------- /cfar.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/cfar.fig -------------------------------------------------------------------------------- /cfar.m: -------------------------------------------------------------------------------- 1 | function varargout = cfar(varargin) 2 | %CFAR MATLAB code file for cfar.fig 3 | % CFAR, by itself, creates a new CFAR or raises the existing 4 | % singleton*. 5 | % 6 | % H = CFAR returns the handle to a new CFAR or the handle to 7 | % the existing singleton*. 8 | % 9 | % CFAR('Property','Value',...) creates a new CFAR using the 10 | % given property value pairs. Unrecognized properties are passed via 11 | % varargin to cfar_OpeningFcn. This calling syntax produces a 12 | % warning when there is an existing singleton*. 13 | % 14 | % CFAR('CALLBACK') and CFAR('CALLBACK',hObject,...) call the 15 | % local function named CALLBACK in CFAR.M with the given input 16 | % arguments. 17 | % 18 | % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one 19 | % instance to run (singleton)". 20 | % 21 | % See also: GUIDE, GUIDATA, GUIHANDLES 22 | 23 | % Edit the above text to modify the response to help cfar 24 | 25 | % Last Modified by GUIDE v2.5 12-May-2020 18:48:44 26 | 27 | % Begin initialization code - DO NOT EDIT 28 | gui_Singleton = 1; 29 | gui_State = struct('gui_Name', mfilename, ... 30 | 'gui_Singleton', gui_Singleton, ... 31 | 'gui_OpeningFcn', @cfar_OpeningFcn, ... 32 | 'gui_OutputFcn', @cfar_OutputFcn, ... 33 | 'gui_LayoutFcn', [], ... 34 | 'gui_Callback', []); 35 | if nargin && ischar(varargin{1}) 36 | gui_State.gui_Callback = str2func(varargin{1}); 37 | end 38 | 39 | if nargout 40 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 41 | else 42 | gui_mainfcn(gui_State, varargin{:}); 43 | end 44 | % End initialization code - DO NOT EDIT 45 | 46 | % --- Executes just before cfar is made visible. 47 | function cfar_OpeningFcn(hObject, eventdata, handles, varargin) 48 | % This function has no output args, see OutputFcn. 49 | % hObject handle to figure 50 | % eventdata reserved - to be defined in a future version of MATLAB 51 | % handles structure with handles and user data (see GUIDATA) 52 | % varargin unrecognized PropertyName/PropertyValue pairs from the 53 | % command line (see VARARGIN) 54 | 55 | % Choose default command line output for cfar 56 | handles.output = hObject; 57 | 58 | % Update handles structure 59 | guidata(hObject, handles); 60 | 61 | % UIWAIT makes cfar wait for user response (see UIRESUME) 62 | % uiwait(handles.figure1); 63 | 64 | 65 | % --- Outputs from this function are returned to the command line. 66 | function varargout = cfar_OutputFcn(hObject, eventdata, handles) 67 | % varargout cell array for returning output args (see VARARGOUT); 68 | % hObject handle to figure 69 | % eventdata reserved - to be defined in a future version of MATLAB 70 | % handles structure with handles and user data (see GUIDATA) 71 | 72 | % Get default command line output from handles structure 73 | varargout{1} = handles.output; 74 | 75 | 76 | % --- Executes on button press in pushbutton1. 77 | function pushbutton1_Callback(hObject, eventdata, handles) 78 | % hObject handle to pushbutton1 (see GCBO) 79 | % eventdata reserved - to be defined in a future version of MATLAB 80 | % handles structure with handles and user data (see GUIDATA) 81 | global noise_p; 82 | global xc; 83 | axes(handles.axes5); 84 | if get(handles.radiobutton4,'value') 85 | shape1=get(handles.edit9,'string'); 86 | shape1=str2double(shape1); 87 | shape2=get(handles.edit10,'string'); 88 | shape2=str2double(shape2); 89 | db1=get(handles.edit1,'string'); 90 | db1=str2double(db1); 91 | db2=get(handles.edit8,'string'); 92 | db2=str2double(db2); 93 | shape=[shape1,shape2]; 94 | variance=get(handles.edit2,'string'); 95 | variance=str2double(variance); 96 | noise_db=[db1,db2]; 97 | noise_p=10.^(noise_db./10); 98 | show_out=1; 99 | [ xc ] = env_edge(variance, shape, noise_db,show_out); 100 | end 101 | if get(handles.radiobutton3,'value') 102 | shape1=get(handles.edit10,'string'); 103 | shape1=str2double(shape1); 104 | variance=get(handles.edit2,'string'); 105 | variance=str2double(variance); 106 | db1=get(handles.edit1,'string'); 107 | db1=str2double(db1); 108 | noise_p=10.^(db1./10); 109 | show_out=1; 110 | [ xc ] = env_uniform(variance, shape1, db1,show_out); 111 | 112 | 113 | end 114 | % --- Executes on button press in pushbutton2. 115 | function pushbutton2_Callback(hObject, eventdata, handles) 116 | % hObject handle to pushbutton2 (see GCBO) 117 | % eventdata reserved - to be defined in a future version of MATLAB 118 | % handles structure with handles and user data (see GUIDATA) 119 | global noise_p; 120 | global xc; 121 | if get(handles.radiobutton3,'value')&&get(handles.radiobutton1,'value') 122 | SNR1=get(handles.edit4,'string'); 123 | SNR1=str2double(SNR1); 124 | signal1_p=10.^(SNR1./10).*noise_p; 125 | des1=get(handles.edit15,'string'); 126 | des1=str2double(des1); 127 | xc(1,des1)=signal1_p; 128 | N=get(handles.edit13,'string'); 129 | N=str2double(N); 130 | pro_N=get(handles.edit7,'string'); 131 | pro_N=str2double(pro_N); 132 | PAD=get(handles.edit14,'string'); 133 | PAD=str2double(PAD); 134 | k=2.*N./4; 135 | if get(handles.radiobutton5,'value')&&get(handles.radiobutton1,'value') 136 | [ index, XT ] = cfar_ac( xc, N, pro_N, PAD); 137 | end 138 | if get(handles.radiobutton6,'value')&&get(handles.radiobutton1,'value') 139 | [ index, XT ] = cfar_go( xc, N, pro_N, PAD); 140 | end 141 | if get(handles.radiobutton7,'value')&&get(handles.radiobutton1,'value') 142 | [ index, XT ] = cfar_os( abs(xc), N, k, pro_N, PAD); 143 | end 144 | if get(handles.radiobutton8,'value')&&get(handles.radiobutton1,'value') 145 | [ index, XT ] = cfar_so( xc, N, pro_N, PAD); 146 | end 147 | end 148 | if get(handles.radiobutton4,'value')&&get(handles.radiobutton1,'value') 149 | SNR1=get(handles.edit4,'string'); 150 | SNR1=str2double(SNR1); 151 | signal1_p=10.^(SNR1./10).*noise_p(1,end); 152 | des1=get(handles.edit15,'string'); 153 | des1=str2double(des1); 154 | xc(1,des1)=signal1_p; 155 | N=get(handles.edit13,'string'); 156 | N=str2double(N); 157 | pro_N=get(handles.edit7,'string'); 158 | pro_N=str2double(pro_N); 159 | PAD=get(handles.edit14,'string'); 160 | PAD=str2double(PAD); 161 | k=2.*N./4; 162 | if get(handles.radiobutton5,'value')&&get(handles.radiobutton1,'value') 163 | [ index, XT ] = cfar_ac( xc, N, pro_N, PAD); 164 | end 165 | if get(handles.radiobutton6,'value')&&get(handles.radiobutton1,'value') 166 | [ index, XT ] = cfar_go( xc, N, pro_N, PAD); 167 | end 168 | if get(handles.radiobutton7,'value')&&get(handles.radiobutton1,'value') 169 | [ index, XT ] = cfar_os( abs(xc), N, k, pro_N, PAD); 170 | end 171 | if get(handles.radiobutton8,'value')&&get(handles.radiobutton1,'value') 172 | [ index, XT ] = cfar_so( xc, N, pro_N, PAD); 173 | end 174 | end 175 | if get(handles.radiobutton3,'value')&&get(handles.radiobutton2,'value') 176 | SNR1=get(handles.edit4,'string'); 177 | SNR1=str2double(SNR1); 178 | SNR2=get(handles.edit5,'string'); 179 | SNR2=str2double(SNR2); 180 | SNR3=get(handles.edit11,'string'); 181 | SNR3=str2double(SNR3); 182 | SNR4=get(handles.edit12,'string'); 183 | SNR4=str2double(SNR4); 184 | signal1_p=10.^(SNR1./10).*noise_p; 185 | signal2_p=10.^(SNR2./10).*noise_p; 186 | signal3_p=10.^(SNR3./10).*noise_p; 187 | signal4_p=10.^(SNR4./10).*noise_p; 188 | des1=get(handles.edit15,'string'); 189 | des1=str2double(des1); 190 | des2=get(handles.edit16,'string'); 191 | des2=str2double(des2); 192 | des3=get(handles.edit17,'string'); 193 | des3=str2double(des3); 194 | des4=get(handles.edit18,'string'); 195 | des4=str2double(des4); 196 | xc(1,des1)=signal1_p; 197 | xc(1,des2)=signal2_p; 198 | xc(1,des3)=signal3_p; 199 | xc(1,des4)=signal4_p; 200 | N=get(handles.edit13,'string'); 201 | N=str2double(N); 202 | pro_N=get(handles.edit7,'string'); 203 | pro_N=str2double(pro_N); 204 | PAD=get(handles.edit14,'string'); 205 | PAD=str2double(PAD); 206 | k=2.*N./4; 207 | if get(handles.radiobutton5,'value')&&get(handles.radiobutton2,'value') 208 | [ index, XT ] = cfar_ac( xc, N, pro_N, PAD); 209 | end 210 | if get(handles.radiobutton6,'value')&&get(handles.radiobutton2,'value') 211 | [ index, XT ] = cfar_go( xc, N, pro_N, PAD); 212 | end 213 | if get(handles.radiobutton7,'value')&&get(handles.radiobutton2,'value') 214 | [ index, XT ] = cfar_os( abs(xc), N, k, pro_N, PAD); 215 | end 216 | if get(handles.radiobutton8,'value')&&get(handles.radiobutton2,'value') 217 | [ index, XT ] = cfar_so( xc, N, pro_N, PAD); 218 | end 219 | end 220 | if get(handles.radiobutton4,'value')&&get(handles.radiobutton2,'value') 221 | SNR1=get(handles.edit4,'string'); 222 | SNR1=str2double(SNR1); 223 | SNR2=get(handles.edit5,'string'); 224 | SNR2=str2double(SNR2); 225 | SNR3=get(handles.edit11,'string'); 226 | SNR3=str2double(SNR3); 227 | SNR4=get(handles.edit12,'string'); 228 | SNR4=str2double(SNR4); 229 | SNR5=get(handles.edit19,'string'); 230 | SNR5=str2double(SNR5); 231 | SNR6=get(handles.edit20,'string'); 232 | SNR6=str2double(SNR6); 233 | signal1_p=10.^(SNR1./10).*noise_p(1,end); 234 | signal2_p=10.^(SNR2./10).*noise_p(1,end); 235 | signal3_p=10.^(SNR3./10).*noise_p(1,end); 236 | signal4_p=10.^(SNR4./10).*noise_p(1,end); 237 | signal5_p=10.^(SNR4./10).*noise_p(1,end); 238 | signal6_p=10.^(SNR4./10).*noise_p(1,end); 239 | des1=get(handles.edit15,'string'); 240 | des1=str2double(des1); 241 | des2=get(handles.edit16,'string'); 242 | des2=str2double(des2); 243 | des3=get(handles.edit17,'string'); 244 | des3=str2double(des3); 245 | des4=get(handles.edit18,'string'); 246 | des4=str2double(des4); 247 | des5=get(handles.edit21,'string'); 248 | des5=str2double(des5); 249 | des6=get(handles.edit22,'string'); 250 | des6=str2double(des6); 251 | xc(1,des1)=signal1_p; 252 | xc(1,des2)=signal2_p; 253 | xc(1,des3)=signal3_p; 254 | xc(1,des4)=signal4_p; 255 | xc(1,des5)=signal5_p; 256 | xc(1,des6)=signal6_p; 257 | N=get(handles.edit13,'string'); 258 | N=str2double(N); 259 | pro_N=get(handles.edit7,'string'); 260 | pro_N=str2double(pro_N); 261 | PAD=get(handles.edit14,'string'); 262 | PAD=str2double(PAD); 263 | k=2.*N./4; 264 | if get(handles.radiobutton5,'value')&&get(handles.radiobutton2,'value') 265 | [ index, XT ] = cfar_ac( xc, N, pro_N, PAD); 266 | end 267 | if get(handles.radiobutton6,'value')&&get(handles.radiobutton2,'value') 268 | [ index, XT ] = cfar_go( xc, N, pro_N, PAD); 269 | end 270 | if get(handles.radiobutton7,'value')&&get(handles.radiobutton2,'value') 271 | [ index, XT ] = cfar_os( abs(xc), N, k, pro_N, PAD); 272 | end 273 | if get(handles.radiobutton8,'value')&&get(handles.radiobutton2,'value') 274 | [ index, XT ] = cfar_so( xc, N, pro_N, PAD); 275 | end 276 | end 277 | axes(handles.axes2); 278 | cla reset 279 | if get(handles.radiobutton1,'value') 280 | plot(10.*log(abs(xc))./log(10)),hold on; 281 | plot(des1,10.*log(abs(xc(1,des1)))./log(10),'r*', 'LineWidth',10),hold on; 282 | plot(index,10.*log(abs(XT))./log(10),'g'); 283 | legend('回波','目标','检测门限') 284 | end 285 | if get(handles.radiobutton2,'value')&&get(handles.radiobutton3,'value') 286 | plot(10.*log(abs(xc))./log(10)),hold on; 287 | plot(des1,10.*log(abs(xc(1,des1)))./log(10),'r*', 'LineWidth',10),hold on; 288 | plot(des2,10.*log(abs(xc(1,des2)))./log(10),'r*', 'LineWidth',10),hold on; 289 | plot(des3,10.*log(abs(xc(1,des3)))./log(10),'r*', 'LineWidth',10),hold on; 290 | plot(des4,10.*log(abs(xc(1,des4)))./log(10),'r*', 'LineWidth',10),hold on; 291 | plot(index,10.*log(abs(XT))./log(10),'g'); 292 | legend('回波','目标','目标','目标','目标','检测门限') 293 | end 294 | if get(handles.radiobutton2,'value')&&get(handles.radiobutton4,'value') 295 | plot(10.*log(abs(xc))./log(10)),hold on; 296 | plot(des1,10.*log(abs(xc(1,des1)))./log(10),'r*', 'LineWidth',10),hold on; 297 | plot(des2,10.*log(abs(xc(1,des2)))./log(10),'r*', 'LineWidth',10),hold on; 298 | plot(des3,10.*log(abs(xc(1,des3)))./log(10),'r*', 'LineWidth',10),hold on; 299 | plot(des4,10.*log(abs(xc(1,des4)))./log(10),'r*', 'LineWidth',10),hold on; 300 | plot(des5,10.*log(abs(xc(1,des5)))./log(10),'y*', 'LineWidth',10),hold on; 301 | plot(des6,10.*log(abs(xc(1,des6)))./log(10),'b*', 'LineWidth',10),hold on; 302 | plot(index,10.*log(abs(XT))./log(10),'g'); 303 | legend('回波','目标','目标','目标','目标','杂波边缘目标','杂波内目标','检测门限') 304 | end 305 | 306 | function edit1_Callback(hObject, eventdata, handles) 307 | % hObject handle to edit1 (see GCBO) 308 | % eventdata reserved - to be defined in a future version of MATLAB 309 | % handles structure with handles and user data (see GUIDATA) 310 | 311 | % Hints: get(hObject,'String') returns contents of edit1 as text 312 | % str2double(get(hObject,'String')) returns contents of edit1 as a double 313 | 314 | 315 | % --- Executes during object creation, after setting all properties. 316 | function edit1_CreateFcn(hObject, eventdata, handles) 317 | % hObject handle to edit1 (see GCBO) 318 | % eventdata reserved - to be defined in a future version of MATLAB 319 | % handles empty - handles not created until after all CreateFcns called 320 | 321 | % Hint: edit controls usually have a white background on Windows. 322 | % See ISPC and COMPUTER. 323 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 324 | set(hObject,'BackgroundColor','white'); 325 | end 326 | 327 | 328 | 329 | 330 | function edit2_Callback(hObject, eventdata, handles) 331 | % hObject handle to edit2 (see GCBO) 332 | % eventdata reserved - to be defined in a future version of MATLAB 333 | % handles structure with handles and user data (see GUIDATA) 334 | 335 | % Hints: get(hObject,'String') returns contents of edit2 as text 336 | % str2double(get(hObject,'String')) returns contents of edit2 as a double 337 | 338 | 339 | % --- Executes during object creation, after setting all properties. 340 | function edit2_CreateFcn(hObject, eventdata, handles) 341 | % hObject handle to edit2 (see GCBO) 342 | % eventdata reserved - to be defined in a future version of MATLAB 343 | % handles empty - handles not created until after all CreateFcns called 344 | 345 | % Hint: edit controls usually have a white background on Windows. 346 | % See ISPC and COMPUTER. 347 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 348 | set(hObject,'BackgroundColor','white'); 349 | end 350 | 351 | 352 | 353 | function edit4_Callback(hObject, eventdata, handles) 354 | % hObject handle to edit4 (see GCBO) 355 | % eventdata reserved - to be defined in a future version of MATLAB 356 | % handles structure with handles and user data (see GUIDATA) 357 | 358 | % Hints: get(hObject,'String') returns contents of edit4 as text 359 | % str2double(get(hObject,'String')) returns contents of edit4 as a double 360 | 361 | 362 | % --- Executes during object creation, after setting all properties. 363 | function edit4_CreateFcn(hObject, eventdata, handles) 364 | % hObject handle to edit4 (see GCBO) 365 | % eventdata reserved - to be defined in a future version of MATLAB 366 | % handles empty - handles not created until after all CreateFcns called 367 | 368 | % Hint: edit controls usually have a white background on Windows. 369 | % See ISPC and COMPUTER. 370 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 371 | set(hObject,'BackgroundColor','white'); 372 | end 373 | 374 | 375 | 376 | function edit5_Callback(hObject, eventdata, handles) 377 | % hObject handle to edit5 (see GCBO) 378 | % eventdata reserved - to be defined in a future version of MATLAB 379 | % handles structure with handles and user data (see GUIDATA) 380 | 381 | % Hints: get(hObject,'String') returns contents of edit5 as text 382 | % str2double(get(hObject,'String')) returns contents of edit5 as a double 383 | 384 | 385 | % --- Executes during object creation, after setting all properties. 386 | function edit5_CreateFcn(hObject, eventdata, handles) 387 | % hObject handle to edit5 (see GCBO) 388 | % eventdata reserved - to be defined in a future version of MATLAB 389 | % handles empty - handles not created until after all CreateFcns called 390 | 391 | % Hint: edit controls usually have a white background on Windows. 392 | % See ISPC and COMPUTER. 393 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 394 | set(hObject,'BackgroundColor','white'); 395 | end 396 | 397 | 398 | 399 | function edit7_Callback(hObject, eventdata, handles) 400 | % hObject handle to edit7 (see GCBO) 401 | % eventdata reserved - to be defined in a future version of MATLAB 402 | % handles structure with handles and user data (see GUIDATA) 403 | 404 | % Hints: get(hObject,'String') returns contents of edit7 as text 405 | % str2double(get(hObject,'String')) returns contents of edit7 as a double 406 | 407 | 408 | % --- Executes during object creation, after setting all properties. 409 | function edit7_CreateFcn(hObject, eventdata, handles) 410 | % hObject handle to edit7 (see GCBO) 411 | % eventdata reserved - to be defined in a future version of MATLAB 412 | % handles empty - handles not created until after all CreateFcns called 413 | 414 | % Hint: edit controls usually have a white background on Windows. 415 | % See ISPC and COMPUTER. 416 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 417 | set(hObject,'BackgroundColor','white'); 418 | end 419 | 420 | 421 | 422 | function edit8_Callback(hObject, eventdata, handles) 423 | % hObject handle to edit8 (see GCBO) 424 | % eventdata reserved - to be defined in a future version of MATLAB 425 | % handles structure with handles and user data (see GUIDATA) 426 | 427 | % Hints: get(hObject,'String') returns contents of edit8 as text 428 | % str2double(get(hObject,'String')) returns contents of edit8 as a double 429 | 430 | 431 | % --- Executes during object creation, after setting all properties. 432 | function edit8_CreateFcn(hObject, eventdata, handles) 433 | % hObject handle to edit8 (see GCBO) 434 | % eventdata reserved - to be defined in a future version of MATLAB 435 | % handles empty - handles not created until after all CreateFcns called 436 | 437 | % Hint: edit controls usually have a white background on Windows. 438 | % See ISPC and COMPUTER. 439 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 440 | set(hObject,'BackgroundColor','white'); 441 | end 442 | 443 | 444 | 445 | function edit9_Callback(hObject, eventdata, handles) 446 | % hObject handle to edit9 (see GCBO) 447 | % eventdata reserved - to be defined in a future version of MATLAB 448 | % handles structure with handles and user data (see GUIDATA) 449 | 450 | % Hints: get(hObject,'String') returns contents of edit9 as text 451 | % str2double(get(hObject,'String')) returns contents of edit9 as a double 452 | 453 | 454 | % --- Executes during object creation, after setting all properties. 455 | function edit9_CreateFcn(hObject, eventdata, handles) 456 | % hObject handle to edit9 (see GCBO) 457 | % eventdata reserved - to be defined in a future version of MATLAB 458 | % handles empty - handles not created until after all CreateFcns called 459 | 460 | % Hint: edit controls usually have a white background on Windows. 461 | % See ISPC and COMPUTER. 462 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 463 | set(hObject,'BackgroundColor','white'); 464 | end 465 | 466 | 467 | 468 | function edit10_Callback(hObject, eventdata, handles) 469 | % hObject handle to edit10 (see GCBO) 470 | % eventdata reserved - to be defined in a future version of MATLAB 471 | % handles structure with handles and user data (see GUIDATA) 472 | 473 | % Hints: get(hObject,'String') returns contents of edit10 as text 474 | % str2double(get(hObject,'String')) returns contents of edit10 as a double 475 | 476 | 477 | % --- Executes during object creation, after setting all properties. 478 | function edit10_CreateFcn(hObject, eventdata, handles) 479 | % hObject handle to edit10 (see GCBO) 480 | % eventdata reserved - to be defined in a future version of MATLAB 481 | % handles empty - handles not created until after all CreateFcns called 482 | 483 | % Hint: edit controls usually have a white background on Windows. 484 | % See ISPC and COMPUTER. 485 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 486 | set(hObject,'BackgroundColor','white'); 487 | end 488 | 489 | 490 | 491 | function edit11_Callback(hObject, eventdata, handles) 492 | % hObject handle to edit11 (see GCBO) 493 | % eventdata reserved - to be defined in a future version of MATLAB 494 | % handles structure with handles and user data (see GUIDATA) 495 | 496 | % Hints: get(hObject,'String') returns contents of edit11 as text 497 | % str2double(get(hObject,'String')) returns contents of edit11 as a double 498 | 499 | 500 | % --- Executes during object creation, after setting all properties. 501 | function edit11_CreateFcn(hObject, eventdata, handles) 502 | % hObject handle to edit11 (see GCBO) 503 | % eventdata reserved - to be defined in a future version of MATLAB 504 | % handles empty - handles not created until after all CreateFcns called 505 | 506 | % Hint: edit controls usually have a white background on Windows. 507 | % See ISPC and COMPUTER. 508 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 509 | set(hObject,'BackgroundColor','white'); 510 | end 511 | 512 | 513 | 514 | function edit12_Callback(hObject, eventdata, handles) 515 | % hObject handle to edit12 (see GCBO) 516 | % eventdata reserved - to be defined in a future version of MATLAB 517 | % handles structure with handles and user data (see GUIDATA) 518 | 519 | % Hints: get(hObject,'String') returns contents of edit12 as text 520 | % str2double(get(hObject,'String')) returns contents of edit12 as a double 521 | 522 | 523 | % --- Executes during object creation, after setting all properties. 524 | function edit12_CreateFcn(hObject, eventdata, handles) 525 | % hObject handle to edit12 (see GCBO) 526 | % eventdata reserved - to be defined in a future version of MATLAB 527 | % handles empty - handles not created until after all CreateFcns called 528 | 529 | % Hint: edit controls usually have a white background on Windows. 530 | % See ISPC and COMPUTER. 531 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 532 | set(hObject,'BackgroundColor','white'); 533 | end 534 | 535 | 536 | 537 | function edit13_Callback(hObject, eventdata, handles) 538 | % hObject handle to edit13 (see GCBO) 539 | % eventdata reserved - to be defined in a future version of MATLAB 540 | % handles structure with handles and user data (see GUIDATA) 541 | 542 | % Hints: get(hObject,'String') returns contents of edit13 as text 543 | % str2double(get(hObject,'String')) returns contents of edit13 as a double 544 | 545 | 546 | % --- Executes during object creation, after setting all properties. 547 | function edit13_CreateFcn(hObject, eventdata, handles) 548 | % hObject handle to edit13 (see GCBO) 549 | % eventdata reserved - to be defined in a future version of MATLAB 550 | % handles empty - handles not created until after all CreateFcns called 551 | 552 | % Hint: edit controls usually have a white background on Windows. 553 | % See ISPC and COMPUTER. 554 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 555 | set(hObject,'BackgroundColor','white'); 556 | end 557 | 558 | 559 | 560 | function edit14_Callback(hObject, eventdata, handles) 561 | % hObject handle to edit14 (see GCBO) 562 | % eventdata reserved - to be defined in a future version of MATLAB 563 | % handles structure with handles and user data (see GUIDATA) 564 | 565 | % Hints: get(hObject,'String') returns contents of edit14 as text 566 | % str2double(get(hObject,'String')) returns contents of edit14 as a double 567 | 568 | 569 | % --- Executes during object creation, after setting all properties. 570 | function edit14_CreateFcn(hObject, eventdata, handles) 571 | % hObject handle to edit14 (see GCBO) 572 | % eventdata reserved - to be defined in a future version of MATLAB 573 | % handles empty - handles not created until after all CreateFcns called 574 | 575 | % Hint: edit controls usually have a white background on Windows. 576 | % See ISPC and COMPUTER. 577 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 578 | set(hObject,'BackgroundColor','white'); 579 | end 580 | 581 | 582 | % --- Executes on button press in radiobutton5. 583 | function radiobutton5_Callback(hObject, eventdata, handles) 584 | % hObject handle to radiobutton5 (see GCBO) 585 | % eventdata reserved - to be defined in a future version of MATLAB 586 | % handles structure with handles and user data (see GUIDATA) 587 | 588 | % Hint: get(hObject,'Value') returns toggle state of radiobutton5 589 | 590 | 591 | % --- Executes on button press in radiobutton6. 592 | function radiobutton6_Callback(hObject, eventdata, handles) 593 | % hObject handle to radiobutton6 (see GCBO) 594 | % eventdata reserved - to be defined in a future version of MATLAB 595 | % handles structure with handles and user data (see GUIDATA) 596 | 597 | % Hint: get(hObject,'Value') returns toggle state of radiobutton6 598 | 599 | 600 | % --- Executes on button press in radiobutton7. 601 | function radiobutton7_Callback(hObject, eventdata, handles) 602 | % hObject handle to radiobutton7 (see GCBO) 603 | % eventdata reserved - to be defined in a future version of MATLAB 604 | % handles structure with handles and user data (see GUIDATA) 605 | 606 | % Hint: get(hObject,'Value') returns toggle state of radiobutton7 607 | 608 | 609 | % --- Executes on button press in radiobutton8. 610 | function radiobutton8_Callback(hObject, eventdata, handles) 611 | % hObject handle to radiobutton8 (see GCBO) 612 | % eventdata reserved - to be defined in a future version of MATLAB 613 | % handles structure with handles and user data (see GUIDATA) 614 | 615 | % Hint: get(hObject,'Value') returns toggle state of radiobutton8 616 | 617 | 618 | % --- Executes on button press in radiobutton9. 619 | function radiobutton9_Callback(hObject, eventdata, handles) 620 | % hObject handle to radiobutton9 (see GCBO) 621 | % eventdata reserved - to be defined in a future version of MATLAB 622 | % handles structure with handles and user data (see GUIDATA) 623 | 624 | % Hint: get(hObject,'Value') returns toggle state of radiobutton9 625 | 626 | 627 | % --- Executes on button press in radiobutton4. 628 | function radiobutton4_Callback(hObject, eventdata, handles) 629 | % hObject handle to radiobutton4 (see GCBO) 630 | % eventdata reserved - to be defined in a future version of MATLAB 631 | % handles structure with handles and user data (see GUIDATA) 632 | 633 | % Hint: get(hObject,'Value') returns toggle state of radiobutton4 634 | if get(handles.radiobutton4,'value') 635 | set(handles.edit1,'enable','on') 636 | set(handles.edit9,'enable','on') 637 | end 638 | 639 | % --- Executes on button press in radiobutton3. 640 | function radiobutton3_Callback(hObject, eventdata, handles) 641 | % hObject handle to radiobutton3 (see GCBO) 642 | % eventdata reserved - to be defined in a future version of MATLAB 643 | % handles structure with handles and user data (see GUIDATA) 644 | 645 | % Hint: get(hObject,'Value') returns toggle state of radiobutton3 646 | if get(handles.radiobutton3,'value') 647 | set(handles.edit1,'enable','off') 648 | set(handles.edit9,'enable','off') 649 | end 650 | 651 | % --- Executes on button press in radiobutton1. 652 | function radiobutton1_Callback(hObject, eventdata, handles) 653 | % hObject handle to radiobutton1 (see GCBO) 654 | % eventdata reserved - to be defined in a future version of MATLAB 655 | % handles structure with handles and user data (see GUIDATA) 656 | 657 | % Hint: get(hObject,'Value') returns toggle state of radiobutton1 658 | if get(handles.radiobutton1,'value') 659 | set(handles.edit5,'enable','off') 660 | set(handles.edit11,'enable','off') 661 | set(handles.edit12,'enable','off') 662 | set(handles.edit19,'enable','off') 663 | set(handles.edit20,'enable','off') 664 | set(handles.edit16,'enable','off') 665 | set(handles.edit17,'enable','off') 666 | set(handles.edit18,'enable','off') 667 | set(handles.edit21,'enable','off') 668 | set(handles.edit22,'enable','off') 669 | end 670 | % --- Executes on button press in radiobutton2. 671 | function radiobutton2_Callback(hObject, eventdata, handles) 672 | % hObject handle to radiobutton2 (see GCBO) 673 | % eventdata reserved - to be defined in a future version of MATLAB 674 | % handles structure with handles and user data (see GUIDATA) 675 | 676 | % Hint: get(hObject,'Value') returns toggle state of radiobutton2 677 | if get(handles.radiobutton2,'value') 678 | set(handles.edit5,'enable','on') 679 | set(handles.edit11,'enable','on') 680 | set(handles.edit12,'enable','on') 681 | set(handles.edit19,'enable','on') 682 | set(handles.edit20,'enable','on') 683 | set(handles.edit16,'enable','on') 684 | set(handles.edit17,'enable','on') 685 | set(handles.edit18,'enable','on') 686 | set(handles.edit21,'enable','on') 687 | set(handles.edit22,'enable','on') 688 | end 689 | 690 | 691 | % --- Executes on button press in pushbutton3. 692 | function pushbutton3_Callback(hObject, eventdata, handles) 693 | % hObject handle to pushbutton3 (see GCBO) 694 | % eventdata reserved - to be defined in a future version of MATLAB 695 | % handles structure with handles and user data (see GUIDATA) 696 | new_f_handle=figure('visible','off'); %新建一个不可见的figure 697 | new_axes=copyobj(handles.axes5,new_f_handle); %axes1是GUI界面内要保存图线的Tag,将其copy到不可见的figure中 698 | set(new_axes,'Units','normalized','Position',[0.1 0.1 0.8 0.8]);%将图线缩放 699 | [filename pathname fileindex]=uiputfile({'*.png';'*.bmp';'*.jpg';'*.eps';},'图片保存为'); 700 | if filename~=0%未点“取消”按钮或未关闭 701 | file=strcat(pathname,filename); 702 | switch fileindex %根据不同的选择保存为不同的类型 703 | case 1 704 | print(new_f_handle,'-dpng',file);% print(new_f_handle,'-dpng',filename);效果一样,将图像打印到指定文件中 705 | fprintf('>>已保存到:%s\n',file); 706 | case 2 707 | print(new_f_handle,'-dbmp',file); 708 | fprintf('>>已保存到:%s\n',file); 709 | case 3 710 | print(new_f_handle,'-djpeg',file); 711 | fprintf('>>已保存到:%s\n',file); 712 | case 4 713 | print(new_f_handle,'-depsc',file); 714 | fprintf('>>已保存到:%s\n',file); 715 | end 716 | msgbox(' 图线已成功保存!','完成!'); 717 | end 718 | 719 | % --- Executes on button press in pushbutton4. 720 | function pushbutton4_Callback(hObject, eventdata, handles) 721 | % hObject handle to pushbutton4 (see GCBO) 722 | % eventdata reserved - to be defined in a future version of MATLAB 723 | % handles structure with handles and user data (see GUIDATA) 724 | 725 | new_f_handle=figure('visible','off'); %新建一个不可见的figure 726 | new_axes=copyobj(handles.axes2,new_f_handle); %axes1是GUI界面内要保存图线的Tag,将其copy到不可见的figure中 727 | set(new_axes,'Units','normalized','Position',[0.1 0.1 0.8 0.8]);%将图线缩放 728 | [filename pathname fileindex]=uiputfile({'*.png';'*.bmp';'*.jpg';'*.eps';},'图片保存为'); 729 | if filename~=0%未点“取消”按钮或未关闭 730 | file=strcat(pathname,filename); 731 | switch fileindex %根据不同的选择保存为不同的类型 732 | case 1 733 | print(new_f_handle,'-dpng',file);% print(new_f_handle,'-dpng',filename);效果一样,将图像打印到指定文件中 734 | fprintf('>>已保存到:%s\n',file); 735 | case 2 736 | print(new_f_handle,'-dbmp',file); 737 | fprintf('>>已保存到:%s\n',file); 738 | case 3 739 | print(new_f_handle,'-djpeg',file); 740 | fprintf('>>已保存到:%s\n',file); 741 | case 4 742 | print(new_f_handle,'-depsc',file); 743 | fprintf('>>已保存到:%s\n',file); 744 | end 745 | msgbox(' 图线已成功保存!','完成!'); 746 | end 747 | 748 | function edit15_Callback(hObject, eventdata, handles) 749 | % hObject handle to edit15 (see GCBO) 750 | % eventdata reserved - to be defined in a future version of MATLAB 751 | % handles structure with handles and user data (see GUIDATA) 752 | 753 | % Hints: get(hObject,'String') returns contents of edit15 as text 754 | % str2double(get(hObject,'String')) returns contents of edit15 as a double 755 | 756 | 757 | % --- Executes during object creation, after setting all properties. 758 | function edit15_CreateFcn(hObject, eventdata, handles) 759 | % hObject handle to edit15 (see GCBO) 760 | % eventdata reserved - to be defined in a future version of MATLAB 761 | % handles empty - handles not created until after all CreateFcns called 762 | 763 | % Hint: edit controls usually have a white background on Windows. 764 | % See ISPC and COMPUTER. 765 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 766 | set(hObject,'BackgroundColor','white'); 767 | end 768 | 769 | 770 | 771 | function edit16_Callback(hObject, eventdata, handles) 772 | % hObject handle to edit16 (see GCBO) 773 | % eventdata reserved - to be defined in a future version of MATLAB 774 | % handles structure with handles and user data (see GUIDATA) 775 | 776 | % Hints: get(hObject,'String') returns contents of edit16 as text 777 | % str2double(get(hObject,'String')) returns contents of edit16 as a double 778 | 779 | 780 | % --- Executes during object creation, after setting all properties. 781 | function edit16_CreateFcn(hObject, eventdata, handles) 782 | % hObject handle to edit16 (see GCBO) 783 | % eventdata reserved - to be defined in a future version of MATLAB 784 | % handles empty - handles not created until after all CreateFcns called 785 | 786 | % Hint: edit controls usually have a white background on Windows. 787 | % See ISPC and COMPUTER. 788 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 789 | set(hObject,'BackgroundColor','white'); 790 | end 791 | 792 | 793 | 794 | function edit17_Callback(hObject, eventdata, handles) 795 | % hObject handle to edit17 (see GCBO) 796 | % eventdata reserved - to be defined in a future version of MATLAB 797 | % handles structure with handles and user data (see GUIDATA) 798 | 799 | % Hints: get(hObject,'String') returns contents of edit17 as text 800 | % str2double(get(hObject,'String')) returns contents of edit17 as a double 801 | 802 | 803 | % --- Executes during object creation, after setting all properties. 804 | function edit17_CreateFcn(hObject, eventdata, handles) 805 | % hObject handle to edit17 (see GCBO) 806 | % eventdata reserved - to be defined in a future version of MATLAB 807 | % handles empty - handles not created until after all CreateFcns called 808 | 809 | % Hint: edit controls usually have a white background on Windows. 810 | % See ISPC and COMPUTER. 811 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 812 | set(hObject,'BackgroundColor','white'); 813 | end 814 | 815 | 816 | 817 | function edit18_Callback(hObject, eventdata, handles) 818 | % hObject handle to edit18 (see GCBO) 819 | % eventdata reserved - to be defined in a future version of MATLAB 820 | % handles structure with handles and user data (see GUIDATA) 821 | 822 | % Hints: get(hObject,'String') returns contents of edit18 as text 823 | % str2double(get(hObject,'String')) returns contents of edit18 as a double 824 | 825 | 826 | % --- Executes during object creation, after setting all properties. 827 | function edit18_CreateFcn(hObject, eventdata, handles) 828 | % hObject handle to edit18 (see GCBO) 829 | % eventdata reserved - to be defined in a future version of MATLAB 830 | % handles empty - handles not created until after all CreateFcns called 831 | 832 | % Hint: edit controls usually have a white background on Windows. 833 | % See ISPC and COMPUTER. 834 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 835 | set(hObject,'BackgroundColor','white'); 836 | end 837 | 838 | 839 | 840 | function edit19_Callback(hObject, eventdata, handles) 841 | % hObject handle to edit19 (see GCBO) 842 | % eventdata reserved - to be defined in a future version of MATLAB 843 | % handles structure with handles and user data (see GUIDATA) 844 | 845 | % Hints: get(hObject,'String') returns contents of edit19 as text 846 | % str2double(get(hObject,'String')) returns contents of edit19 as a double 847 | 848 | 849 | % --- Executes during object creation, after setting all properties. 850 | function edit19_CreateFcn(hObject, eventdata, handles) 851 | % hObject handle to edit19 (see GCBO) 852 | % eventdata reserved - to be defined in a future version of MATLAB 853 | % handles empty - handles not created until after all CreateFcns called 854 | 855 | % Hint: edit controls usually have a white background on Windows. 856 | % See ISPC and COMPUTER. 857 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 858 | set(hObject,'BackgroundColor','white'); 859 | end 860 | 861 | 862 | 863 | function edit20_Callback(hObject, eventdata, handles) 864 | % hObject handle to edit20 (see GCBO) 865 | % eventdata reserved - to be defined in a future version of MATLAB 866 | % handles structure with handles and user data (see GUIDATA) 867 | 868 | % Hints: get(hObject,'String') returns contents of edit20 as text 869 | % str2double(get(hObject,'String')) returns contents of edit20 as a double 870 | 871 | 872 | % --- Executes during object creation, after setting all properties. 873 | function edit20_CreateFcn(hObject, eventdata, handles) 874 | % hObject handle to edit20 (see GCBO) 875 | % eventdata reserved - to be defined in a future version of MATLAB 876 | % handles empty - handles not created until after all CreateFcns called 877 | 878 | % Hint: edit controls usually have a white background on Windows. 879 | % See ISPC and COMPUTER. 880 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 881 | set(hObject,'BackgroundColor','white'); 882 | end 883 | 884 | 885 | 886 | function edit21_Callback(hObject, eventdata, handles) 887 | % hObject handle to edit21 (see GCBO) 888 | % eventdata reserved - to be defined in a future version of MATLAB 889 | % handles structure with handles and user data (see GUIDATA) 890 | 891 | % Hints: get(hObject,'String') returns contents of edit21 as text 892 | % str2double(get(hObject,'String')) returns contents of edit21 as a double 893 | 894 | 895 | % --- Executes during object creation, after setting all properties. 896 | function edit21_CreateFcn(hObject, eventdata, handles) 897 | % hObject handle to edit21 (see GCBO) 898 | % eventdata reserved - to be defined in a future version of MATLAB 899 | % handles empty - handles not created until after all CreateFcns called 900 | 901 | % Hint: edit controls usually have a white background on Windows. 902 | % See ISPC and COMPUTER. 903 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 904 | set(hObject,'BackgroundColor','white'); 905 | end 906 | 907 | 908 | 909 | function edit22_Callback(hObject, eventdata, handles) 910 | % hObject handle to edit22 (see GCBO) 911 | % eventdata reserved - to be defined in a future version of MATLAB 912 | % handles structure with handles and user data (see GUIDATA) 913 | 914 | % Hints: get(hObject,'String') returns contents of edit22 as text 915 | % str2double(get(hObject,'String')) returns contents of edit22 as a double 916 | 917 | 918 | % --- Executes during object creation, after setting all properties. 919 | function edit22_CreateFcn(hObject, eventdata, handles) 920 | % hObject handle to edit22 (see GCBO) 921 | % eventdata reserved - to be defined in a future version of MATLAB 922 | % handles empty - handles not created until after all CreateFcns called 923 | 924 | % Hint: edit controls usually have a white background on Windows. 925 | % See ISPC and COMPUTER. 926 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 927 | set(hObject,'BackgroundColor','white'); 928 | end 929 | -------------------------------------------------------------------------------- /cfar_ac.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/cfar_ac.m -------------------------------------------------------------------------------- /cfar_go.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/cfar_go.m -------------------------------------------------------------------------------- /cfar_os.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/cfar_os.m -------------------------------------------------------------------------------- /cfar_so.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/cfar_so.m -------------------------------------------------------------------------------- /cfar_tc.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/cfar_tc.m -------------------------------------------------------------------------------- /env_edge.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/env_edge.m -------------------------------------------------------------------------------- /env_uniform.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fzzfbyx/CFAR-radar-algorithm_MATLAB_GUI/592a43e9cb2276fa41eef5a0288f96d8f3df5cda/env_uniform.m --------------------------------------------------------------------------------