Engee documentation
Notebook

Simulation of a radar scenario

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

Simulation of the generator

To create a waveform, use the EngeePhased system object.RectangularWaveform 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);

Modeling of the antenna element

The EngeePhased system object is used to model the antenna.IsotropicAntennaElement. Let's set the frequency range of the antenna radiation to 1-10 GHz. The isotropic antenna emits energy evenly for azimuth angles from -180 to 180 degrees and elevation angles from -90 to 90 degrees.

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

Goal modeling

To model the target, use the EngeeRadar system object.RadarTarget. The target has a
non-fluctuating model of an effective scattering area of 0.5 square meters, 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's set the parameters considered when defining the target system object.

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

Simulation of antenna and target movement

To simulate the location and movement of the antenna and target, use the EngeePhased.Platform object. In this scenario, the antenna is stationary and located at the origin of the global coordinate system. The target is initially located at (7000,500,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);

Simulation of the transmitter

To model the characteristics of the transmitter, use the EngeePhased system object.Transmitter. The key parameter in the transmitter simulation is the peak transmission power. To determine the peak power of the transmitter, assume that the desired probability of detection is 0.9 and the maximum allowable probability of a false alarm is 10^(-6)
. Suppose that ten rectangular pulses are incoherently integrated in the receiver. The Albersham function can be used to determine the required 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. Let's say you want to set a peak transmission power to achieve the required SNR for a target up to 15 km away. Let's assume that the gain of the transmitter is 20 dB. Use the radar equation to determine the required peak transmission 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 transmission power is approximately 45 kilowatts. To ensure reliability, use a peak power of 50 kilowatts when simulating the transmitter. To maintain a constant phase of the pulse signals, set the CoherentOnTransmit property to true. Since the transmitter operates in monostatic mode (transmit-receive), set the InUseOutputPort property to true to record the status of the transmitter.

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

Simulation of the receiving and transmitting antenna

To simulate wave radiation, use the EngeePhased system object.Radiator. To simulate a narrowband signal receiver, use the EngeePhased system object.Collector. To collect the broadband signal, use the EngeePhased system object.WidebandCollector

In this example, the pulse satisfies the assumption of a narrowband signal. The carrier frequency is 4 GHz. To set the Sensor property, use the isotropic antenna knob. In the EngeePhased object.Collector set the Wavefront property to 'Plane' to indicate that the shape of the wave incident on the antenna is flat.

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

Receiver simulation

To model the receiver, use the EngeePhased system object.ReceiverPreamp. In the receiver, you set the noise factor and the reference temperature, which are the key factors influencing the internal noise of your system. In this example, the noise factor is 2 dB, and the reference temperature is 290 Kelvin. To get 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);

Modeling the distribution channel

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

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

Implementation of the basic radar model

After parameterizing all the necessary components of the scenario, pulses can be generated, propagated to and from the target, and echoes can be received.

The following code prepares the main simulation cycle. We will set the time step between the pulses using the code below:

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

You can run the main simulation cycle 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, we incoherently integrate the received echo signals, calculate the range vector, and plot a graph. The red vertical line on the graph indicates 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]: