doaspc2sig.m
来自「阵列信号处理的工具箱」· M 代码 · 共 138 行
M
138 行
function sigOut = doaspc2sig(spect, linFlag)%DOASPC2SIG Converts a DOA spectrum (DoaSpecT) to a (power) radar signal (RxRadarSigT).%%--------%Synopsis:% sigOut = doaspc2sig(spect, linFlag)%%Description:% Converts one or more directional spectra (DoaSpecT) to a radar signal % (RxRadarSigT). The power spectra is stored in the output signal.% This is actually not possible and allowed. The result is not a real radar % signal.% The purpose with this function is to make it possible to plot directional % spectra with the plotting functions for radar signals, e.g. "sigplot2".%% NOTE: A "radar" signal created with this function can only be used for % plotting, not for further processing.%%Output and Input:% sigOut (RxRadarSigT): The output radar signal.% spect (DoaSpecT): Input DOA-spectrum, from for example "doaspc1".% spect (CellArrayT of DoaSpecT): Input DOA-spectrum, from for example % "doaspc1". The different spectra are stored in different CPIs % (trials, subscript 5) in the radar signal. Not implemented.% linFlag [D](BoolT): 0 = the signal power is stored in the output signal % (default). 0 = the signal amplitude is stored in the output signal.%%--------%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.)%%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.%%See also:% doaspc2sigamp, sigplot2% * DBT, A Matlab Toolbox for Radar Signal Processing *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.%% Start : 980701 Svante Bj鰎klund (svabj).% Latest change: $Date: 2000/10/16 15:20:45 $ $Author: svabj $.% $Revision: 1.10 $% *****************************************************************************if (nargin < 2) linFlag = 0;end%ifif (iscell(spect)) % "spect" is a cell array of DoaSpecT, which will be put into an % "RxRadarSigT". % The code in this if-branch is not finnished. dbterror('The code in this if-branch is not finnished.') sizeSpec = sizem(spect.specSmpl); % This must be an error. Must index % the cell array! %sigOut = RxRadarSigT(zeros([1, sizeSpec(2), sizeSpec(1), sizeSpec(4), ... % sizeSpec(5)]),{defant,defwave}); sigOut = RxRadarSigT; sigOut.signals = zeros([1, sizeSpec(2), sizeSpec(1), sizeSpec(4), ... sizeSpec(5)]); noSpc = length(spect) for spcLoop = 1:noSpc spect1 = spec{1}; sizeSpec = sizem(spect1.specSmpl); if (sizeSpec(5) ~= 1) error('DBT-Error: Only one trial is allowed.') end%if trialIx = 1; for phiIx = 1:sizeSpec(4) spect1 = spec{spcLoop}; testversion(spect1) sigOut.signals(1,:,:,phiIx,spcLoop)=spect1.specSmpl(:,:, phiIx,trialIx).'; end%for phiIx end%for for spcLoopelse %(iscell(spect)) testversion(spect) sizeSpec = sizem(spect.specSmpl); old = 0; if (old) sigOut.dataType = 'RxRadarSigT'; sigOut.signals = zeros([1, sizeSpec(2), sizeSpec(1), sizeSpec(4), ... sizeSpec(5)]); else antenna = defant; waveform = defwave(1,1,1,1,1); sigOut = RxRadarSigT(zeros([1, sizeSpec(2), sizeSpec(1), sizeSpec(4), ... sizeSpec(5)]),{antenna, waveform}); end%if for trialIx = 1:sizeSpec(5) for phiIx = 1:sizeSpec(4) tmpMat = (spect.specSmpl(:,:,phiIx,trialIx).'); if (linFlag) tmpMat = sqrt(tmpMat); else end%if sigOut.signals(1,:,:,phiIx,trialIx) = tmpMat; end%for phiIx end%for trialIx %sigOut.antenna = antenna; %sigOut.waveform = waveform;end%if%endfunc doaspc2sigfunction testversion(spect) if (spect.version < 4) error(['DBT-Error: Too old version of input parameter "estDirSpec". ',... 'Probably because a definition of the "DoaSpecT" variable ',... 'somewhere else than in function "DoaSpecT".']) end%if%endfunc testversion
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?