📄 defsources.m
字号:
function srcDef = defsources(srcList, trgCorrMx)%DEFSOURCES: Sets all sources up as a struct variable of type SourcesDefT%%Synopsis:% srcDef = defsources(srcList)% srcDef = defsources(srcList, trgCorrMx)%%Description:% Defines a struct variable containing all information needed by% function "simradarsig" in combination with the functions "simtarget",% "simnoise", "simclutter" and "simjammer" to simulate the radarsignal% from all different sources. Variables is collected in a more efficient% way, so that the simulation process can be made as fast as possible.%%Input:% srcList (Cell Array Of : Cell array with definitions of sources% TargetDefT, See deftarget, defnoise,defclutter and% NoiseDefT, defjammer for more info.% ClutterDefT% and/or JammerDefT)%% trgCorrMx (CxMatrixT) : Correlation matrix for targets. Correlation% between targets. Default is no correlation.%%OutPut:% srcDef (SourcesDefT) : A definition of the sources in a struct variable%%--------%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".%%Examples:% trg1 = deftarget('swerling0', 1.2, 6000, [d2r(25); 0], 2);% trg2 = deftarget('swerling0', 0.6, 1000, [d2r(18); 0], -2);% trg3 = deftarget('swerling0', 0.8, 730000, [d2r(-3); 0], 0);% noiseSrc1 = defnoise('Gaussian', 0.3, eye(noChannels));% clSrc1 = defclutter('MIT-LCE', {6000 4 50}, 10, d2r(-30):0.01:d2r(30));% sources = defsources({trg1 trg2 noiseSrc1 trg3 clutterSrc1}, eye(3));% First a definition of several targets and then finally combining all% these sources into a struct so that simulation can be made easier.% The list of sources does not need to be in any specific order.%%%Software Quality:% Multiple noise sources and clutter sources not tested.%%Known Bugs:%%References:% [1]: Bj鰎klund S., Rejdemyhr D. Athley F.: "DBT, A MATLAB Toolbox% for Radar Signal Processing. Reference Guide",% FOA-D--9x-00xxx-408--SE, To be published.%%See also:% defnoise defclutter deftarget defjammer simradarsig% * DBT, A Matlab Toolbox for Radar Signal Processing *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.%% Initiation : 981001 David Rejdemyhr (davrej).% Latest change : $Date: 2000/10/16 15:20:33 $ $Author: svabj $.% $Revision : 1.0 $%*************************************************************************%------------------------------------------------------------------------%---- In-parameter control & default values handling ----%------------------------------------------------------------------------if nargin < 2 trgCorrMx = []; % Defaults to no correlation between targetsend %ifif nargin < 1 error('To few input parameters, give me atleast one source!');end %if%------------------------------------------------------------------------%---- Setting up the output parameter ----%------------------------------------------------------------------------noSrcs = length(srcList);noTargets = 0; % Number of targetsnoNoiseSrcs = 0; % Number of noise sourcesnoClutterSrcs = 0; % Number of clutter sourcesnoJammers = 0; % Number of jammerssrcDef.dataType = 'SourcesDefT';for srcIx = 1: noSrcs currentSrc = srcList{srcIx}; if (~isempty(currentSrc)) if (strcmp(currentSrc.dataType, 'TargetDefT')) noTargets = noTargets +1; infoStr = ['Adding a target of type: ' currentSrc.Type '.']; dbtinfo(infoStr); srcDef.Targets.Types{noTargets} = currentSrc.Type; srcDef.Targets.Powers(noTargets) = currentSrc.Power; srcDef.Targets.Ranges(noTargets) = currentSrc.Range; srcDef.Targets.DOAs(:,noTargets) = currentSrc.DOA; srcDef.Targets.Velocities(noTargets) = currentSrc.Velocity; elseif strcmp(currentSrc.dataType, 'NoiseDefT') infoStr = ['Adding noise of type: ' currentSrc.Type '.']; dbtinfo(infoStr); noNoiseSrcs = noNoiseSrcs + 1; srcDef.NoiseSources.Types{noNoiseSrcs} = currentSrc.Type; srcDef.NoiseSources.Powers{noNoiseSrcs} = currentSrc.Power; srcDef.NoiseSources.CorrMxs{noNoiseSrcs} = currentSrc.CorrMx; elseif strcmp(currentSrc.dataType, 'ClutterDefT') infoStr = ['Adding clutter of type: ' currentSrc.Type '.']; dbtinfo(infoStr); noClutterSrcs = noClutterSrcs + 1; srcDef.Clutter = currentSrc;% srcDef.Clutter.Types{noClutterSrcs} = currentSrc.Type;% % To be used if multiple clutter sources comes alive% srcDef.Clutter.TypeParams{noClutterSrcs} = currentSrc.TypeParam;% srcDef.Clutter.Power{noClutterSrcs} = currentSrc.Power;% srcDef.Clutter.DOAs{noClutterSrcs} = currentSrc.DOAs;% srcDef.Clutter.TransAnt{noClutterSrcs} = currentSrc.TransAnt;% srcDef.Clutter.Type = currentSrc.Type;% srcDef.Clutter.TypeParam = currentSrc.TypeParam;% srcDef.Clutter.Power = currentSrc.Power;% srcDef.Clutter.DOAs = currentSrc.DOAs;% srcDef.Clutter.TransAnt = currentSrc.TransAnt;% srcDef.Clutter.PlatHeight = currentSrc.PlatHeight;% srcDef.Clutter.PlatVelocity = currentSrc.PlatVelocity; elseif strcmp(currentSrc.dataType, 'JammerDefT') noJammer = noJammer + 1; dbtwarning('Jammer is not yet available, ignoring jammers...') end%if end%if (~isempty(currentSrc))end%for srcIx%------------------------------------------------------------------------%---- Setting up the correlation matrices ----%------------------------------------------------------------------------if isfield(srcDef, 'Targets') % If there was any targets defined. if isempty(trgCorrMx) trgCorrMx = eye(noTargets); end %if srcDef.Targets.CorrMx = trgCorrMx;end %if%End Of File -------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -