📄 setcal1.m
字号:
function setcal1(calMethod, calFile, nearfieldMethod)%SETCAL1 Reads calibration info. from file and sets the cal. method for the steering matrix for the AIMT experimental antenna.%%--------%Synopsis:% setcal1(calMethod, calFile, nearfieldMethod)%%Description:% Reads calibration compensation information for the experimental antenna% from the file "calFile" and sets the calibration method for the steering% vector calculation. Both compensation for coupling and for near field% can be set.% This function can be used several times. It must be used at least once% before doing signal processing on the received antenna signals.%% The set compensations method takes effekt immediately and remains in effekt% till the next "setcal1" command.%% Calibration compensation for coupling and near field can also be performed% on the signals with the function "sigcomp2". Make sure that compensation% of coupling and/or near field is not done both with "setcal1" and% "sigcomp2".%% The calibration compensation information is stored in global variables% due to optimization of speed and memory. These global variables are used% in "wscordbt" via "spastemat" (when compensating the steering matrix).% It is possible to change these global% variables directly to for example make thinner correction tables. Ask% Lars Petterson for details.%%Output and Input:% calMethod (StringT)% = 'Ccmp': Use decoupling matrix.% = 'wctab': Use a table of corrections for different directions.% = 'wcmedel': See []% = 'nocomp': No compensation will be used.% calFile (StringT): Name of file with calibration compensation information.% It normally ends with ".dbc". If this function already has been executed, % this file name can be omitted. In this case, the information% used is from the file, that was latest given as input parameter to% "setcal1".% nearfieldMethod [D](StringT)% = 'nearfldcomp': Nearfield compensation will be done (default).% = 'nocomp': No nearfield compensation.%%Global Variables:% c0 (RealScalarT): Propagation speed of light. Created in "defant".% xel% Rmeas% deltaz0% dxel0% th3dBV% fRFth3dBV% dipl% nely% hel% Ccmp (CxMatrixT): Decoupling matrix. Created in "setcal1". Used in% "wscorrdbt" and ...% wctab (CxMatrixT): Table of corrections for different directions.% Created in "setcal1". Used in "wscorrdbt" and ...% phitab:% wcmedel (CxMatrix): Correction vector for the "wcmedel" method.% Created in "setcal1". Used in "wscorrdbt" and ...% wcmat (CxMatrix): Correction vector for channel erros or drift since% last calibration of coupling (Ccmp or wctab). Created in "setcal1".% Used in "wscorrdbt" and ...% Ccmpfile Wcmpfile% cmpmetGlobal% nearfieldMethodFlagGlobal% expCalVerG (IntScalarT)(out): Version of the calibration information. Used% in spastemat.% expCalFileG (StringT)(out): Name of used calibration file (.dbs).%%%--------%Notations:% Data type names are shown in parentheses and they start with a capital% letter and end with a capital T. Data type definitions can be found in [1]% or by "help dbtdata".% [D] = This parameter can be omitted and then a default value is used.% When the [D]-input parameter is not the last used in the call, it must be% given the value [], i.e. an empty matrix.% ... = There can be more parameters. They are explained under respective% metod or choice.%%Examples:% % Set calibration method and factors.% dataFileName = 'datafil1';% if (strcmp(methodCh,'rmusic') | strcmp(methodCh,'esprit'))% setcal1('nocomp',[dataFileName, '.dbc'],'nocomp')% sig = sigcomp2(sig, [dataFileName, '.dbc'], 'Ccmp', [], 'nearfldcomp');% else % setcal1('wctab',[dataFileName, '.dbc'], 'nearfldcomp')% end%if%%Software Quality:% (About what is done to ascertain software quality. What tests are done.)%Known Bugs:%References:% [1]: Bj鰎klund S.: "DBT, A MATLAB Toolbox for Radar Signal Processing.% Reference Guide", FOA-D--9x-00xxx-408--SE, To be published.% [2]: Pettersson L.: "講ersiktlig beskrivning av m鋞dataanalysprogram f鰎% digital experimentantenn", FOA-D--96-00226-3.2--SE, FOA February 1996.%%See Also:% defant, sigcomp2, dbtex9, dbtex10, expsig1% * DBT, A Matlab Toolbox for Radar Signal Processing *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.%% Start : 970615 Svante Bj鰎klund (svabj).% Latest change: $Date: 2000/10/16 15:21:35 $ $Author: svabj $.% $Revision: 1.20 $% *****************************************************************************%disp('setcal1')% ----------------------------------------------------------------------- %% Handle input parameters.% ----------------------------------------------------------------------- %if (nargin < 1) error('DBT-Error: To few input parameters.')end% ****************** Add missing input parameters ******************if (nargin < 2) calFile = [];endif (nargin < 3) nearfieldMethod = [];end% ****************** Default values ******************global expCalVerG % Version of the calibration information. % Used in spastemat.global expCalFileG % Name of used calibration file (.dbs).if (~isempty(calFile)) expCalVerG = matgetm(calFile,'exp2dbtversion'); expCalFileG = calFile;else calFile = '';end%if%fprintf('setcal1:expCalVerG=%d\n',expCalVerG)if (isempty(nearfieldMethod)) nearfieldMethod = 'nearfldcomp';end%if% ****************** Error check input parameters ******************chkdtype(calMethod, 'StringT')chkdtype(calFile, 'StringT')chkdtype(nearfieldMethod, 'StringT')% ****************** Pick out fields from input parameters. ******************% ----------------------------------------------------------------------- %% Read calibration compensation information from file..% ----------------------------------------------------------------------- %if ((expCalVerG == 2) | expCalVerG == 3) global c0 % Created in defant. global xel Rmeas deltaz0 dxel0 th3dBV fRFth3dBV dipl nely hel global Ccmp wctab phitab wcmedel wcmat Ccmpfile Wcmpfile global cmpmetGlobal nearfieldMethodFlagGlobal if (~isempty(calFile)) load(calFile,'-mat') phitab = asin(sphitab); end%if cmpmetGlobal = calMethod; if (strcmp(nearfieldMethod,'nearfldcomp')) nearfieldMethodFlagGlobal = 1; elseif (strcmp(nearfieldMethod,'nocomp')) nearfieldMethodFlagGlobal = 0; else error('DBT-Error: Wrong nearfieldMethod in setcal1.'); endelse error('DBT-Error: Wrong version of the file ',calFile)end%if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -