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

📄 ranstemat.m

📁 阵列信号处理的工具箱
💻 M
字号:
function A = ranstemat(waveform, ranges, propSpeed, interpMethod, storageClass, boundaryMethod)%RANSTEMAT Calculation of range (fast time) steering matrix.%%--------%Synopsis:%  A = ranstemat(waveform, ranges)%  A = ranstemat(waveform, ranges, propSpeed, interpMethod, storageClass, ...%    boundaryMethod)%%Description:%  Calculates the range (fast time) steering matrix for specified frequencies.%%  This function is normally not called by the end user but%  by the extension programmer that extends the toolbox DBT with new signal%  processing methods etc.% %  The delivered range steering matrix is circular, i.e. if there is not%  enough space for the puls modulation at the end of the range bins, it%  will wrap around to the first range bin%%Output and Input:%  A (CxMatrix): The calculated range (fast time) steering matrix. The size is %   (noRangeBins, noRanges), where noRangeBins is the number of range bins%    and noRanges is the number of ranges. A "range bin" means ...%    A "range" means ...%  waveform (WaveformT): The waveform definition.%  ranges (RealVectorT.'): Ranges to calculate the steering vectors at [m].%  propSpeed [D](RealScalarT): Propagation speed of the waves [m/s].%    Default = speed of light in free space.%  interpMethod [D](StringT): Interpolation method to use between the%    samples of the pulse modulation. See help text for function "interp1"%    for possible methods.%  storageClass [D](StringT): Specifies the MATLAB storage class for output%    steering matrix "A".%    = 'full': Use storage class "full".%    = 'sparse': Use storage class "sparse". %  boundaryMethod [D](StringT): How to handle the boundaries of the PRI.%    Not implemented.%%--------%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:%%Software Quality:%  (About what is done to ascertain software quality. What tests are done.)%%%Known Bugs:%  When only a portion the ranges of a radar signal is retained (the%  "ranIx" field of the data type "RxCorrMatT" contains a subset of all%  possible range indices) this function can not handle it. Should it be%  as with antenna definitions, with parent and children waveform and %  "beamforming"? This could maybe confuse doppler filtering since it%  also use the waveform definition. Or should this function have extra%  input parameters, e.g. "ranIx" and/or "trans.ranTrans",%  "trans.sparanTrans", etc.?%%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:%  ranfilt, spastemat, pulstemat%   *  DBT, A Matlab Toolbox for Radar Signal Processing  *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.%%  Start        : 990222 Svante Bjvrklund (svabj).%  Latest change: $Date: 2001/08/31 14:32:18 $ (17:08) $Author: svabj $.%  $Revision: 1.7 $% *****************************************************************************% ----------------------------------------------------------------------- %% Handle input parameters.% ----------------------------------------------------------------------- %% ****************** Add missing input parameters ******************arginNo=2;if (nargin < arginNo)  error('DBT-Error: To few input parameters.')endarginNo = arginNo +1;if (nargin < arginNo)  propSpeed = [];endarginNo = arginNo +1;if (nargin < arginNo)  interpMethod = [];endarginNo = arginNo +1;if (nargin < arginNo)  storageClass = [];endarginNo = arginNo +1;% ****************** Default values ******************if isempty(propSpeed)  propSpeed = speedoflight;end%ifif isempty(interpMethod)  interpMethod = '*nearest';end%ifif isempty(storageClass)  storageClass = 'full';end%if% ****************** Error check input parameters ******************chkdtype(waveform, 'WaveformT')%chkdtype(ranges, '???')chkdtype(propSpeed, 'RealScalarT')if (isempty(waveform.pModulation))  error('DBT-Error: Empty pulse modulation.')end%if% ----------------------------------------------------------------------- %% Perform the calculations.% ----------------------------------------------------------------------- %noRanges = length(ranges);noRangeChan = waveform.noRangeBins;pModulation = waveform.pModulation;noPModCoeff = length(pModulation);if (strcmp(storageClass,'full'))  A  = zeros(noRangeChan,noRanges);elseif (strcmp(storageClass,'sparse'))  A  = spalloc(noRangeChan,noRanges, (noPModCoeff + 1) * noRanges);else  error('DBT-Error: Unknown storage class.')end%if%ranBinLen = (propSpeed * waveform.sampleTime)/2;ranBinLen = getranbinlen(waveform, propSpeed);  % Length in number of samples of the pulse modulation.x = (-0.5:noPModCoeff-1 + 1.5).';y = [0; pModulation; 0];rangeInRangeBins = (ranges + ranBinLen) ./ ranBinLen;	rangeBindDecimals = mod(rangeInRangeBins,1);startRangeBin = fix(rangeInRangeBins);endRangeBin = startRangeBin + noPModCoeff -1;for rangeIx = 1:noRanges  xi = (0:noPModCoeff-1).' + (rangeBindDecimals(rangeIx));  pModInterp = interp1(x,y,xi,interpMethod);  ARowIx = rem((startRangeBin(rangeIx):endRangeBin(rangeIx))-1,noRangeChan)+1;  A(ARowIx,rangeIx) = pModInterp;end%for rangeIx%fprintf('ranstemat: issparse(A) = %d\n',issparse(A));% ----------------------------------------------------------------------- %% Remaining (not used).% ----------------------------------------------------------------------- %if (0)%x = (-1:noPModCoeff-1 +1).'%rangeInRangeBins = ranges ./ ranBinLen + 0.5;  % If range bin 1 is centered around range = 150 m and so on.%rangeBindDecimals = rem(rangeInRangeBins,1)  % If range bin 1 is centered around range = 150 m and so on.%startRangeBin = fix(rangeInRangeBins)   % If range bin 1 is centered around range = 150 m and so on.%rangeInRangeBins = ranges ./ ranBinLen	%rangeBindDecimals = mod(rangeInRangeBins + 0.5 ,1)%startRangeBin = rem(fix(rangeInRangeBins) + 1 , noRangeChan)%startRangeBin = rem(fix(rangeInRangeBins) , noRangeChan)%xi = (0:noPModCoeff-1).'*(rangeBindDecimals - 0.5);%xi = x(:);%pModInterp = intrep1(x,y,xi,interpMethod);%pModInterp = reshape(pModInterp,noPModCoeff,noRanges);%A()=;% for ...  %xi = (0:noPModCoeff-1).'*((ranges(rangeIx) rem ranBinLen) - 0.5)    % This is wrong!  %xi = (0:noPModCoeff-1) + (rangeBindDecimals(rangeIx) - 0.5)    % If range bin 1 is centered around range = 150 m and so on.  %xi = (0:noPModCoeff-1) + (rangeBindDecimals(rangeIx) - 0.5)  %pModInterp = interp1(x,y,xi(:,rangeIx),interpMethod)  disp('Indices:')  rangeIx  size(A)  %A(:,rangeIx) = [zeros(startRangeBin(rangeIx)-1,1); pModInterp; ...  %  zeros(noRangeChan-endRangeBin(rangeIx),1)];  %A(:,rangeIx) = [zeros(startRangeBin(rangeIx)-1,1), pModInterp(rangeIx), ...  %  zeros(noRangeChan-endRangeBin(rangeIx),1)];%end%forend%if (0)

⌨️ 快捷键说明

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