Engee documentation
Notebook

Radar scenario modelling

This example shows how to apply the basic workflow of the toolkit to the following scenario: Assume that you have a single isotropic antenna operating at 4 GHz. Assume that the antenna is located at the origin of the global coordinate system. At the point (7000,5000,0) there is initially a target with a non-fluctuating radar cross-section of 0.5 square metres. The target is moving with a constant velocity vector (-15;-10;0). Your antenna transmits ten rectangular pulses of 1 µs duration with a pulse repetition frequency (PRF) of 5 kHz. The pulses propagate to the target, reflect off the target, return to the antenna, and are collected by the antenna. The antenna operates in monostatic mode, receiving a signal only when the transmitter is inactive.

Generator modelling

To create a waveform, use the EngeePhased.RectangularWaveform system object and set the desired property values.

In [ ]:
Pkg.add(["DSP"])
In [ ]:
using DSP
waveform = EngeePhased.RectangularWaveform(PulseWidth=1e-6, 
    PRF=5e3,OutputFormat="Pulses",NumPulses=1);

Modelling an antenna element

The EngeePhased.IsotropicAntennaElement system object is used for antenna modelling. Let's set the antenna radiation frequency range equal to 1-10 GHz. The isotropic antenna radiates energy uniformly for azimuth angles from -180 to 180 degrees and location angles from -90 to 90 degrees.

In [ ]:
antenna = EngeePhased.IsotropicAntennaElement(FrequencyRange=[1e9 10e9]);

Target modelling

Use the EngeeRadar.RadarTarget system object to model the target. The target has a non-fluctuating model effective scattering area equal to 0.5 square metres, and the electromagnetic wave incident on the target has a carrier frequency of 4 GHz. The wave reflected from the target propagates at the speed of light with=299792458. Let us set the considered parameters when defining the system object of the target.

In [ ]:
target = EngeePhased.RadarTarget(Model="Nonfluctuating",MeanRCS=0.5, 
    PropagationSpeed=299792458,OperatingFrequency=4e9);

Modelling the motion of the antenna and the target

Use the EngeePhased.Platform object to model the location and movement of the antenna and target. In this scenario, the antenna is stationary and located at the origin of the global coordinate system. The target is initially located at (7000,5000,0) and moves with a constant velocity vector (-15,-10,0).

In [ ]:
antennaplatform = EngeePhased.Platform(InitialPosition=[0;0;0],Velocity=[0;0;0]);
targetplatform = EngeePhased.Platform(InitialPosition=[7000; 5000; 0],Velocity=[-15;-10;0]);

Use the rangeangle function to determine the range and angle between the antenna and the target.

In [ ]:
tgtrng,tgtang = rangeangle(targetplatform.InitialPosition,
    antennaplatform.InitialPosition);

Transmitter modelling

Use the EngeePhased.Transmitter system object to model transmitter characteristics. The key parameter in modelling the transmitter is the peak transmit power. To determine the peak transmit power of the transmitter, assume that the desired detection probability is 0.9 and the maximum allowable false alarm probability is 10^(-6) . Assume that ten rectangular pulses are incoherently integrated in the receiver. The Albersham function can be used to determine the desired signal-to-noise ratio (SNR).

In [ ]:
Pd = 0.9;
Pfa = 1e-6;
numpulses = 10;
SNR = albersheim(Pd,Pfa,N = 10);

The required SNR is approximately 5 dB. Suppose you want to set the peak transmit power to achieve the required SNR for a target up to 15 km away. Assume that the transmitter gain is 20 dB. Use the radar equation to determine the required peak transmit power.

In [ ]:
maxrange = 1.5e4;
B = 1.380649e-23;
c = 299_792_458
lambda = c/target.OperatingFrequency;
tau = waveform.PulseWidth;
Ts = 290;
rcs = 0.5;
Gain = 20;
dbterm = db2pow(SNR - 2*Gain);
Pt = (4*pi)^3*B*Ts/tau/rcs/lambda^2*maxrange^4*dbterm;

The required peak transmit power is approximately 45 kilowatts. For reliability, use a peak transmit power of 50 kilowatts when modelling the transmitter. To keep the phase of the pulsed signals constant, set the CoherentOnTransmit property to true. Since the transmitter operates in monostatic mode (transmit-receive), set the InUseOutputPort property to true to record the transmitter status.

In [ ]:
transmitter = EngeePhased.Transmitter(PeakPower=50e3,Gain=20,LossFactor=0, 
    InUseOutputPort=true,CoherentOnTransmit=true);

Receive and transmit antenna modelling

Use the EngeePhased.Radiator system object to model the wave radiation. To model a narrowband receiver, use the EngeePhased.Collector system object. Use the EngeePhased.WidebandCollector system object to collect the wideband signal

In this example, the pulse satisfies the assumption of a narrowband signal. The carrier frequency is 4 GHz. For the Sensor property value, use the handle for the isotropic antenna. In the EngeePhased.Collector object, set the Wavefront property to 'Plane' to indicate that the waveform incident on the antenna is planar.

In [ ]:
radiator = EngeePhased.Radiator(Sensor=antenna,
    PropagationSpeed=c,OperatingFrequency=4e9);
collector = EngeePhased.Collector(Sensor=antenna,
    PropagationSpeed=c,Wavefront="Plane",
    OperatingFrequency=4e9);

Receiver modelling

To model the receiver, use the EngeePhased.ReceiverPreamp system object. In the receiver, you set the noise figure and reference temperature, which are key factors that affect the internal noise of your system. In this example, the noise figure is 2 dB and the reference temperature is 290 Kelvin. For reproducible results, set a fixed value for the random number generator.

In [ ]:
receiver = EngeePhased.ReceiverPreamp(Gain=20,NoiseFigure=2, 
    ReferenceTemperature=290,SampleRate=1e6, 
    EnableInputPort=true,SeedSource="Property",Seed=1000);

Modelling the propagation channel

Use the EngeePhased.FreeSpace object to model the propagation environment. You can model one-way or two-way propagation by setting the TwoWayPropagation property. In this example, to model one-way propagation, set this property to false.

In [ ]:
channel = EngeePhased.FreeSpace(
    PropagationSpeed = c, OperatingFrequency=4e9,
    TwoWayPropagation=false, SampleRate=1e6);

Implementing a basic radar model

Once all necessary scenario components have been parameterised, pulses can be generated, propagated to and from the target and echoes can be received.

The following code prepares the main simulation loop. The time step between pulses is set using the code below:

In [ ]:
T = 1/waveform.PRF;
# Положение антенны
txpos = antennaplatform.InitialPosition;
# Выделение памяти для приемного эхо-сигнала
rxsig = zeros(ComplexF64,Int(waveform.SampleRate*T),numpulses);

You can execute the main simulation loop using the following code:

In [ ]:
for n = 1:numpulses
    # Обновление положения цели
    tgtpos,tgtvel = targetplatform(T);
    # Вычисление дальности и угла направления на цель
    tgtrng,tgtang = rangeangle(tgtpos,txpos);
    # Формируем импульсы передающего сигнала
    sig = waveform();
    # Усиление входных импульсов сигнала в передатчике
    sig,txstatus = transmitter(sig);
    # Излучение импульсов в направлении цели
    sig = radiator(sig,tgtang);
    # Распространение излученных сигналов в среде 
    sig = channel(sig,txpos,tgtpos,[0;0;0],tgtvel);
    # Формирование отраженных импульсов от цели
    sig = target(sig);
    # Распространение отраженного сигнала от цели в среде
    sig = channel(sig,tgtpos,txpos,tgtvel,[0;0;0]);
    # Прием отраженного сигнала от цели
    sig = collector(sig,tgtang);
    # Предварительное усиление в МШУ
    rxsig[:,n] = receiver(sig,xor.(txstatus,1));
end

Next, incoherently integrate the obtained echoes, calculate the range vector and plot the graph. The red vertical line on the graph represents the range to the target.

In [ ]:
int_out = pulsint(rxsig,"noncoherent")*1e6;
t = (0:1/receiver.SampleRate:T-1/receiver.SampleRate);
rangegates = t.*(c/2);
plot(rangegates./1e3,int_out,lab="")
plot!([tgtrng[1]/1e3,tgtrng[1]/1e3],[minimum(int_out)/2,maximum(int_out)*1.2],lab="")
xlabel!("Дальность, (км)")
ylabel!("Мощность, мкВт")
Out[0]: