📄 sigsubix.m
字号:
function sigOut = sigsubix(sigIn, pulseIx, rangeIx, channelIx, extraIx, cpiIx, trialIx, checkParamFlag)%SIGSUBIX Gets some specified elements (indices) of the radar signal.%%--------%Synopsis:% sigOut = sigsubix(sigIn, pulseIx, rangeIx, channelIx)% sigOut = sigsubix(sigIn, pulseIx, rangeIx, channelIx, [], cpiIx)%%Description:% Gets a subpart of the input radar signal, which is specified by indices% for pulses, ranges, channels etc.%% The specification "pulseIx", "rangeIx" etc. specifies the indices to% use in the current multi-dimensional matrix which contains the radar% signal and does not specify the indices in the original radar signal.% On the other hand, what is stored in the fields "sigOut.pulIx",% "sigOut.ranIx" and "sigOut.spaIx" are the remaining indices of the % original signal.%%Output and Input:% sigOut (RxRadarSigT): Output radar signal.% sigIn (RxRadarSigT): Input radar signal.% pulseIx [D](IndexT): Index for pulses or doppler channels.% rangeIx [D](IndexT): Index for range bins.% channelIx [D](IndexT): Index for antenna channels or beams.% extraIx [D](IndexT): Extra index.% cpiIx [D](IndexT): Index for CPIs.% trialIx [D](IndexT): Index for trials.% checkParamFlag [D] (BoolT): 0 = Do not check data types of input parameters.% 1 = Check data types of input parameters (default).%%--------%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 ...% [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% method.% For input parameters of data type IndexT, ':' means all elements in that% dimension.%%Examples:% %Read the received antenna signals and remove the last pulse (128) because% %it in this case contains rubbish.% sig = expsig1(ant,[expFileName, '.dbs']);% sig = sigsubix(sig,1:127,':',':');%%Software Quality:% (About what is done to ascertain software quality. What tests are done.)%%Known Bugs:% Maybe the updating of the fields "waveform", "pulIx", "ranIx" etc. in% the output radar signal is incorrect.%%References:% [1]: Bj鰎klund S.: "DBT, A MATLAB Toolbox for Radar Signal Processing.% Reference Guide", FOA-D--9x-00xxx-408--SE, To be published.%%See Also:% sigsplitdim, sigsize% * DBT, A Matlab Toolbox for Radar Signal Processing *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.% Start : 970725 Svante Bj鰎klund (svabj).% Latest change: $Date: 2000/10/16 15:21:49 $ $Author: svabj $.% $Revision: 1.12 $% *****************************************************************************if (nargin < 1) error('DBT-Error: To few input parameters.')end% ****************** Add missing input parameters ******************if (nargin < 2) pulseIx = [];endif (nargin < 3) rangeIx = [];endif (nargin < 4) channelIx = [];endif (nargin < 5) extraIx = [];endif (nargin < 6) cpiIx = [];endif (nargin < 7) trialIx = [];endif (nargin < 8) checkParamFlag = [];end% ****************** Convert between ':' and [] ******************if (isstr(pulseIx) & (pulseIx == ':')) pulseIx = [];endif (isstr(rangeIx) & (rangeIx == ':')) rangeIx = [];endif (isstr(channelIx) & (channelIx == ':')) channelIx = [];endif (isstr(extraIx) & (extraIx == ':')) extraIx = [];endif (isstr(cpiIx) & (cpiIx == ':')) cpiIx = [];endif (isstr(trialIx) & (trialIx == ':')) trialIx = [];end% ****************** Error check input parameters ******************if isempty(checkParamFlag) checkParamFlag = 1;end%ifif (checkParamFlag) chkdtype(sigIn, 'RxRadarSigT') chkdtype(pulseIx, 'IndexT','EmptyT') chkdtype(rangeIx, 'IndexT','EmptyT') chkdtype(channelIx, 'IndexT','EmptyT') chkdtype(extraIx, 'IndexT','EmptyT') chkdtype(cpiIx, 'IndexT','EmptyT') chkdtype(trialIx, 'IndexT','EmptyT')end%ifif (isempty(rangeIx)) dbtwarning('The contents of "sigOut.waveform" will be incorrect.') % Because "waveform.noRangeBins" is not updated. Should it be updated?end%if% ****************** Default values ******************sizeOfSig = sizem(sigIn.signals);if isempty(pulseIx) pulseIx = 1:sizeOfSig(1);end%ifif isempty(rangeIx) rangeIx = 1:sizeOfSig(2);end%ifif isempty(channelIx) channelIx = 1:sizeOfSig(3);end%ifif isempty(extraIx) extraIx = 1:sizeOfSig(4);end%ifif isempty(cpiIx) cpiIx = 1:sizeOfSig(5);end%ifif isempty(trialIx) trialIx = 1:sizeOfSig(6);end%if% ************** Get the right part (indices) of the signal **************%size(sigIn.signals)%pulseIx,rangeIx,channelIx,extraIx,cpiIxsigOut = sigIn;sigOut.signals = sigIn.signals(pulseIx,rangeIx,channelIx,extraIx,cpiIx,trialIx);% ****************** Update size information ******************ss = sizem(sigOut.signals);sigOut.waveform.noPulses = ss(1);sigOut.waveform.noCPI = ss(5);sigOut.waveform.noTrial = ss(6);if isfield(sigIn,'spaIx') sigOut.pulIx = sigIn.pulIx(pulseIx); sigOut.ranIx = sigIn.ranIx(rangeIx); sigOut.spaIx = sigIn.spaIx(channelIx); sigOut.extraIx = sigIn.extraIx(extraIx); sigOut.cpiIx = sigIn.cpiIx(cpiIx); sigOut.trialIx = sigIn.trialIx(trialIx);end%if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -