Chapter 3
Chapter 3
Chapter 3
3 Description of software
In this chapter, we will explain the use of software in detail. We have used the following
software’s for our project
1) MATLAB
3.1 MATLAB
MATLAB is a software that provides us a programming platform used for iterative
analysis, algorithm development, creation of models, and applications. We have used
this software to develop a radar model, the target model and environment be the help of
a phased array toolbox. We have also used this software to quantize the data, verify the
output of Fourier transport taken from HDL approach by using HDL blocks to
implement the algorithm in Simulink (explained below), implementation of the
algorithm, and display the output i.e. Range Estimation of the target.
3.2.1.1. Defining the Parameters: The FMCW radar parameters such as the Bandwidth
‘bw’, sampling frequency ‘ F s’, Sweep time ‘T sweep’, Radar position and initial velocity,
target position, RCS and initial velocity, Operating frequency of the FMCW radar ‘ F c’
and the radar specification that includes the gains of the antennas and the transmitting
peak power.
Figure: Showing the parameters set for FMCW simulation in Simulink model
Range resolution ∆𝑅 c
∆𝑅 = =2.72m
2∗BW
Maximum beat frequency 𝑓𝑏𝑚𝑎𝑥 2∗BW∗R max
fbmax = =55MHz
c∗Tsweep
Figure: Frequency modulation using sawtooth waveform: (a) Spectrogram of the sawtooth
function, (b) Modulated signal in the time domain.
Figure: Sequence of Sawtooth waveform where bold lines shows the transmitted signal and
dotted lines shows the received signal
By using the FMCW waveform generator of the Phased Array toolbox a specified
sweep have been generated of a specified sweep time, bandwidth and sampling
frequency.
Figure: The following block represents the FMCW waveform implementation using the phased
array toolbox of the MATLAB
3.2.1.3. Phased.RadarTarget: Creates a radar target System object. It can set different
properties of targets like its mean Radar cross-section, target statistical model, etc. It
can also specify the target scattering mode, sources of the mean scattering matrix of
target, mean radar scattering matrix for polarized signal, signal propagation speed, and
signal carrier frequency etc. This is modelled in two parts as:
3.2.1.3.1. Target: It is modelled using the specifications of the target such as RCS and
the operating frequency
Figure: The target car modelled with phased array toolbox
Figure: The target car platform modelled with phased array toolbox
3.2.1.4. Phased. Platform: is used to model the motion of the platform in the
environment. The environment may contain free air, clutter, or target of interest. It can
model the motion of a platform e.g. the velocity and acceleration of the platform (e.g.
radar or garget). It can also be used to model object motion, the initial position of the
platform, current velocity of the platform, source of acceleration data, acceleration of
the platform, initial scan angle of the platform, azimuthal span, azimuth scan rate etc.
Figure: The radar platform modelled with phased array toolbox
3.2.1.5. Phased.Freespace: is used to model the free space environment .here the user
can set different properties of free space, for example, the Signal propagation speed,
signal carrier frequency, Sample rate, Maximum one-way propagation distance, the
maximum number of input signal samples, etc.
Figure: The channel modeled as free space with phased array toolbox
3.2.1.6. Phased.Transmitter : is used to model the transmitter of an antenna where we
can define different parameters of transmitting antenna e.g. its peak power, transmit
gain, loss factor, preservation of coherence among pulses, pulse phase noise output.
Each of these parameters have their default value. If the user does not define their value,
then the default value of that parameter is set.
3.2.1.8. Phased.RangeResponse: is used to find out the range response of the signal.
It finds out the response to a fast time and slow time data. It takes the input parameters
as Propagation Speed, beat Frequency, Sampling Rate, Range Method Sweep Slope,
and Range FFT Length.
3.2.1.8.1.1. Dechirp:
It mixes the input signal with the reference signal. The input signal can be a matrix
where each column is an independent channel. The reference signal is a vector. The
reference signal is conjugated and then multiplied with each column to compute the
output.
It is used to estimate the range of target detections found in the radar data by
analysis of beat frequency. It takes the input parameters as Propagation Speed, beat
Frequency, Sampling Rate, Range Method Sweep Slope, and Range FFT Length.
c∗Tsweep
R=
2∗BW ∗fb
Figure: Matlab code for finding the range from beat frequency, implemented in the Range
estimation Algorithm modelled in Simulink
The model simulation shows that the Range Estimation for a target vehicle placed at a
distance of 50, from the Radar comes out to be 49.63m with the FMCW Phased Array
approach.
To program zynq SoC , we have used HDL coded blocks in Simulink to implement the
whole model as Hardware in Loop.
HDL Coder Blocks in MATLAB Simulink automatically generates HDL code from
MATLAB, allowing to implement FPGA and ASIC designs from the widely used
MATLAB language that allows the FPGA hardware-in-the-loop capabilities for testing
FPGA and ASIC designs. With it, MATLAB now provides HDL code generation and
verification across MATLAB and Simulink. HDL Coder generates portable,
synthesizable VHDL and Verilog code from MATLAB functions and Simulink models
that can be used for FPGA programming or ASIC prototyping and design. As a result,
we can now immediately identify the best algorithm for hardware implementation.
Traceability between Simulink models and generated HDL code also supports the
development of high-integrity applications and readily testing of the algorithm on the
hardware.
3.2.2.1. Waveform: The FMCW waveform i.e. the sweep is generated using the HDL blocks.
The main working is to find a complete new algorithm in order to generate a sweep with HDL
coded blocks identical to the one generated using the phased array toolbox waveform. This is
done as described in detail below.
y=mx
BW=55e6
Fs=56e6
Δcount=100e3
X=0:100,000:55e6
BW 55e6
∗1 ∗1
Tsweep=No.of steps*sample time= Δcount = 100000 =9.82e-6 seconds
Fs 56e6
count max :
count max
∗1
Tsweep=No.of steps*sample time= Δcount
Fs
The NCO HDL Optimized block generates real or complex sinusoidal signals, while providing
hardware-friendly control signals. The block uses the same phase accumulation and lookup table
algorithm as implemented in the NCO block. The block uses quantized integer accumulation to
create a sinusoid signal.
The main task is to develop an algorithm for the phase increment of the NCo block in order to
generate an increasing frequency sinusoidal i.e. a Chirp
This is done by giving the input of the phase increment of the NCO Optimized Block with a
COUNTER that generates a max count according to the following calculations as:
BW ∗2Nacc
Phase increment= =644366
Fs
Where Nacc is the accumulator word length. The phase increment is specified using an input port
as shown.
Figure: Implementation of Phase increment for NCO through input port as gain
3.2.2.1.1.2. Counter
The counter is implemented as follows that takes the step size and continues incrementing until it
reaches the maximum count i.e. 54992e3
Figure: The Counter implemented in chirp generator with upper limit set as max_count
The chirp generated from the FMCW waveform block and that from the chirp generator
using HDL optimized blocks is shown as follows. Both the chirps are almost identical. The
difference is due to the fractional point approximation as the FMCW has lesser precision as
compared to the HDL approach.
Figure: Comparison of chirp generated via FMCW block of the Phased array Toolbox and that
by NCO built HDL optimized Approach.
3.2.2.2. Transmitter and Receiver: There is no need for transmitter and receiver to be
separately defined in the HDL optimized approach as the chirp after generation is
directly sent to the target which after reflection is processed in the range calculator
block by taking its FFT.
Figure: Deserializer block with output/input vector size ratio set as 3000
3.2.2.4. Channel and Target: The channel and target are implemented as they takes
inputs the information regarding the radar and target positions as well as velocity, also
the target specifications such as RCS and set up channel propagation for the chirp. It
consists of:
3.2.2.4.1. Car Target: The car target Compute the signal echo according to the
specified radar cross-section (RCS) or scattering matrix (when polarization is enabled).
The target is set into non fluctuating Swerling models
3.2.2.4.2. Car Platform: It models the motion of platforms such as airplanes or ground
vehicles. Platforms can be configured using either constant velocity or constant
acceleration models. The orientation of the platforms can also be specified.
3.2.2.4.4. Channel: The Propagation channel between the radar and the car is set to be
free space with maximum one way propagation distance set as 1473m equal to R_max.
3.2.2.5. Dechirp: It mixes the input signal with the reference signal. The input signal
can be a matrix where each column is an independent channel. The reference signal is a
vector. The reference signal is conjugated and then multiplied with each column to
compute the output.
Figure: The Dechirp Algorithm modelled in Simulink
3.2.2.6. Buffer: It converts scalar samples to a frame output at a lower rate. The output
buffer size is set to be 2^16 =65536 and it is the same number as the number of FFT
points taken. The Buffer block always performs frame-based processing. The block
redistributes the data in each column of the input to produce an output with a different
frame size. Buffering a signal to a larger frame size yields an output with a slower frame
rate than the input.
Figure: The Buffer block modelled in Simulink with output size as 65536
3.2.2.7. FFT-fast Fourier Transform: It computes the fast Fourier transform (FFT) across the
first dimension of the input. When you set the 'FFT implementation' parameter to 'Radix-2', the
FFT length must be a power of two and in this case it is selected as 2^16 = 65536 FFT points.
BEAT FREQUENCY
FFT RANGE
(MAX)
Due to the unavailability of hardware, we were not able to implement signal processing
on hardware. For this, we simulated the FFT in HDL implementation.
3.2.2.8. Square Law Detector: The FFT output is squared as in to process in the range
calculation block
3.2.2.9. Range Calculation: The range is estimated by finding the maximum of peaks of the
FFT output and then multiplying it with the gain as follows:
8∗56 e 6
C∗fb∗Tsweep 3 e ∗9.82 e−6
Range= = 216 *[FFT of fb]
2∗BW
2∗55 e 6
Figure: The Range Estimation Algorithm modelled in Simulink
Figure: The HDL Coder Block Implementation of FMCW Radar for Range Estimation
The model simulation shows that the Range Estimation for a target vehicle placed at a
distance of 50, from the Radar comes out to be 50.89m with the FMCW HDL coder
based approach and is accurate since the range resolution for our design is 2.72m.
Figure: A stationary target at distance of 50m from a stationary car having FMCW radar
We have determine the fundamental waveform parameters for a radar working at 2 GHz in the
MATLAB environment using Phased Array System Toolbox functionality. In the case, we
assume the car as well as the target to be stationary at a distance of 50m from the car radar.
The first problem we have to cope with when designing a new algorithm for the FMCW
waveform generation which is HDL supported in order to run it on the Hardware. We have
successfully developed, simulated and tested the Chirp Generator to determine the range of the
stationary single target with desired resolution within the specified range. We consider an
automotive long-range radar with maximum unambiguous range of 1473 meters and a minim
detectable range of 5.45 meters simulated with an operating frequency of 2GHz and a sampling
frequency of 56 MHz over a bandwidth of 55 MHz that is supported by the hardware.
c∗Tsweep
Maximum Unambiguous distance= Rmax = =1473m=
2
c
Minimum distance/Range that can be measured= Rmin = =5.45m
BW
c
Range Resolution: =2.72m
2∗BW
Chapter 4
4 Simulations and Results
In this chapter, we will explain the simulation results of the software. As we have
implemented the FMCW radar with two approaches as to create the software as well as
hardware environment and to test the designed radar in both approaches and verify the
results. This chapter covers the simulation of the FMCW radar for Range Estimation of
a single stationary target in:
The flow chart below demonstrates the basic process of the FMCW radar for range estimation
FMCW
Parametrs set Waveform Transmisson Recieved signal
Generation
Beat
Range Peak
Frequency Dechirp
Estimation estimation
Analysis
4.1.2. Parameters:
To generate the simulated data of FMCW radar we used a “phased array toolbox”. To
generate a FMCW sawtooth waveform we need sweep time, bandwidth, and sample
frequency. To set these parameters we need to define system parameters that fulfill the
requirement of our project.
The sweep time of the sawtooth waveform can be calculated from the basic equation of
Radar:
The bandwidth of the sawtooth waveform can also be calculated from the same formula
as mention above
Sampling frequency 𝑓𝑠 is chosen to be 56 MHz which fulfills the criteria since the
Bandwidth is 55 MHz
4.1.3. Simulations:
After defining a set of variables for all the parameters needed to describe our automotive FMCW
radar system, we proceed with a complete PC simulation to test whether the System will work
properly. To do that we use a Simulink model with blocks that have as parameters the variables
from the MATLAB workspace that have been set with the script described in the section of
setting parameters.
In this after the FMCW waveform have been transmitted and received back from its reflection
from the target, both the transmitted and received signals are dechirped and produces a beat
frequency which is then analysed to determine the range of the target
.
Beat
Dechirpin
FMCW frequency
g Tx and
Waveform peak
Rx signals
geneartion analysis
Recieved Range
Transmissio
back (after estimation
n (free space
reflection
channel)
from target)
The waveform generated by setting the following parameters with the help of the phased array
tool box is a sawtooth waveform that is the actual waveform of our interest in the case and is as
follows as shown
Figure: The spectrogram shows a sawtooth waveform for the FMCW Chirp.
Figure: The scope output that shows a sawtooth waveform for the FMCW Chirp that is a
sinusoidal in time domain
Now our next task is to generate Radar, target, channel, and transmitter and receiver
model using a phased array toolbox. The generation of different models is explained in
chapter 3. According to Radar model, the radar as well as the target are both stationary.
The distance between the radar and target is 50𝑚.
Now we have to generate a simulated data of FMCW radar, so we need to transmit the
signal. For this, we have transmitted the signal. The Position of the target and radar is
updated with the passage of time. Then the signal is transmitted and passed through a
channel. When this signal hits the target and reflects back a Doppler will be added in it.
The received signal contains the information of transmitted signal and Doppler shift so
we dechirp the received signal so in end we only had the information of beat frequency.
4.1.3.3. Beat Frequency
The received signal is an attenuated and time-delayed copy of the transmitted signal where the
delay, Δt is related to the distance of the target. Because the signal is always sweeping through a
frequency band, at any moment during the sweep, the frequency difference fb, usually called
beat frequency, between the transmitted signal and the received signal is constant. Because the
sweep is linear, one can derive the time delay from the beat frequency and then the distance of
the target from the time delay.
The frequency of the beat-note signal is the basis of the range estimation for FMCW radar. The
instantaneous phase of the sampled series is calculated and is then used to estimate the frequency
of the beat signal that is the difference between the transmitted and the received signal.
4.1.3.4.1. FFT:
For exposing the frequency content of the received time signal the FFT is applied. It is used
because of its low computational cost and its robustness against low SNR. Its main disadvantage
is when two frequencies are close to each other, then only one of them will be detected. The
resolution limit is given by fmin = Fs /N, where Fs is the sampling frequency and N is the
number of samples from the continues signal. Therefore the most natural approach when high
frequency resolution is required, is to increase the number of samples N. This provides the
higher resolution in most of the cases, but not when working with an FMCW radar signal. This
can be proven by rewriting the beat frequency:
2∗BW∗R
f b=
c∗T sweep
c∗T sweep
→ R=
2∗BW∗f b
It proves that the standard way of providing increased resolution does not work. The only thing
that can be done is to increase the bandwidth B of the transmitted signal which is not an option
because of legal requirements and hardware related problems. The limit hmin will in reality also
be degraded since the beat signal is multiplied with a window.
The first step is identification of tones in the “beats” signal, which then correspond to the ranges
of the targets. The straightforward approach is to use Fast Fourier Transform (FFT) algorithms.
The tones identified correspond to target candidates.
4.1.3.4.2. Interpolation:
When calculating the FFT it produces values at the FFT frequencies which are equally spaced
with Fs/N Hz. This introduces an error when using peak picking if the true frequency is not
located at an exact multiple of F/ N . Instead the true frequency is in the range:
To reduce this error different methods have been suggested over the years. The idea behind them
is best described by the following figure. The figure presents the values from an FFT operation
where the maximum peak is located around 2.05 m. By examining the two closest frequencies
one can see that the frequency to the right has a larger amplitude than the frequency to the left. It
is then reasonable to assume that the true maximum is located somewhere in between the
maximum frequency and the frequency to the right. This is what is called interpolation,
combining the discrete frequencies close to the maximum and thus receive a better estimate of
where the true maximum is located.
Figure: The idea of interpolation explained. The FFT provides the blue lines and the maximum frequency
is located at an offset from the true maximum, the orange line.
The simulation of the FMCW Radar in Simulink using the phased array approach shows
a range estimation of 49.63 meters for a stationary target at a distance of 50 meters from
the target which is very accurate result since the frequency resolution of the radar is
2.72m
The following table shows a simulation results of the Phase Array Toolbox supported design of
the FMCW Radar taken for readings by incrementing the target distance by 10 from
Rmin=5.45m to Rmax=1473m. The estimated range is within the range resolution of the radar
which is 2.72 meters. Thus it shows successful simulation on software.
The following flow diagram shows the process of the Radar Simulation in Matlab. Due to
unavailability of hardware the results have been displayed on matlab with user defined data. Else
the design is ready to be tested on real time data by incorporating hardware in loop with the help
of HDL coded blocks.
Beat Recieved
FFT Dechirp
Frequency Signal
The main task in the HDL coder approach is to generate an algorithm for generating a chirp that
is supported by the hardware as the phased array toolbox FMCW waveform is not supported by
the hardware.
This is done by incorporating a NCO’s phase increment with a counter. In this way it gives an
increasing frequency sinusoidal which is actually our Chirp.
Δcount=100e3
X=0:100,000:55e6
BW 55 e 6
∗1 ∗1
Tsweep=No.of steps*sample time= Δcount = 100000 =9.82e-6 seconds
Fs 56 e 6
count max :
count max
∗1
Tsweep=No.of steps*sample time= Δcount
Fs
count max =Tsweep*Δcount*Fs=9.82e-6*100000*56e6=54992e3
Figure: Implementation of Chirp Generator Algorithm using HDL supported Simulink blocks
through Phase increment for NCO through input port as gain
The chirp generated from the FMCW waveform block and that from the chirp generator
using HDL optimized blocks is shown as follows. Both the chirps are almost identical. The
difference is due to the fractional point approximation as the FMCW has lesser precision as
compared to the HDL approach.
Figure: Comparison of chirp generated via FMCW block of the Phased array Toolbox and that
by NCO built HDL optimized Approach.
4.2.4. Simulations:
After defining a set of variables for all the parameters needed to describe our automotive FMCW
radar system, we proceed with a complete PC simulation to test whether the chirp generator will
work properly. To do that we use a Simulink model with blocks that have as parameters the
variables from the MATLAB workspace that have been set with the script described in the
section of setting parameters. After the FMCW waveform have been generated, simulated and
received we perform FFT analysis on the received as well as the transmitted signal to calculate
the beat frequency from which the range of the target is estimated.
BEAT FREQUENCY
FFT RANGE
(MAX)
As shown in Figure, the received signal is an attenuated and time-delayed copy of the transmitted
signal where the delay, Δt is related to the distance of the target. Because the signal is always
sweeping through a frequency band, at any moment during the sweep, the frequency difference
fb, usually called beat frequency, between the transmitted signal and the received signal is
constant. Because the sweep is linear, one can derive the time delay from the beat frequency and
then the distance of the target from the time delay.
Figure: Beat frequency, difference between the transmitted and received signal
2∗BW ∗R
fb= =1.866938 MHz
c∗Tsweep
As shown in the simulation results the beat frequency comes out to be 2.07 MHz which is nearly
equal to the calculated one.
In order to determine the different requirements and specifications of the FCMW radar system, it
is necessary to consider the radar equation that determines the received power
Pt G t G r λ 2 σ
Pr = = -107.8dB
( 4 П)3 R4
4.3.4.3. Range Estimation
The range is estimated by applying fast Fourier transform on the beat frequency with FFT points
taken as
4∗BW∗Rmax
N= c
=1080.2
Since FFT points are a power of 210=1024 points is near to the calculated points but we have
taken 216 FFT points as at this the simulations gives better results moreover the hardware can
support up to 34 bits transform size that is it can support FFT points up to 234. So from this
maximum beat frequency peak is estimated and then processed
In an FMCW radar the frequency of the transmitted signal is linearly varied over time. Since
there is a certain distance between the radar and the target, the reflected signal varies in
frequency compared to the currently transmitted frequency. To determine the distance of a target
the difference in frequency, called beat frequency between the transmitted and the received
signal is evaluated. For slow moving targets which can be regarded as stationary during one
measurement cycle a saw tooth modulation scheme can be used. In the case of a single target a
single beat frequency is induced, which has a sinusoidal form in time domain. The beat frequcy
is then translated into the Range by the following relation:
8∗56 e 6
C∗fb∗Tsweep 3 e ∗9.82 e−6
Range= 2∗BW = 216 *[FFT of fb]
2∗55 e 6
4.3.4.4. Simulation Results
The simulation of the FMCW Radar in Simulink using the HDL supported approach
shows a range estimation of 50.89 meters for a stationary target at a distance of 50
meters from the target
The following table shows a simulation results of the HDL supported design of the FMCW
Radar taken for readings by incrementing the target distance by 10 from Rmin=5.45m to
Rmax=1473m. The estimated range is within the range resolution of the radar which is 2.72
meters. Thus it shows successful simulation and testing of our Radar design that is HDL
hardware supported.
Distance
Range of Target Distance Range of Target
ofTarget Error: Error:4
Estimated: ofTarget:2 Estimated:3
:
-
4 5.453213784 260 261.5344105 -0.005901579
0.363303446
-
5 5.453213784 270 272.5408381 -0.009410511
0.090642757
6 5.453213784 0.091131036 280 277.9940518 0.007164101
-
10 10.90642756 290 288.9004794 0.00379145
0.090642756
-
20 21.81285511 300 299.806907 0.000643643
0.090642756
30 29.96271307 0.001242898 350 350.8934726 -0.002552779
40 38.17249645 0.045687589 400 399.1118608 0.002220348
50 49.07892401 0.01842152 450 450.007777 -1.72822E-05
60 59.98535156 0.000244141 500 500.9036932 -0.001807386
68.13520952 0.026639864 550 549.0991966 0.001637824
80 79.04163707 0.011979537 600 599.9951127 8.14542E-06
90 89.94806463 0.00057706 650 650.8910285 -0.001370813
-
100 100.8544922 700 699.1094172 0.001272261
0.008544922
-
110 111.7609197 750 749.7764848 0.00029802
0.016008361
120 119.9107777 0.000743519 800 800.9012496 -0.001126562
-
130 130.8172053 850 849.1196378 0.00103572
0.006286194
-
140 141.7236328 900 899.9926691 8.14542E-06
0.012311663
150 149.8734908 0.000843395 950 950.8885853 -0.000935353
160 160.7799183 -0.00487449 1000 1000.231457 -0.000231457
-
170 171.6863459 1050 1050.00289 -2.75213E-06
0.009919682
180 179.8961293 0.00057706 1100 1100.898806 -0.000817096
190 188.0459872 0.010284278 1150 1150.013458 -1.17024E-05
200 198.9524148 0.005237926 1200 1200.01311 -1.09253E-05
210 209.8588423 0.000672179 1250 1250.909027 -0.000727221
220 220.7652699 - 1300 1299.10453 0.000688823
0.003478499
230 228.9151278 0.004716835 1350 1350.000446 -3.30453E-07
240 239.8215554 0.000743519 1400 1400.896362 -0.000640259
-
250 250.727983 1450 1449.114751 0.000610517
0.002911932
-
260 261.5344105 1473 1473.212502 -0.000144265
0.005901579
Parameters Range 𝑚
Actual Values 50
Phased Array Approach 49.63
HDL Supported Approach 49.07