📄 simtarget.m
字号:
function radarSig3D = simtarget(steeringMatrix, pri, lambda, pulseMod, sampleTime, targetPowers, targetVel, targetRanges, targetTypes, targetStartPhases, noPulses, noRangeBins, targCorrMx, propSpeed, pulIx, ranIx, spaIx, extraIx, cpiIx, trialIx)%SIMTARGET is the core simulating engine for simulating narrowband radar% signals from targets%%Synopsis:% radarSig3D = simtarget(steeringMatrix, pri, lambda, pulseMod,...% sampleTime, targetPowers, targetVel, ...% targetRanges, targetTypes, noPulses, ...% noRangeBins, targCorrMx);%%Description:% Simulates narrowband radar signals and stores the data in a 3D matrix% ( Number Pulses x Number Of RangeBins x Number Of Channels )% The range to the target is translated into a corresponding range bin% with the function "ran2ranbin" where all targets that are beyond the% range described by the "noRangeBin" input parameter are folded back% to the beginning of the range bins in a modulo fashion. Target ranges% are also used to determine the start phase of each target. These phases% are then altered from pulse to pulse according to the target's velocity% Range bins correspond to a time shift that is faster then between pulses,% this leads to a phase shift between range bins aswell (much slower% rate though). The simulated radarsignal is also convolved with the% pulse modulation code. This convolution is performed on the range% dimension. There is also a possibility to correlate targets with each% other. Finally the simulated radar signal is moved into beamspace% with the help of the steering vector.%% This function is called upon by "simradarsig" and should be% hidden from the everyday user.%%Input:% steeringMatrix (CxMatrixT) : The steering matrix describing the% antenna geometry.% pri (RealScalarT) : Pulse repetition interval [s].% lambda (RealScalarT) : Wavelength [m].% pulseMod (CxVectorT) : Pulse modulation weights. see "getmod".% sampleTime (RealScalarT) : Time between range bins [s].% targetPowers (CxVectorT) : Power received from each targets [W].% targetVel (CxVectorT) : Radial velocities to radar antenna for% each target [m/s].% targetRanges (CxVectorT) : Distance between target and radar [m].% targetTypes (StingVectorT) : List of the target types.% noPulses (IntScalarT) : Number of pulses in simulation.% noRangeBins (IntScalarT) : Number of range bins.% targCorrMx (CxMatrixT) : Correlations between the targets.% (noPulses x noPulses)% propSpeed (RealScalarT) : Propagation speed of the beam [m/s].%%Output:% radarSig3D (CxMatrixT) : 3D matrix with the simulated data.% pulses x rangebins x channels.%%--------%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:%%Software Quality:%%Known Bugs:% 1) Only targets of type "swerling0" (constant) is implemented.%% 2) Targets beyond the umambiguous range, i.e. in a range bin beyond% "noRangeBins" should not show up in first pulse, but instead in the% pulse corresponding to the distance of the target.%% 3) In a situation with targets in some of the last range bins and when% pulse modulation is chosen the pulse code should spill over to the% next pulse.%%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.% [2]: Kingsley S., Quegan S.: "Understanding Radar Systems",% McGraw-Hill 1992.%%See also:% deftarget, simradarsig, simnoise, simclutter, simjammer, defwave,% getmod.% * DBT, A Matlab Toolbox for Radar Signal Processing *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.%% Initiation : 980511 David Rejdemyhr (davrej).% Latest change : $Date: 2000/10/16 15:21:56 $ $Author: svabj $.% $Revision : 1.0 $%*************************************************************************%-------------------------------------------------------------------------%---- Constants used in function ----%------------------------------------------------------------------------- noTargets = length(targetPowers); pulseMod = pulseMod.'; corrFlag = sum(sum(eye(noTargets)-targCorrMx)); % Equal to zero when there's no correlation%-------------------------------------------------------------------------%---- Simulate the signals. ----%------------------------------------------------------------------------- %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %--- Create empty preRadarSig variable. Each row corresponds to a --- %--- range bin. Each Column corresponds to a target. --- %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - preRadarSig = zeros(noRangeBins, noTargets); % -- Convert Targetrange to corresponding RangeBin -- targetRangeBins = ran2ranbin(targetRanges, sampleTime, propSpeed,... noRangeBins); %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %--- An index to a 2D matrix is a linear array columnwise. I.e. 2nd --- %--- column and 5th row is 2*noRows + 5 --- %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - idxes2D = ((1:noTargets) - 1) * noRangeBins + targetRangeBins; preRadarSig(idxes2D) = sqrt(targetPowers) .* exp(j*targetStartPhases); %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %--- We now have a signal where the rows represent range bins and the --- %--- columns represent targets --- %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %--- Calculate velocity dependent phase shifts due to target motion --- %--- within a single pulse, i.e. different positions of the targets --- %--- at each subpulse. One of the two's are there because of that --- %--- the wave travelles back and forth. --- %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - phShifts = ((1:length(pulseMod))-1) * 2*pi * 2 * sampleTime / lambda; %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %--- Convolute with the modulation array including phaseshift due to --- %--- motion of target between subpulses (rangebins). Only if --- %--- pulemodulation differs from zero. --- %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if ~isempty(pulseMod) for targIdx = 1:noTargets data = preRadarSig(:,targIdx); convolved = conv(data,pulseMod .* ... exp(j*phShifts*targetVel(targIdx))); preRadarSig(:,targIdx) = convolved(1:length(data)); end%for end%if %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %--- Calculate velocity dependent weights, i.e. phaseshifts for each --- %--- source due to its radial speed and variation of source power --- %--- between pulses. Consider sterling cases aswell. --- pulseWeights = zeros(noPulses, noRangeBins, noTargets); phaseShifts = ((1:noPulses)-1).' * 2*pi * 2 * targetVel * pri / lambda; for targIdx = 1:noTargets targetType = targetTypes{targIdx}; if (strcmp(targetType,'constant') | ... strcmp(targetType,'swerling0') | ... strcmp(targetType,'swerling5') | ... strcmp(targetType,'marcum')), pulseWeights(:, 1, targIdx) = ones(noPulses,1) .* ... exp(j*phaseShifts(:,targIdx)); elseif strcmp(targetType,'swerling1'), elseif strcmp(targetType,'swerling2'), elseif strcmp(targetType,'swerling3'), elseif strcmp(targetType,'swerling4'), elseif strcmp(targetType,'custom'), elseif strcmp(targetType,'randn'), pulseWeights(:, 1, targIdx) = randn(noPulses,1) .* ... exp(j*phaseShifts(:,targIdx)); end %if end %for pulseWeights = repmat(pulseWeights(:,1,:),[1, noRangeBins, 1]); % -- Extend this matrix to a 3D matrix. The new dim is the pulses -- preRadarSig3D = zeros(noPulses, noRangeBins, noTargets); preRadarSig3D1(1,:,:) = preRadarSig; preRadarSig3D = repmat(preRadarSig3D1(1,:,:),[noPulses,1,1]); preRadarSig3D(:,:,:) = preRadarSig3D(:,:,:) .* pulseWeights; %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %--- We now have a 3D-signal where the 1:st index represent pulses --- %--- and the 2:nd index represents rangebins and 3:rd index --- %--- represent the targets. --- %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % -- If needed then correlate the targets with supplied correlation matrix. -- if ( ~isempty(targCorrMx) & ... (corrFlag ~= 0) ) % Compute the square root of the covariance matrix with SVD % and color the random variables with the square root of the % noise covariance matrix. [U,SIG,V] = svd(targCorrMx); for rangeIdx = 1:noRangeBins preRadarSig3D(:,rangeIdx,:) = ... (U*sqrt(SIG)*squeeze(preRadarSig3D(:,rangeIdx,:)).').'; end %for end %if % -- Take the step into beamspace with help of the steering matrix -- profileTest = 0; % = 1 when measuring the excution time. Otherwise = 0. noChannels = size(steeringMatrix,1); radarSig3D = zeros(noPulses, noRangeBins, noChannels); for pulseIdx = 1:noPulses if (noTargets == 1 | noRangeBins == 1) % The (above) if statement is needed due to behavior of squeeze. if (profileTest) tmp1 = preRadarSig3D(pulseIdx,:,:); tmp2 = squeeze(tmp1); tmp3 = steeringMatrix * tmp2; tmp4 = tmp3.'; radarSig3D(pulseIdx,:,:) = tmp4; %radarSig3D(:,:,pulseIdx) = tmp4; else % Normal operation. radarSig3D(pulseIdx,:,:) = (steeringMatrix * ... squeeze(preRadarSig3D(pulseIdx,:,:))).'; %radarSig3D(:,:,pulseIdx) = (steeringMatrix * ... % squeeze(preRadarSig3D(pulseIdx,:,:))).'; end%if else radarSig3D(pulseIdx,:,:) = (steeringMatrix * ... squeeze(preRadarSig3D(pulseIdx,:,:)).').'; end %if end %for %------------------------------------------------------------------------------ %- Finally we have a 3D-signal where the 1st index represent pulses and -- %- the 2nd index represents rangebins and 3rd index represent the channels - %------------------------------------------------------------------------------%End Of File -------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -