Input signal to phased.Bac​kscatterRa​darTarget is wrong

6 views (last 30 days)
Hi, I'm fairly new to MATLAB and the phased array toolbox. I'm trying to make simple multi-path model, including HH,HV and VV polarization, forlong range surveillance radar, but I can't get the backscatter radar target function to work.
No matter what I do with the transmitted signal, I get the following error when trying to get an echo from the target:
Error using coder.internal.assert (line 33) Expected input Update to be a scalar.
Anyone have a good idea on what I'm doing wrong?
This is my code:
close all; clear all; clc
c = physconst('LightSpeed');
k = physconst('Boltzman');
%%Waveform
pulsewidth = 1.334e-5; %sec
PRF = 500; %Hz
PRI = 1/PRF; %s
bandwidth = 7.5e6;
fs = 2.5*bandwidth; %s
%%Radar parameters
gain = 36; %dB
fc = 2e9; % Hz
lambda = c/fc; %m
%%Setting up radar
horn = phased.CrossedDipoleAntennaElement(...
'FrequencyRange',[2,3]*1e9);
array = phased.ULA('NumElements',27,'Element',horn,...
'ElementSpacing',0.5);
transmitter = phased.Transmitter('Gain',gain,'InUseOutputPort',true);
%%IMPORTING RCS DATA
Az_RCS = (0:0.1:180);
El_RCS = (-90:0.1:90);
step = Az_RCS(2)-Az_RCS(1);
tolerance = step/2;
a=1801;
b=1801;
rcspattern_HH = 1*ones(a,b);
rcspattern_HV = 0.9*ones(a,b);
rcspattern_VV = 0.5*ones(a,b);
target = phased.BackscatterRadarTarget('EnablePolarization',true,...
'Model','Swerling1',... % Swerling1 'Nonfluctuating'
'AzimuthAngles',Az_RCS,'ElevationAngles',El_RCS,...
'ShhPattern',rcspattern_HH,...
'ShvPattern',rcspattern_HV,'SvvPattern',rcspattern_VV,...
'OperatingFrequency',fc); %
sensorpos = [0;0;30]; %Radar location
sensorvel = [2;0;0]; %Radar velocity
tgtpos = [1e3;0;50]; % Target location
tgtvel = [-300;0;0]; %Radar velocity
radarplatform = phased.Platform(sensorpos,sensorvel);
targetplatform = phased.Platform(tgtpos,tgtvel);
[tgtrng,tgtang] = rangeangle(targetplatform.InitialPosition,...
radarplatform.InitialPosition);
waveform = phased.LinearFMWaveform('DurationSpecification','Pulse width',...
'PulseWidth',pulsewidth,...
'OutputFormat','Pulses','PRF',PRF,'NumPulses',1,'SweepBandwidth',bandwidth);
Pt = 96e3;
transmitter.PeakPower = Pt;
F_dB = 5;
F = 10^(F_dB/10);
T = 290;
radiator = phased.Radiator('PropagationSpeed',c,...
'OperatingFrequency',fc,'Sensor',array,'Polarization','Combined'); %dual or combined
channel_forth =phased.TwoRayChannel( ...
'SampleRate',fs,'PropagationSpeed',c,'OperatingFrequency',fc,...
'CombinedRaysOutput',false,... %true or false - This allows to see the effect of mulipath alone....
'EnablePolarization',true,... %true or false
'MaximumDistanceSource','Property','MaximumDistance',70e3,...
'GroundRelativePermittivity',10); %
channel_back= clone(channel_forth);
collector = phased.Collector('PropagationSpeed',c,...
'OperatingFrequency',fc,'Sensor',array,'Polarization','Combined');
receiver = phased.ReceiverPreamp('SampleRate',fs,'Gain',gain,...
'NoiseMethod','Noise Power','NoisePower',k*T*F*bandwidth,...
'EnableInputPort',true,'SeedSource','Property','Seed',2e3);
laxTx = rotx(11)*eye(3);
%%SETTING UP THE CUBE
%%The processing steps are:
% 1. Move the radar and targets.
% 2. Transmit the waveform.
% 3. Propagate the waveform signal to the target.
% 4. Update target RCS based on look angle
% 5. Reflect the signal from the target.
% 6. Propagate the waveform back to the radar. Two-way propagation enables enables you to combine the return propagation with the outbound propagation.
% 7. Receive the signal at the radar.
% 8. Load the signal into the data cube.
wf = waveform();
Nr=length(wf);
Np=10;
dt = PRI;
cube = zeros(Nr,Np);
for n=1:Np
%%Move the target and radar within the pulse
[sensorpos,sensorvel] = radarplatform(dt);
[tgtpos,tgtvel] = targetplatform(dt);
[tgtrng,tgtang] = rangeangle(tgtpos,sensorpos,laxTx,'two-ray'); %%pos,refpos
%%Generate and transmitt pulse
wf = waveform(); %Generate waveform
[wf,txstatus] = transmitter(wf);
wf = radiator(wf,tgtang,laxTx); %%Represents the 11 deg slant angle
%%Propagate pulse toward the target.
wf_prop = channel_forth(wf,sensorpos,tgtpos,sensorvel,tgtvel);
%%Update look angle
incident_ang = [tgtang(1,1) tgtang(1,2);tgtang(2,1)*(-1) tgtang(2,2)];
tgtaxes_LOS = azelaxes(tgtang(1,1),tgtang(2,1)*(-1));
tgtaxes_MUL = azelaxes(tgtang(1,2),tgtang(2,2));
%%Reflect RF off the target
wf_back = target(wf_prop,incident_ang,tgtaxes_LOS,tgtaxes_MUL);
%%Propagate the pulse back to transmitter
wf_back_prop = channel_back(wf_back,tgtpos,sensorpos,tgtvel,sensorvel);
%%Collect and receive target
wf_rx = collector(wf_back_prop,tgtang);
rx_pulse = receiver(wf_rx,~txstatus);
%%Load data the signal into cube
cube(:,n) = rx_pulse;
end
%%Matched filtering
matchingcoeff = getMatchedFilter(waveform);
filter = phased.MatchedFilter(...
'Coefficients',matchingcoeff,... % 'SpectrumWindow','Taylor',...
'SpectrumWindow','Taylor',...
'GainOutputPort',true);
[mf_pulses, mfgain] = filter(cube);
%%Get group delay of matched filter
matchingdelay = size(matchingcoeff,1)-1;
sz_mfpulses = size(mf_pulses);
mf_pulses = [mf_pulses(matchingdelay+1:end) zeros(1,matchingdelay)];
mf_pulses = reshape(mf_pulses,sz_mfpulses);
%%Pulse integration
int_pulses = pulsint(mf_pulses,'coherent');
int_pulses = squeeze(int_pulses); % Remove singleton dimensions
%%Defining range gates
t = linspace(0,PRI,length(mf_pulses));
rangegates = c.*t/2;
%%Finding the average noise
npower = noisepow(k*T*bandwidth*F);% (W)
[m n] = size(cube); % Finding the size of the signal goining through MF
noise_cube=wgn(m,n,k*T*bandwidth*F,1,2e3,'linear','complex'); % (W) Genereates the same noise as used in RX
mf_noise = filter(noise_cube);
mf_noise = reshape(mf_noise,sz_mfpulses);
int_noise = pulsint(mf_noise,'coherent');
int_noise = squeeze(int_noise); % Remove singleton dimensions
SNR_min = 13; %dB
% SNR matched filter
avg_noise = mean2(abs(mf_noise)); % (W) Average noise
SNR_mf = 10*log10(max(abs(mf_pulses(:)))/avg_noise); % (dB) By definition Ppk/Avg noise power
threshold_line= 10*log10(avg_noise) +SNR_min; %dB
% SNR pulse integration
avg_noise_int = mean2(abs(int_noise)); % (W) Average noise
SNR_int = 10*log10(max(abs(int_pulses(:)))/avg_noise_int); % By definition (dB)?!? Ppk/Avg noise
threshold_line_int= 10*log10(avg_noise_int) +SNR_min; %dB
%%Display
figure(4)
subplot(3,1,1)
plot(rangegates/1e3,10*log10(abs(cube))); %dB
%plot(rangegates/1e3,abs(cube)); %W
title('Response received Pulses')
ylabel('Amplitude(dB)')
axis([0 55 -80 -40]) % dB
subplot(3,1,2)
plot(rangegates/1e3,10*log10(abs(mf_pulses)),...
rangegates/1e3,10*log10(avg_noise)*ones(m,1),'r',...
rangegates/1e3,threshold_line*ones(m,1),'g');
title(['Response with Matched Filtering. SNR ' num2str(SNR_mf)])
xlabel('Range (km)')
ylabel('Amplitude(dB)')
axis([0 55 -80 -40])
subplot(3,1,3)
plot(rangegates/1e3,10*log10(abs(int_pulses)),...
rangegates/1e3,10*log10(avg_noise_int)*ones(m,1),'r',...
rangegates/1e3,threshold_line_int*ones(m,1),'g');
title(['Response pulse integration.' num2str(num_pulses) ' pulses. SNR ' num2str(SNR_int) ])
xlabel('Range (km)')
ylabel('Amplitude(dB)')
axis([0 55 -60 -20])

Answers (1)

Honglei Chen
Honglei Chen on 18 Jun 2018
Edited: Honglei Chen on 18 Jun 2018
You have a Swerling 1 target, so the last input to your target call is an update flag (scalar) telling it whether to update the RCS value. For example, since it's a Swerling 1 model, in general you will set the last input as false, and when each dwell is finished, you will set it to true once to update the RCS.
It seems that you put down a different axes, taget_MUL, as the input. I assume this is used for multipath? But it is only used in that place once. If you want a separate return from a multipath, you may need to call the target separately to get that return.
HTH

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!