<<

CALIFORNIA STATE UNIVERSITY, NORTHRIDGE

Frequency Modulated Design and Simulation

A graduate project submitted in partial fulfillment of the requirements

For the degree of Master of Science in Electrical Engineering

By

Mark Christopher Fessia

December 2018

The graduate project of Mark Christopher Fessia is approved:

______Dr. Ali Amini Date

______Mr. James A. Flynn Date

______Dr. Deborah K. Van Alphen, Chair Date

California State University, Northridge

ii

Table of Contents

Signature Page ii List of Tables iv List of Figures v Abstract vi

Section 1: Objective 1 Section 2: Introduction 3 Section 3: Literature Review 11 Section 4: Analysis and Design 13 Section 5: Implementation 31 Section 6: Testing and Results 57 Conclusion 65 References 67 Appendix A: MATLAB Source Code 69

iii

List of Tables

Table Number Caption Page 4.1 Modulator Simulation Parameters 15 4.2 Voltage Controlled Oscillator Simulation Parameters 17 4.4 Low Noise Amplifier Simulation Parameters 20 4.6 Simulation Parameters 23 4.9.1 Simulation Parameters for Radar Equation 27 4.9.2 Simulation Parameters for Maximum Range Calculation 29 5.2.1 phased.FMCWWaveform Parameters 33 5.2.2 comm.PhaseNoise Parameters 34 5.4 phased.ReceiverPreamp Parameters 37 5.6.1 phased.CustomAntennaElement Parameters 40 5.6.2 phased. Parameters 41 5.6.3 phased.Radiator Parameters 42 5.6.4 phased.Collector Parameters 43 5.8.1 Low Pass Filter Specifications 45 5.9.1 phased.FreeSpace Parameters 49 5.9.2 phased.RadarTarget Parameters 50 6.1 Theoretical vs. Measured Signal Power 57 6.2 Target Range Calculation Parameters 59 6.3 Moving Target, Velocity and Range Calculation Parameters 62 7.1 Range and Velocity Measurement Errors 65

iv

List of Figures

Figure Number Description Page 2.1 Architecture of CW radar. 6 2.2 Architecture of FM-CW radar. 8 4.1 Modulator output voltage (one period). 16 4.2.1 VCO output signal. 18 4.2.2 Power spectral density of VCO FM signal. 18 4.6.1 The coffee can antenna design diagram. 21 4.6.2 The coffee can pattern measurements. 22 4.6.3 Antenna gain pattern polar plots and 3D approximation. 23 4.9.1 Received power vs. target range using radar equation. 28 5.1 Modulator output voltage, triangle wave output. 32 5.2.1 Power spectral density of baseband VCO FM signal. 34 5.6.1 Modeled antenna gain pattern. 40 5.8 Magnitude response of the 5th LPF (video signal). 45 5.9.1 Satellite image of simulated radar test location. 47 5.9.2 Test location, showing 100 m distance and discretes. 48 5.9.3 Ground clutter triangle mesh superimposed on satellite image. 52 5.9.4 Modeled test location showing mesh, discretes, and target. 53 5.9.5 Exaggerated elevation plot of triangle mesh. 53 5.9.6 Subdivided triangle clutter mesh. 55 6.1 Resulting tone from stationary target at 100 m. 59 6.2 Resulting tone from stationary target at 60 m. 60 6.3 Resulting tones from target at 72 m, with velocity of 25 m/s. 61 6.4 Resulting tones from target at 43 m, with velocity of -25 m/s. 63

v

Abstract

Frequency Modulated Continuous Wave Radar Design and Simulation

By Mark Christopher Fessia Master of Science in Electrical Engineering

The intent of this project was to design and simulate a frequency modulated continuous wave (FM-CW) radar system capable of making target range and velocity measurements.

MATLAB was used to model each component of the FM-CW radar system and simulate transmit and receive signal behavior, channel effects, and target radar cross section (RCS) characteristics. A top-down approach to the design of the FM-CW radar system was presented beginning with an overview of theory and architecture followed by a detailed explanation of each component in the signal path. Key interactions between components were discussed as well as potential differences between real world components and their simulated counterparts. An overview of the signal processing techniques and software architecture required to make target range and velocity measurements was also presented and implemented. An overall FM-CW radar system simulation was implemented in

MATLAB including simulated channel effects and targets. The simulation was run so that resultant target range and velocity measurements were obtained and radar system performance and simulation fidelity were evaluated and presented.

vi

Section 1: Objective

While the applications of radar systems are numerous, the main objective of this project was to design, model, and simulate an FM-CW radar system capable of making target range and velocity measurements inside of one kilometer for targets having an RCS approximately equal to that of a car. To achieve this, MATLAB objects were used to model the radar system components, frequency (RF) environment, target RCS characteristics, and behavior of the transmitted and received signals. Additional signal processing to derive range and velocity measurements was also demonstrated using

MATLAB.

Real-world FM-CW radar designs for educational purposes such as the MIT "coffee can" radar by Charvat, Williams, Fenn, Kogan and Herd (2011, [3]) provided the inspiration for this project. It was intended that the project data and simulation results presented in this report will be useful to those who wish to explore the field of radar design and will provide deeper insight to those who are interested in completing real-world do-it-yourself radar projects or radar kits like those offered by Pasternack or Quonset . As such, the radar system for this project was modeled using a frequency of 2.45 GHz and low transmit power of 13 dBm since under these conditions, a number of cost effective real-world radar designs could be constructed and tested utilizing the industrial, scientific, and medical (ISM) band which would not require a license to operate.[5]

In order to achieve the main objective of this project there were five sub-objectives that drove key decisions during design, modeling, and simulation:

1. Design, model, and simulate a FM-CW radar system using MATLAB.

1

2. Accurately model the environmental RF channel effects that the radar signal will

experience as it propagates to and from the target.

3. Accurately model physical properties of the target such as range, velocity and RCS in

order to simulate a return signal.

4. Process radar return data in order to demonstrate target range measurements.

5. Process radar return data in order to demonstrate target velocity measurements.

The main objective and all sub-objectives were completed successfully for this project.

2

Section 2: Introduction

Continuous wave (CW) radar has widespread applications. Every time one steps through the automatic doors at a grocery market they enjoy the benefits provided by a CW radar system which detected their movement and cued the door to open. Alternately, if one has ever gotten a speeding ticket, it is very likely that the officer issuing the citation used a speed detection radar based on a CW radar design. Indeed, this is a case where the cited individual perhaps did not enjoy the use of such radar. While the applications for CW radar are numerous, this project focused on how a CW radar system may be designed, modeled, and simulated using MATLAB. In this section the basic theory of a CW radar system will be introduced followed by a discussion on how the system may be used to obtain target velocity measurements and lastly how the system can be adapted using frequency modulation (FM) to obtain both target range and velocity measurements.

The fundamental theory behind CW radar operation has been known since 1928 where it was initially conceptualized for the use of altitude determination and later practically implemented for such purposes by the Western Electric Company in 1938.[14] The architecture of CW radar is generally less complex when compared to that of pulsed radar systems which makes it particularly accessible to those looking to complete a do-it- yourself radar project or explore the ways in which useful information can be obtained from the echo of a CW radar system. It is expected that the reader is comfortable with basic electromagnetic (EM) wave theory, communication principles such as the time and frequency domain relationship, fundamental linear algebra concepts, and physical phenomena such as the Doppler effect.

3

Radar systems are devices that transmit controlled, oscillatory, EM energy towards an object of interest. When the EM energy reaches the surface of the object it is scattered in many directions; some of the energy is scattered back towards the direction of the radar.

The radar system receives this energy, often referred to as the return or echo, and analyzes it to determine useful information about the object. Information can include the direction of the object relative to the radar, distance of the object relative to the radar, referred to as the range, and the direction and speed of the object relative to the radar, referred to as relative (or radial) velocity. This is the very basic notion of a radar and it is for this reason that the acronym RaDAR (which has been turned into a word) stands for radio detection and ranging.

Pulsed radar systems transmit EM energy in the form of short bursts; however CW radar systems are aptly named since they transmit a continuous sinusoidal pulse (or wave) with a 100% duty cycle at a particular frequency. Because of the continuous nature of the transmission, a CW radar must usually be bistatic, having separate transmit and receive antennas. Additionally, the coupling of transmitter energy into the receiver becomes a serious concern when the antennas are close together or do not have adequate isolation.[15]

The basic premise of a CW radar is to transmit a continuous pulse in the direction of a target and receive the resultant echo. If one were to view the continuous pulse in the frequency domain they would see an impulse at the transmit frequency (theoretically, the impulse would exist at the transmit frequency on both positive and negative sides of the spectrum). This continuous pulse radiates from the transmit antenna, propagates through the environment and scatters off of the target. The amount of energy scattered back

4 towards the radar is determined by the target's radar cross section (RCS).[15] The energy scattered back towards the radar is greatly attenuated by the time it reaches the receive antenna so a low noise amplifier (LNA) is usually employed just after the antenna to improve echo processing. The radar not only receives the desired echo from the target but receives returned energy from propagation effects and scattering from other objects in the environment as well; the undesired return from these objects is referred to as clutter.

Separating the target echo from the clutter is desired for accurate measurements and is discussed in more depth in Section 4.

The chief principle behind how the CW radar is able to determine a target's radial velocity (that is, the component of the target's velocity in the direction of the radar) is due to the Doppler effect which causes a compression or expansion of the returned sinusoidal radar echo depending on whether the target is traveling towards or away from the radar.

The frequency of echoes received from a target moving toward the radar will be higher than the original frequency of the transmitted sinusoid, and the frequency of echoes received from a target moving away from the radar will be lower than that of the transmitted sinusoid. The difference in frequency between the received target echo and the transmitted sinusoid is called the Doppler frequency shift and is a function of the transmit frequency or wavelength and speed of the target towards or away from the radar.

It is given by

(1)

where is the Doppler frequency shift, is the radial velocity of the target in the direction of the radar and is the transmit wavelength. It is important to recall that frequency and wavelength are related by

5

(2) where is frequency, is the wavelength and m/sec is the speed of light in free space.

To facilitate a velocity measurement by a CW radar, the architecture in Figure 2.1 may be used.

Figure 2.1: Architecture of CW radar (Charvat, 2017 [4])

Once the CW signal is generated by the oscillator, it is split and sent to the transmit antenna and also mixed (multiplied) with the received signal. This accomplishes two key functions in one operation. First, it effectively performs a down conversion of the useful spectral content in the received high frequency signal to a zero Hz intermediate frequency

(IF) which is easier to process. The practice of down converting a high frequency signal to a lower IF by way of mixing is referred to as heterodyning; conversion to an IF of zero

6

Hz is called homodyning. Second, Fourier theory dictates that when two sinusoidal signals at different and are multiplied in the time domain, the resultant signal includes a sinusoid or tone whose frequency is equal to the absolute value of their difference . If is taken to be the transmitted CW frequency at and is taken to be the received target echo which is the transmitted frequency shifted up or down by the Doppler effect , their result when mixed is

(3)

where is equal to the Doppler frequency shift of the moving target. This frequency shift can be used to find the radial velocity of the target using (1).

This method has a notable shortcoming. The sign of the Doppler frequency shift is lost, so modifications to the radar architecture would be needed to tell whether the target was moving towards or away from the radar. This will be directly addressed by the radar system presented in this project.

It was shown how a CW radar can obtain basic target velocity measurements; attention will now shift to how the CW radar can be modified so that target range measurements can be obtained. This can be done by modifying the transmitter of the CW radar so that instead of producing a continuous wave at constant frequency, the transmitted waveform is modulated up or down in frequency as it is being transmitted. This can be accomplished practically by replacing the oscillator in Figure 1 with a voltage controlled oscillator (VCO) driven by a voltage modulator.

7

Figure 2.2 shows how these modifications were incorporated. The resulting architecture was used for this project and enabled both velocity and range measurements to be obtained.

Figure 2.2: Architecture of FM-CW radar (Charvat, 2017 [4])

The architecture presented in Figure 2.2 can support range measurements using a technique commonly referred to as stretch processing[9]. In stretch processing, the frequency of the transmitted waveform will be linearly swept from a lower to higher frequency (sometimes referred to as an FM chirp or ramp) over a specified time interval.[17] The amount of change from the highest to the lowest frequency, or bandwidth, and the time over which that change occurs determines the range resolution and receive window of the system. These details are covered more thoroughly in Section

4 and 5.

The main concept of the stretch processing technique relies on the fact that there will be an instantaneous frequency difference between the signal currently being transmitted and the echo signal currently being received. This frequency difference is related to the round trip delay of the received target echo by

8

(4)

where is the instantaneous frequency difference, is the bandwidth of the transmitted signal, is the pulse duration, m/sec (the speed of light in free space), and is the range of the target.

When the signal being transmitted is also mixed with the received echo, the result includes a sinusoid or tone with a frequency equal to the difference in frequency between the two signals. The resultant tone at the frequency difference between the transmitted and received signals will change proportionally with the target's range according to (4).

This is the basic concept for how the radar modeled and simulated in this project obtained target range measurements.

This technique requires some modification however when it is desired to measure the range of moving targets since there is a Doppler induced frequency shift in the returned echo. To overcome this, no architectural changes are needed, but some additional modulation and signal processing techniques can be used. The transmitted signal is first increased then decreased in frequency over a specified time interval. When the returned echo is mixed with a portion of the transmitted signal during the receive window, the result is still a tone at a frequency equal to the difference in frequency between the transmitted and received signals. However, the resultant tone frequency will be different depending on whether the return is being mixed with the increasing frequency segment or decreasing frequency segment of the transmitted signal. When the average frequency of these two resultant tones is calculated, it is proportional to the range of the moving target by (4).

9

This introduction has provided a summary of how velocity and range measurements may be obtained using the system architecture presented in Figure 2. These topics are covered in greater detail in subsequent pages which are intended to serve as an aid to those interested in how real-world, do-it-yourself radar systems may be constructed and tested.

It is for this reason that the hardware components modeled in this project were based on real-world counterparts and the simulation was carried out using MATLAB techniques aimed at increasing simulation fidelity.

In the next sections, the reader will be provided with the following:

1. A literature review of sources utilized for the project.

2. A detailed presentation of the analysis and design process used to acquire the

desired radar system performance.

3. A thorough overview of how system modeling and simulation were implemented

using MATLAB objects.

4. A presentation of significant simulation results.

5. The project conclusion.

10

Section 3: Literature Review

One of the most intriguing aspects of RF and microwave communications in electrical engineering is that the signals cannot be directly observed by humans, indeed one cannot look out their window in the morning and "see" the signals radiating from the local radio station. Luckily the effect these signals have on other physical components can be observed and measured through the use of instruments such as an oscilloscope or spectrum analyzer. However, having the ability to predict how an RF or microwave signal will behave in a specific context is of paramount importance to the electrical engineer. It is for this reason that generous study of the books describing such RF and microwave behavior was necessary to enhance understanding of radar system theory, architecture, simulation, target characteristics, clutter effects, and signal processing.

The general theory of obtaining velocity and range measurements using FM techniques put forth by Stimson (1998, [17]) was a very important and helpful starting point for this project. These theoretical constructs were practically realized and modeled using the prevalent design presented by Charvat et al. (2011, [3]). The simplicity of the design coupled with commonly available computing resources made the project very accommodating to real-world implementations and allowed for a high degree of analysis to be completed on simulation results.

The core concept for making both velocity and range measurements using the stretch radar processing technique presented by Skolnik (1962, [14]) and Mahafza (2004, [10]) was reliant on the results of mixing the signal currently being transmitted with the time- delayed, received, echo signal. Processing the signal tone(s) which result from mixing the transmitted and received signals was fundamental to obtaining both velocity and

11 range measurements. The FM-CW radar techniques, architecture, and engineering considerations presented by Skolnik (2008, [16]) and Sherman (1985, [12]) were reviewed and applied so that the desired performance could be obtained from the radar system being modeled. The content in these texts was particularly illuminating concerning the stretch radar technique and the application of the receive window to the

FM ranging procedure.

Once the radar system was modeled with MATLAB, the channel effects and targets still needed to be modeled accurately. Additional signal processing was needed to obtain the final results and analyze system performance. Many mathematical formulas used to represent the FM signal and stretch radar techniques were presented in Mahafza (2013,

[9]) and were adapted to meet the objectives of the project since it was based on

MATLAB modeling. Target range profile and RCS theory presented by Shirman (2002,

[13]) and Skolnik (2001, [15]) were incorporated into the simulation through the use of the MATLAB Phased Array System Toolbox. The statistical models and theory for simulating ground clutter, multipath effects, and receiver noise offered by Barton (1985,

[1]), Boothe (1969, [2]), Long (2001, [7]), and Kulpa (2013, [6]) were used to enhance the accuracy of the simulation.

While MATLAB provides built-in functions for working with signals in the time and frequency domain, additional signal processing theory was required for correctly obtaining results from the data produced by the simulation. Topics such as windowing, low pass filtering, decimation, and the effects of down-sampling on spectra presented by

Lyons (2011, [8]) were utilized to a great extent so that the simulation sample rates, accuracy, and running time could be kept within reasonable bounds.

12

Section 4: Analysis and Design

The FM-CW radar system was constructed from eight main components. These components were the modulator, VCO, attenuator, low noise amplifiers, splitter, antennas, mixer, and video amplifier. This section reviews the relevant parameters of each component and discusses how the component was utilized in the overall design of the radar system and simulation. Since each component being simulated was modeled after a real-world electronic device, the device part number is given, and any significant limitations of the device are discussed.

The goal of the project was to simulate the functionality of a home built radar system capable of making velocity and range measurements. The overall architecture of the radar FM-CW was introduced by Charvet et al (2011, [3]) and was shown in Figure 2.2.

The simulated version of the radar system created for this project follows that architecture.

The components and their signal outputs were modeled using a combination of pure

MATLAB code and helper objects including the Antenna, Communications, DSP, and

Phased Array Toolbox add-ons. The overall sample rate of the simulation was set at 6 giga-samples per second (GS/s) since this fulfills Nyquist criteria for 2.4 to 2.5 GHz signals which were generated by the VCO and transmitted. [8] Input and output impedance of each component was 50 Ohms and considered to be matched for the purposes of simulation.

13

4.1 Modulator Design

The first component discussed and indeed the component driving the entire system was the voltage modulator. The modulator was modeled after an XR-2206 monolithic function generator integrated circuit (IC) chip. It produced both the triangle wave used to drive the VCO and the synchronization square wave (trigger or sync signal) used to define the receive window interval. The receive window interval is used for processing the video signal output and determining the frequency difference between the transmitted and received signals. (The video signal is the conditioned output signal of the system containing the wanted and unwanted returns of all objects being illuminated by the radar.

Historically this was the name given to the signal which was prepared such that it could drive a Cathode Ray Tube (CRT) display.[17]) For a real implementation, the video signal output would be amplified and applied to the right channel of a 3.5 mm audio connector and the sync signal would be applied to the left channel. The audio connector could then be plugged into a personal computer and the radar signal could be sampled by a sound card at approx. 44 kHz and processed by software. It is for this reason that the video signal must also be low pass filtered after mixing to ensure it only contained tones within the audio frequency band (approximately 20 Hz to 22 kHz) for processing.

These considerations placed constraints on how the modulator was tuned since the triangle wave voltage produced by it drove the frequency output by the VCO. The difference in the frequencies produced by the VCO at two distinct points in time were required to:

1. Fall within the (relatively small) audio band of 0 to 22 kHz so the signal could be

readily processed.

14

2. Correspond to a signal round trip distance that was suitable given the relatively

low transmit power of the system and the relative strength of undesired signal

components due to antenna coupling, clutter, and receiver noise.

3. Correspond to signal round trip time that did not exceed the pre-described receive

window interval based on the synchronization signal period.

For purposes of the simulation, Table 4.1 lists the significant parameters of the modulator used to create the triangle wave signal and the corresponding receive window to fulfill these requirements.

Table 4.1: Modulator Simulation Parameters Parameter Value Units Maximum Signal Voltage 3.25 V Minimum Signal Voltage 1.91 V Voltage Swing 1.34 V Triangle Wave Period 6.7 ms Triangle Wave Frequency 151 Hz Receive Window Duty Cycle 99 % Receive Window Period 3.33 ms Samples in Receive Window 20e6 samples

Ensuring that there was a significant number of samples within the receive window interval was important since those samples were used to determine the difference in frequency between the transmitted and received signals. There was a receive window defined for both the increasing and decreasing sides of the triangle wave since processing the frequency difference for each side was necessary when determining the range of a target that was moving. It is important to note that the receive window interval was determined by evaluating the symmetry of the triangle wave and sync square wave produced by the XR-2206 IC. The period of each was 6.7 ms. The receive window was

15 then determined by dividing this value by two (one window for the side of the triangle with an increasing slope and one for the side with decreasing slope). The start of each receive window was delayed which dictated the maximum distance that a target could be accurately measured. This was necessary since this triangle signal was continuous and the frequency corresponding to the target return would overlap with the frequency of the signal being transmitted when the slope of the triangle wave changed. In order to prevent this overlap from interfering with the range measurement, the start of the receive window was delayed by 667 nano-seconds (4000 samples) which corresponded to a signal round trip distance of 100 meters. The calculated receive signal power at this range from the intended target with an RCS of 20 dBsm (similar to that of a car [15]) and transmit power of 13.5 dBm (prior to antenna gain) yields an adequate signal to noise ratio as will be shown in following sections.

A single period of the simulated triangle wave produced by the modulator is presented in

Figure 4.1.

Figure 4.1: One period of the triangle wave produced by the modulator.

16

The period and voltage sweep of the simulated triangle wave fell within the specifications of the XR-2206 IC. On the physical system, this signal would be generated by applying the proper timing resistors and capacitors to the IC pins and connecting the triangle wave output from the STO pin to the vtune pin of the Mini-Circuits ZX95-2536C+ VCO. In the simulation, the characteristics of this waveform were used as input to the VCO software object.

4.2 Voltage Controlled Oscillator Design

The VCO was modeled after the Mini-Circuits ZX95-2536C+ which is a novel RF component with SubMiniature version A (SMA) microwave connectors. The VCO was responsible for producing the FM chirp signal transmitted by the radar system. The bandwidth of the FM chirp signal was determined by the minimum and maximum voltages of the modulator triangle wave which corresponded to the desired signal frequency of 2.4 to 2.5 GHz. Table 4.2 lists the significant parameters of the VCO component used in the simulation which were consistent with real world specifications.

Table 4.2: Voltage Controlled Oscillator Simulation Parameters Parameter Value Units Maximum Frequency 2.5 GHz Minimum Frequency 2.4 GHz Bandwidth 100 MHz Quiescent Frequency 2.25 GHz Frequency/Voltage Slope 74.6 MHz/V Output Signal Power (approximate) 6 dBm 1 kHz Noise -76 dBc/Hz

Figure 4.2.1 displays frequency vs. time for the VCO output signal. Figure 4.2.2 displays the power spectral density (PSD) of the VCO output after phase noise effects were added.

17

Figure 4.2.1: VCO output signal

Figure 4.2.2: PSD of VCO output signal

The combination of modulator and VCO parameters presented produced an FM-CW signal suitable for measuring targets out to 100 meters which corresponded to a of

20 kHz according to (4).

The VCO output signal power was approximately 5.7 dBm across the 2.4 to 2.5 GHz band and was passed via 50 ohm SMA connection to the 3dB attenuator.

18

4.3 Attenuator Design

The 3 dB attenuator was modeled after a Mini-Circuits VAT-3+ with 50 ohm SMA connectors. It was used to prevent the output of the VCO from saturating the amplifier that came next in the signal path.[4] Thus the attenuator had approximately 5.7 dBm at its input and 2.7 dBm at its output. In this simulation, this was taken into account by scaling the input signal by -3 dB.

4.4 Low Noise Amplifier Design

There were two low noise amplifiers present in the design. They were each modeled after the Mini-Circuits ZX60-272LN+ LNA. This LNA had a gain of approximately 14 dB,

50 ohm SMA input and output connections, and a low advertized noise figure of 0.8 dB.

One LNA was placed after the attenuator but prior to the splitter in the transmit path and the other was placed after the receive antenna but prior to the mixer in the receive path.

The effects of these amplifiers were modeled in two ways by the simulation. For the transmit path, the noise effects of the LNA were modeled by applying additive white

Gaussian noise (AWGN) with power to the simulation signal. The noise power was determined from the noise figure, bandwidth, and gain, of the amplifier.[15,17] It was calculated by

(5)

where is the noise figure, J/deg is Boltzmann's constant,

K is standard noise temperature, MHz is the bandwidth of the amplifier, and is the gain of the amplifier. The noise power of the signal was then calculated to be -73.2 dBm ( watts) using (5). Both the

19 output signal noise power and amplifier gain of 14 dB were taken into account. The transmit signal output from the LNA after amplification was then 16.7 dBm before it was passed to the splitter.

On the receive path, the LNA was modeled using a receiver pre-amplifier software object from the Phase Array Toolbox. The pre-amplifier software object amplified the signal by a specified gain and added noise to the simulation receive signal based on a noise figure parameter. For the purposes of the simulation, the specified typical noise figure of 0.8 dB was used and the gain was set to 14 dB. The received signal was then passed to the mixer for direct conversion to baseband so frequency discrimination could be accomplished.

Table 4.4 lists the important design parameters that were used for simulating the LNA performance of the system. Even though the noise contribution from these components was relatively small, these parameters had a direct impact on the signal-to-noise (SNR) ratio which is an important factor in the design of a the radar system.[4]

Table 4.4: Low Noise Amplifier Simulation Parameters Parameter Value Units Gain 14 dB Noise Figure (typical) 0.8 dB

4.5 Splitter Design

The splitter was modeled after the Mini-Circuits ZX10-2-42+ power splitter. In the real design, the input signal was connected from the LNA to the input port of the splitter via a

50 ohm SMA connection. The input signal was then split by the device such that a lower power copy of the signal was sent to output ports one and two. Each copy was attenuated by 3.2 dB which is the relevant design parameter for this component. The result was a

20 copy of the FM-CW signal at 13.5 dBm being passed to both the transmit antenna on output port one and the mixer on output port two.

To simulate the splitter, a copy of the transmit signal was scaled by -3.2 dB prior to being supplied as input to the software objects used to simulate the transmit antenna and the mixer.

4.6 Antenna Design

The design used for the transmit and receive antenna was novel. It called for the use of an empty coffee can which may be used as cylindrical . As it would turn out, when attempting to couple with a 2.4 GHz (12 cm wavelength) signal, a coffee can is a practical, economical, and modest directional radiator or collector. Figure 4.6.1 shows the specifications for a real world implementation of the "".

Figure 4.6.1: The "cantenna" design used in the MIT coffee can radar (Charvat, 2017 [4])

For the purposes of the simulation, the MATLAB Antenna Toolbox was very useful. The goal was to model the antenna gain pattern of the coffee can antenna. The horizontal and vertical gain patterns were recorded by MIT Lincoln Laboratory and presented by Dr.

21

Alan J. Fenn from Charvat et al. (2011, [3]). Figure 4.6.2 shows the horizontal and vertical gain pattern measurements of the coffee can antenna.

Figure 4.6.2: The "cantenna" gain pattern measurements (Charvat et al. 2011, [3])

For the simulation, the antenna gain pattern measurements in Figure 4.6.2 were used to create a MATLAB antenna gain pattern software object. The object was used to model both the transmit (radiator) and receive (collector) antennas in the simulation and provide an antenna gain that was correct relative to the direction of the outgoing or incoming FM-

CW signal. Figure 4.6.3 displays the polar plots and 3D gain pattern approximation that were created for the simulation.

It can be seen from the plots that the coffee can antenna is directive and offered a gain of approximately 7.3 dBi in the forward direction with a half power (3 dB) beam width of approximately 70 degrees. The voltage standing wave ratio (VSWR) of the antenna was approximately 1.39:1, with a reflection coefficient (return loss) of -15.7 dB across the 2.4 to 2.5 GHz band.[3] Table 4.6 presents the design parameters of the antenna used for the simulation. Construction and use of the 3D gain pattern was especially helpful when simulating ground clutter return.

22

Figure 4.6.3: Antenna gain pattern polar plots and 3D approximation created with the MATLAB Antenna Toolbox and used for the simulation

Table 4.6: Antenna Simulation Parameters Parameter Value Units Half Power (3 dB) Beam Width 70 deg Gain 7.3 dBi Reflection Coefficient -15.7 dB

To simulate accurate radiation and collection of the FM-CW signal, a number of

MATLAB Phased Array Toolbox software objects were used in conjunction with the parameters and gain pattern outlined in Figure 4.6.3 and Table 4.6. They are enumerated in more detail in Section 5.

23

4.7 Mixer Design

The mixer was modeled after a Mini-Circuits ZX05-43MH+ wide band mixer. It had a loss of approximately 6 dB when provided with a 13 dBm signal to the local oscillator

(LO) port. For this design, the mixer LO port received the 13.5 dBm transmit signal from the splitter. The mixer RF port received the incoming signal from the LNA connected to the receive antenna. The mixer essentially multiplies the phase coherent transmit signal from the splitter with the amplified and delayed signal coming in from the receive antenna. The output signal from the mixer was attenuated by 6 dB due to the mixing process.

The mixer provided the vital function of heterodyning the FM-CW signal currently being transmitted with the delayed receive signal so that the frequency difference between them could be determined. The mixing operation was simulated by multiplying a copy of the signal to be transmitted by the received signal and scaling the result by -6 dB.

4.8 Video Amplifier and Filter Design

The video amplification stage was necessary to condition the signal output from the mixer and prepare it for analog to digital conversion (ADC). In the case of the real world design, this stage used a MAX414 quad op-amp IC to both amplify and low-pass-filter the signal so it could be applied to the right channel of a 3.5 mm audio connector and recorded by an audio card in a PC. Recall that the sync square wave from the modulator would be applied to the left channel of the audio connector so that a reference for the receive window could be obtained. In this way, the radar signal could be recorded, stored, and processed using digital signal processing techniques.

24

The video amplifier stage was simulated in this project by lowering the sample rate of the output signal from the mixer from 3 GS/s to 1 MS/s using a process called decimation.[8]

The signal was then further low-pass-filtered so that only frequencies within the audio band remained present. The signal would then be representative of an output signal produced by the real world design. The signal was then processed using a discrete

Fourier transform (DFT) in order to plot the frequency and magnitude of the signal and demonstrate target range and velocity measurements. The results of the DFT procedure are detailed in Section 6.

4.9 Theoretical Performance

Now that the simulation design parameters have been obtained from real world components, the theoretical performance of the radar system will be presented and discussed. Theoretical performance was based on the signal-to-noise (SNR) ratio as calculated by a form of the venerable radar equation.[7,15] This is only an approximation since some simplifying assumptions were made about the system. However, it is a good starting point and can be compared to the simulation results to help ensure they are plausible.

The form of the radar equation used is adapted from the Friis transmission equation.[4] It is given by

(6)

where is the power in watts received by the radar from the backscatter of a target. The equation has been broken into three main parts for clarity. The first part is a calculation

25 of the power density of a plane wave incident on a target at range from the transmit

[7] antenna with gain and transmit power .

(7)

When the second part of the equation is multiplied in, one obtains the power density back at the receive antenna from the isotropic backscatter of the target if the target has an RCS

, at range from the receive antenna.

(8)

To obtain the actual power in watts received by the radar system, the effective aperture

must be considered and multiplied into the equation. The effective aperture is the collecting area of the receive antenna and is dependent on the receive antenna gain and wavelength of the received signal. [7,15] The effective aperture is defined by

(9)

and when multiplied by (8) yields (6) which is the amount of power received by the radar system from a target with RCS at range from the transmit antenna with gain and range from the receive antenna with gain given a transmit power , and signal wavelength .

For simplification, it was assumed the target was at a sufficient distance from the transmit and receive antennas such that they could be considered collocated then and

. Then (6) simplifies to

26

(10)

which yields a very recognizable form of the radar equation.[7,9,15] It is noted that the simplification was made for this calculation even though the transmit and receive antennas for the project were separated 0.5 m from each other (technically a bistatic radar). This antenna separation was indeed taken into account however when simulating transmitted and received signal behavior.

The pertinent parameters, derived from the previous sections are listed in Table 4.9.1 and were used to calculate the theoretical power received from a target.

Table 4.9.1: Simulation Parameters for Radar Equation Parameter Value Units

Transmit Power, 13.5 dBm Antenna Gain, 7.3 dBi Wavelength, (average) 12.25 cm Target RCS, 10 to 100 m2 Range, 0 to 100 m

Using these parameters, a plot of the received signal power vs. target range was calculated for the nominal target range of 20 to 100 meters shown in Figure 4.9.1.

27

Figure 4.9.1: Received power vs. target range using radar equation (10) and simulation parameters from Table 4.9.1

It was noted for the project that approximately -83 dBm was the received power expected from a 20 dBsm (100 m2) target.

In order to ensure that a maximum target range of 100 m would be feasible for a 20 dBsm target, the maximum range was calculated given a desired SNR of 13.6 dB. The SNR value of 13.6 dB was chosen based on the Albersheim equation for SNR required given a desired probability of detection and probability of false alarm.[15] For the project, a probability of detection equal to 0.95 was chosen along with a probability of false alarm equal to . Based on the criteria above, the maximum theoretical range of a target based on received signal power and system thermal noise power was calculated using an extended version of the radar equation.[4] It is given by

(11)

28

Table 4.9.2 describes the equation parameters and lists the value used as derived from the system components described in previous sections.

Table 4.9.2: Simulation Parameters for Maximum Range Calculation Parameter Value Units

Transmit Power, 13.5 dBm

Transmit Antenna Gain, 7.3 dBi 2 Effective Aperture of Receive Antenna, 0.0064 m

Receive Antenna Efficiency, 0 dB Target Radar Cross Section, 100 m2 Attenuation due to Atmosphere, 0 Nepers/m Boltzmann's Constant, 1.39e-23 J/deg

Standard Receiver Temperature, 290 K

Receiver Noise Figure, 1.2 dB Receiver Noise Bandwidth, 2/0.0033 Hz

Duty Cycle, (0 to 1) 1 - Signal-to-Noise Ratio, 13.6 dB

Miscellaneous System Loses, 6 dB

The effective aperture of the receive antenna was given by (9) and the receive antenna efficiency was considered to have been factored into it so it was 1 (linear ratio) or 0 dB.

The receiver noise figure took both the LNA and the mixer noise figure into account using the cascaded noise figure.[4] The equation for the cascaded noise figure is

(12)

for sequential electronic devices having noise figure and gain . The noise Figure for a mixer is considered to be its insertion loss.[4] The noise figure and gain of the LNA which appeared first in the receive sequence was and gain dB. The

29 noise figure of the mixer was the loss so dB and the overall receiver noise figure was calculated with (12) and equal to 1.2 dB.

The receiver noise bandwidth was based on the duration of the receive window which was 3.33 ms. The inverse of the receive window duration was taken and multiplied by two to calculate the receiver noise bandwidth because the system used a direct conversion

(heterodyne to zero Hz IF or homodyne) receiver process.[4] The attenuation due to atmosphere was considered to be negligible due to the relatively short distance from the radar system to the target.

After all parameters were taken into consideration, the maximum range was calculated to be 1150 meters for a target with RCS equal to 20 dBsm (100 m2). This is a strong indication that the radar system performance would not be limited by thermal noise.

However in looking at the antenna gain pattern, it appeared that the antenna coupling

(that is, the power entering the receive antenna directly from the transmit antenna) would likely dominate all other noise sources and clutter interference.

30

Section 5: Implementation

The components of the FM-CW radar and their signal outputs were implemented using a combination of pure MATLAB code and software helper libraries including the Antenna,

Communications, DSP, and Phased Array Toolbox add-ons. As stated, the overall sample rate of the simulation was set at 6 GS/s since this fulfills Nyquist criteria for 2.4 to 2.5 GHz signals which were generated by the VCO and transmitted.[8] The implementation of the simulation followed the principle of generating and using software objects with parameter values representing their real-world counterparts. The simulated

FM-CW radar signal was generated, passed to, and altered by the software objects at each stage of the simulation. The techniques and software objects used to simulate the radar functionality will be enumerated for each of the design components. Additionally, the techniques and software objects used to simulate the EM wave propagation to and from the target and clutter sources will be elaborated. All MATLAB code for the simulation is presented in Appendix A.

5.1 Modulator Implementation

Simulation of the modulator was conducted using MATLAB code. The voltage thresholds defined in section 4.1 were used to generate a sequence of samples representing both the triangle wave used to drive the VCO and the square wave representing the receive window. A series of index values were then generated from each receive window so that the video signal could be easily processed based on a specific receive window interval.

At its heart, the triangle wave was generated using the triangle function given by

31

(13)

which was then offset and scaled according to the necessary voltage parameters to yield a slope of 406 V/s over 3.3 ms. and -406 V/s over the next 3.3 ms resulting in a voltage sweep of 1.34 V.

There were 40,008,000 samples used to represent one symmetric triangle wave period with a duration of 6.7 ms. Figure 5.1 shows one period of the triangle wave that was generated for the modulator.

Figure 5.1: One period of the triangle wave generated by the modulator

A receive window covered each half of the triangle so that samples could be processed from both the incrementing and decrementing sides (corresponding to those incrementing and decrementing frequencies produced by the VCO). The software parameters used for the modulator were passed to the software objects responsible for generating the VCO signal. Refer to the Modulator.m script in Appendix A for the complete source code used to simulate the modulator functionality.

32

5.2 VCO Implementation

Implementation of the VCO was accomplished using the phased.FMCWWaveform and comm.PhaseNoise software objects. phased.FMCWWaveform: This was the MATLAB Phased Array Toolbox object which created a baseband ramp FM waveform according to the parameters listed in Table 5.2.1.

The power of this signal was attenuated from the default 30 dBm (1 watt) to approximately 6 dBm to be representative of the true design. The VCO signal was created at baseband initially, however the signal was simulated at the carrier of 2.4 GHz during the transmission, reception, and signal propagation phases of the simulation.

Parameter values generated from the Modulator simulation were used as inputs to the phased.FMCWWaveform object.

Table 5.2.1: phased.FMCWWaveform Parameters Parameter Description Value Units

SweepBandwidth FM sweep bandwidth. 100,044,400 Hz

SampleRate Simulation sample rate. 6 GS/s

SweepDirection FM Sweep Direction. 'Triangle' -

NumSamples Number of samples in output. 40,008,000 samples

SweepTime Duration equal to half the triangle period. 3.33 ms

SweepInterval Specifies a strictly positive signal. 'Positive' -

Specify output format to be samples or OutputFormat 'Samples' - sweeps.

comm.PhaseNoise: This was the MATLAB Communications Toolbox object used to add phase noise to the VCO FM signal created by the phased.FMCWWaveform. The

33 parameters listed in Table 5.2.2 were used to add phase noise commensurate with the

Mini-Circuits ZX95-2536C+ VCO specification. The Level parameter is the phase noise level expressed in dBc/Hz. This was the ratio of noise power to carrier signal power expressed in decibels at a particular offset (in Hz) from that carrier. In the case of the

VCO, the carrier signal was the desired output signal of the VCO at a specified frequency.

Table 5.2.2: comm.PhaseNoise Parameters Parameter Description Value Units

Level The phase noise level. -76 dBc/Hz

FrequencyOffset Frequency offset corresponding to the level. 1,000 Hz

SampleRate Simulation sample rate. 6 GS/s

The PSD of the simulated baseband VCO signal is shown in Figure 5.2.1. It can be seen that this signal has a bandwidth of 100 MHz and a power of 5.7 dBm which is a good representation of the real world signal.

Figure 5.2.1: PSD of the simulated baseband VCO signal

34

The theoretical basis for the FM ramp signal produced by the VCO comes from the equation

(14)

where is the start frequency (0 for baseband or 2.4 GHz with carrier), MHz is the bandwidth, and ms is the duration of the ramp (one side of the triangle wave).[10]

The VCO signal was passed to the attenuator function for the next phase in the simulation. Please see the VCO2.m file in Appendix A for the complete source code used to model the VCO functionality.

5.3 Attenuator Implementation

The attenuator was modeled by MATLAB code that scales the VCO signal such that the signal power was reduced by 3 dB (half) in accordance with the Mini-Circuits VAT-3+ attenuator specifications. To accomplish this, the signal samples were each multiplied by

0.7071 which corresponds to a -3 dB reduction in signal magnitude and is recognized as

, the root mean square (RMS) value of a sinusoid.[8] Since the transmit signal is a sinusoid with varying frequency, its average signal power can be determined by

(15)

where is the peak amplitude.[8] This implies that scaling the amplitude of the signal can modify the average signal power without changing the frequency or phase of the sinusoidal signal.

35

In general, the average signal power was calculated for simulation signals according to

(16)

where is the number of samples in the signal under consideration.[8] This method was used to ensure the average signal power of simulated signals was accurately represented.

After scaling the signal by 0.7071, the signal was then passed to the LNA processing stage of the simulation. Please see the Simulation2.m file in Appendix A for the complete source code used to model the attenuator functionality.

5.4 Low Noise Amplifier Implementation

The low noise amplifier in the transmit path was simulated by MATLAB code which first applied AWGN to the signal based on the thermal noise output power of the LNA.[15]

The thermal noise output power was calculated to be watts from the LNA noise figure, bandwidth, and gain from (5) in Section 4.3. These parameters were all taken from the specification of the Mini-Circuits ZX60-272LN+ LNA.

In order to model the thermal noise in the simulation, an AWGN signal was generated with a mean of zero and a variance equal to . In this context, variance was interpreted as the power of the fluctuating portion of the AWGN signal and equal to its average signal power when its mean was zero.[8] The AWGN signal was then added to the transmit signal after the signal had been multiplied by to account for the 14 dB gain of the amplifier. This produced a 13.5 dBm signal including phase and thermal noise which was then sent to the transmitter software objects for radiation

36 modeling. Please see the Simulation2.m file in Appendix A for the complete source code used to model the LNA functionality for the transmit signal.

For the receive path, the LNA was modeled using the phased.ReceiverPreamp software object. phased.ReceiverPreamp: This was the MATLAB Phased Array Toolbox object used to model the amplification functionality of the LNA in the receive path. It was also used to introduce thermal noise based on the cascaded noise figure of the LNA and mixer calculated by (12) in Section 4.9. This object received the simulated signal from the phased.Collector software object which simulated the receive antenna functionality and will be discussed in the subsequent section. The simulation parameters used to create the phased.ReceiverPreamp object are listed in Table 5.4.

Table 5.4: phased.ReceiverPreamp Parameters Parameter Description Value Units

Gain LNA gain. 14 dB

The cascaded noise figure of the LNA NoiseFigure 1.2 dB and mixer in the receive signal path.

ReferenceTemperature Reference temp of the LNA and mixer. 290 K

SampleRate The simulation sample rate. 6 GS/s

It is important to note that the phased.ReceiverPreamp modeled the noise introduced by both the LNA and mixer in the receive path. This simplified the code required to simulate the mixer operation. Please see the Receiver.m file in Appendix A for the complete source code used to model the LNA function for the receive signal.

37

5.5 Splitter Implementation

The splitter was implemented by making a copy of the LNA output signal on the transmit path and reducing the power of it by 3.2 dB. This value is the total loss as specified for the Mini-Circuits ZX10-2-42+ power splitter. This was done by multiplying the LNA output signal by . The resulting signal had a power of 13.5 dBm. A copy of the signal was then stored and supplied as input to the antenna and mixer simulation software objects. Please see the Simulation2.m file in Appendix A for the complete source code used to model the splitter functionality.

5.6 Antenna Implementation

The implementation for both the transmit and receive antennas relied heavily on the antenna gain pattern that was first presented in Section 4.6. The gain pattern was approximated from real world values presented in Figure 4.6.2 and created using the

MATLAB phased.CustomAntennaElement software object from the Phased Array

Toolbox. To simulate radiation of the transmit signal, a copy of the 13.5 dBm signal output from the splitter was passed to the phased.Transmitter object which simulated transmitter power leveling. The signal output of the phased.Transmitter object was then passed to the phased.Radiator object. The phased.Radiator object could then be used in conjunction with the phased.CustomAntennaElement to simulate signal radiation in a particular direction so that the gain pattern of the antenna was taken under consideration.

For the simulation, an azimuth and elevation angle were supplied to the phased.Radiator object to simulate the amount of gain the radiated simulation signal would have in a particular direction. The simulated signal radiation could then be calculated accurately

38 for multiple objects under illumination (spread across the test location) by the radar system. This became very important when simulating the clutter environment.

The phased.Radiator object also prepared the simulated signal to interact with phased.FreeSpace objects and phased.RadarTarget objects. These objects took into consideration the propagation of the radiated signal through free space towards the target, the target RCS and fluctuation model, whether the target was moving or not, and the propagation of the reflected signal back through free space to the receive antenna. These objects are covered in more detail in Section 5.9.

In order to simulate reception of the radar returns, a phased.Collector object was needed.

This object can be thought of as the receive antenna. It also required the use of an antenna gain pattern object, and prepared received simulation signals for transfer to the phased.ReceiverPreamp object which simulated the LNA in the radar receiver chain. phased.CustomAntennaElement: This was the MATLAB Phased Array Toolbox object used to model the antenna gain pattern for the simulation. This object was passed vectors of gain values representing the horizontal and vertical gain patterns of the antenna as made and supplied by the MIT Lincoln Laboratory.[3] A list of all parameters supplied to the object are presented in Table 5.6.1.

39

Table 5.6.1: phased.CustomAntennaElement Parameters Parameter Description Value Units

The minimum and maximum frequencies FrequencyVector the antenna was to model for the [2.4 , 2.5] GHz simulation.

The vector of azimuth angles AzimuthAngles (See Appendix A) - corresponding to azimuth gain values.

The vector of elevation angles ElevationAngles (See Appendix A) - corresponding to elevation gain values.

Gain magnitude vector for radiation MagnitudePattern (See Appendix A) - pattern.

Phase of the combined antenna radiation PhasePattern (See Appendix A) - pattern. (zero for this implementation)

The resulting antenna pattern closely approximates that of the coffee can antenna used for the real world implementation of the project. The 3D antenna gain pattern is presented in

Figure 5.6.1.

Figure 5.6.1: The modeled antenna gain pattern using the phased.CustomAntennaElement object

40

It can be seen that the maximum gain of 7.3 dBi (gain relative to an ) is in the yellow region which was the direction forward of the antenna at zero degrees azimuth and elevation. This is shown on the left side in Figure 5.6.1. phased.Transmitter: This object was used to prepare the transmit signal for use with other MATLAB Phased Array Toolbox objects which simulated radiation of the signal and propagation of the signal through the environment. In the case of the simulation, a zero dB gain was applied to the signal since it was already at the correct power level

(13.5 dBm) prior to entering the antenna. Table 5.6.2 shows the parameters used to create the phased.Transmitter object used in the simulation.

Table 5.6.2: phased.Transmitter Parameters Parameter Description Value Units

This is the peak power of the signal entering PeakPower 0.0224 Watts the transmitter.

Gain The transmit gain. 13.5 dB

With the parameters given in Table 5.6.2 the phased.Transmitter object was created. For the simulation, it was passed a Hilbert transformed version of the output signal from the splitter. (A Hilbert transform was necessary to generate the in-phase and quadrature (IQ) components of the signal before they were passed as input to the phased.Transmitter object.) The phased.Transmitter object then appropriately power leveled the IQ signal and prepared it for the phased.Radiator object. phased.Radiator: This Phased Array Toolbox object was used to model the effect of the antenna gain pattern on the transmit signal. It was created using the phased.CustomAntennaElement object described earlier. Once created, it received the

41 output signal from the phased.Transmitter object and produced a signal with a power level according to the antenna gain pattern and direction specified in azimuth and elevation angles. For the simulation, the target of interest was considered to be directly in front of the radar (azimuth and elevation equal to zero). Other clutter sources were located at various azimuth and elevation angles within the illuminated area. Table 5.6.3 lists the simulation parameters used to create the phased.Radiator software object.

Table 5.6.3: phased.Radiator Parameters Parameter Description Value Units

The phased.CustomAntennaElement Sensor used to define the antenna gain (See Appendix A) - pattern.

PropagationSpeed The signal propagation speed. 3e8 m/s

The operating frequency of the OperatingFrequency 2.4 GHz radiator.

The type of measurements used to construct the SensorGainMeasure 'dBi' - phased.CustomAntennaElement object used for the Sensor parameter. phased.Collector: This Phased Array Toolbox object was used to simulate the receive antenna. It was created in a similar fashion to the phased.Radiator object with the exception of an additional parameter that indicated if the EM waves incident on the receive antenna should be considered planar. For this simulation and the receive antenna, incident EM waves were considered planar and distances were such that the far field criterion was met. It also used the phased.CustomAntennaElement object and ensured the gain pattern of the antenna was taken into consideration for reception. Table 5.6.4 lists all simulation parameters used to create the phased.Collector object.

42

Table 5.6.4: phased.Collector Parameters Parameter Description Value Units

The phased.CustomAntennaElement Sensor used to define the antenna gain (See Appendix A) - pattern.

PropagationSpeed The signal propagation speed. 3e8 m/s

The operating frequency of the OperatingFrequency 2.4 GHz collector.

The type of measurements used to construct the SensorGainMeasure 'dBi' - phased.CustomAntennaElement object used for the Sensor parameter.

Wavefront The type of incoming wave front. 'Plane' -

Please refer to the Antenna2.m, Simulation2.m, and Transmitter_Radiator2.m files in

Appendix A for the complete source code used to model the antenna functionality for the simulation.

5.7 Mixer Implementation

The mixer was implemented by multiplying the signal from the LNA on the receive path

(modeled by a phase.ReceiverPreamp object) with a copy of the signal output from the splitter operation. The signal resulting from the multiplication was then reduced by 6 dB in power. which was the approximate conversion loss specified for the Mini-Circuits

ZX05-43MH+ wide band mixer. This was done by scaling the result of the multiplication by a factor of . The signal was then sent to the video amplifier portion of the simulation for processing. Please refer to the Simulation2.m file in Appendix A for the code used to model the mixer functionality.

43

5.8 Video Amplifier and Filter Implementation

The video amplification and filtering portion of the simulation was primarily aimed at filtering the output signal from the mixer and preparing it for DFT processing. This was done using a series of infinite impulse response (IIR) low-pass filters and down sampling stages. This process is called decimation and was very helpful in isolating the relatively small frequency difference between the signal being transmitted and the target return according to (3). While a 4th order low pass filter is used in the real world design, the simulated signal had to be decimated in multiple stages because the sample rate of the simulated signal was high (6 GS/s) compared to the frequency of the returned tones in the final output (which fell within the audio band).

The simulated output signal from the mixer was taken and passed through a series of five low pass filters (LPFs). The signal was down sampled after being passed through the first four LPFs to accomplish the decimation process. The result was that the signal was effectively down sampled from 6 GS/s to 1 MS/s with the highest frequency in the pass band being 49 kHz. The LPFs were designed using the MATLAB filter designer tool.

All filters were designed using the IIR elliptic method and had a Direct Form II structure.

Each filter had an order of 14, a stop band attenuation of -80 dB, and a pass band ripple of 1 dB. Table 5.8.1 lists the specifications for the filters in the order they were used. The column on the extreme right lists the down-sample factor if a down-sampling method was applied after that filtering stage.

44

Table 5.8.1: Low Pass Filter Specifications Sample Pass Band Stop Band Post Filter Down Stage Rate (Hz) (Hz) Sample Factor (S/s)

First 6e9 0.49e9 0.5e9 6 Second 1e9 49e6 50e6 10 Third 100e6 4.9e6 5e6 10 Fourth 10e6 0.49e6 0.5e6 10 Fifth 1e6 49e3 50e3 None

Figure 5.8 displays the magnitude response of the last filter in the sequence. This filter could be easily changed to that of a strict audio filter but frequencies up to 49 kHz were permitted to pass so that testing could be accomplished. Frequencies produced by targets were strictly in the audio band however and targets at 20 meters corresponded to a tone of

4 kHz while targets at 100 meters (the maximum range) corresponded to a tone of 20 kHz. This was based on the design outlined in Section 4.1 and 4.2.

Figure 5.8: Magnitude response of the 5th (and last) LPF in the sequence

45

The low pass filtering and down sampling were the primary functions performed in the video amplification and filtering phase of the simulation. The final output of these functions was a signal sampled at 1 MS/s. This signal contained tones of interest within the audio band. Please refer to the low_pass_filter_bank.m and Simulation2.m files for the source code used to perform these operations.

5.9 Environment Modeling

There were two primary factors under consideration when the test environment was modeled; namely the target and the clutter. The target and clutter returns could be simulated using the MATLAB phased.FreeSpace and phased.RadarTarget software objects. The return from the target would compete with unwanted interference caused by the coupling of the transmit and receive antennas and by strong returns from the ground and other objects in the environment illuminated by the radar. The thermal noise, while simulated, was not expected to compete with the target return due to the results of Section

4.9.

It was desired that the target have an RCS of 20 dBsm (100 m2) approximating the return of a car.[15] The target was required to be both stationary and moving in order to demonstrate velocity and range radar measurements and would be simulated at a range of approximately 40 to 100 meters in front of the radar system.

It was anticipated that the radar system would have to contend with a clutter return since it would be very close to the ground. Thus, clutter sources in the test environment would need to be considered as well. The first part of modeling the environment involved finding a test location that could be practically approximated for the test scenario requirements outlined above.

46

A suitable location was found that would be relatively isolated from other 2.4 GHz

(Wi-Fi) signal sources and could support the test scenario envisioned. The environment could be characterized by relatively flat dry desert landscape with scattered dry bushes and dry ground cover. Figure 5.9.1 shows a satellite image of the test location with a signal strength footprint based on the position and orientation of the radar transmit antenna (pointed due east), the transmit power of the radar system at 13.5 dBm, and the antenna gain pattern. The image was created using the MATLAB Antenna Toolbox txsite function and the phased.CustomAntennaElement gain pattern object generated for the project.

Figure 5.9.1: Satellite image of the simulated radar test location and radar signal strength pattern

The edges of the gain pattern correspond to a receive power of approximately -60 dBm for a receive antenna with 0 dB gain. This is validated by Friis equation

47

(17)

where dBm, dBi, dBi, m and results in a -60 dBm receive power at approximately 108 meters in front of the radar. To verify this result, an additional plot was made using the same location and a distance measurement as shown in Figure 5.9.2.

Figure 5.9.2: Test location to be simulated, showing 100 m distance from radar location, and discrete scatterers, identified with circles, to be modeled within the 3 dB beam width of the antennas

Figure 5.9.2 shows the 100 meter distance line from the position of the transmit and receive antenna on the left (east) side and spanning the across to the right (west) side.

Additionally, discrete scatterers (bushes) in the environment that fell within the 70 degree

3 dB beam width of the antennas were identified for discrete clutter modeling. This test location would support a car sized target moving down the road in front of the radar system at a distance of approximately 40 to 100 meters as desired.

48

The target, ground echo, and discrete scatterers within the 3 dB beam width were simulated using the phased.FreeSpace and phased.RadarTarget software objects. These objects worked in conjunction with the phased.Radiator and phased.Collector objects which were discussed in Section 5.6. phased.FreeSpace: This Phased Array Toolbox object was used to simulate the propagation from the radiator outward in the direction specified by azimuth and elevation angles. Since the radiated EM wave will propagate outward from the transmit antenna through the air, freespace parameters were used. The parameters used to create the phased.FreeSpace object are given in Table 5.9.1.

Table 5.9.1: phased.FreeSpace Parameters Parameter Description Value Units

PropagationSpeed The speed of propagation for the medium. 3e8 m/s

The carrier and operating frequency of the OperatingFrequency 2.4 GHz radiator.

Whether the object should be used to model TwoWayPropagation 'False' - two way propagation.

SampleRate The sample rate of the simulation. 6 GS/s

After the phased.FreeSpace object was created, it was supplied with the signal produced from the phased.Radiator object, the position of the radar, position of the target, velocity of the radar (0 for simulation purposes), and velocity of the target. The resulting output was a simulated signal that accounted for free space path loss according to (10), the

Doppler frequency shift due to target velocity given by (1), and the power density incident on the target given by (7).

49

The signal had now been simulated up to the target, but the target characteristics had yet to be taken into account. This was remedied with the phased.RadarTarget software object. phased.RadarTarget: This Phased Array Toolbox object was used to model the RCS characteristics of radar targets in the simulation environment. It was created with the parameters listed in Table 5.9.2 for each object in the simulated environment that produced a radar return.

Table 5.9.2: phased.RadarTarget Parameters Parameter Description Value Units

The Swerling model to be used for 'Swerling1' or Model - RCS fluctuation. 'Nonfluctuating'

MeanRCS The mean RCS of the target. (Target Specific) m2

The speed of propagation for the PropagationSpeed 3e8 m/s medium.

The carrier and operating frequency of OperatingFrequency 2.4 GHz the radiator.

The phased.RadarTarget object was used to model the RCS of the primary (car) target for the simulation and also used to model the return from ground echo and discrete scatterers

(large bushes) in the environment. It received as input, the signal resulting from the phased.FreeSpace object.

A value of 20 dBsm was used to model the RCS of the car.[15] To simulate the RCS fluctuation from the car, Swerling Case 1 was used because it placed more demand on the radar.[15] Echo fluctuations modeled by Swerling case 1 are constant amplitude throughout the scan but are independent from scan to scan. (This is sometimes called a

Rayleigh scatterer even though the probability density function (PDF) for Case 1 is

50 exponential.[15]) This model was used to obtain a conservative estimate of the SNR for the target echo in the radar simulation. An RCS of -10 dBsm was used to model discrete clutter scatterers in the environment (large bushes), this value was likely larger than in reality but was commensurate with the RCS of dry deciduous trees.[1]

The phased.RadarTarget object produced an output signal representing the backscatter from the target with a power density in accordance with the target RCS by (8). This backscatter signal would be incident on the receive antenna and would be provided again to the phased.FreeSpace object with the location of the target, location of the receive antenna, velocity of the target, and velocity of the receive antenna (0 for simulation purposes). This accounted then for the free space path loss of the backscattered signal as it traveled back to the receive antenna. The signal was then provided to the phased.Collector object to account for the receive antenna gain before being passed to the phased.ReceiverPreamp object as discussed in Section 5.4.

For the ground clutter, a footprint of the ground illuminated by the 3 dB beam width of the antenna out to approximately 100 meters was modeled. This was done by obtaining global positioning system (GPS) coordinates of the test location. The ground elevation for each GPS coordinate was obtained using the Google Elevation application programming interface (API).[18] The ground footprint was then divided into a mesh of connected triangles so that the ground surface could be approximated. Figure 5.9.3 shows the triangle mesh that was created for the ground clutter simulation superimposed on a satellite image of the test location. Each triangle vertex was obtained from real world latitude, longitude, and elevation data. The transmit antenna was modeled at the location of the red pin and pointed approximately due east.

51

Figure 5.9.3: Ground clutter triangle mesh, discrete clutter scatterer locations (green boxes), and target location (red box) superimposed on satellite image of simulated test location

The GPS coordinates were transformed into a 3D coordinate system and the distance, area, surface normal, and grazing angle for both the transmit and receive antenna were calculated for each triangle in the mesh. Figure 5.9.4 shows a MATLAB plot of the clutter mesh, environmental objects (green boxes), target object (red box) that were modeled using the phased.FreeSpace and phased.RadarTarget objects. Figure 5.9.5 shows an exaggerated elevation profile of the ground surface indicating areas that were shadowed and were not illuminated by radar beam. (these are the transparent areas in

Figure 5.9.3 and the black areas in Figure 5.9.4).

52

Figure 5.9.4: Modeled ground clutter mesh, discrete clutter scatterer locations (green boxes), and target location (red box), the transmit antenna was at the origin

Figure 5.9.5: Exaggerated elevation plot of triangle mesh showing shadowed regions (looking due east)

53

A bistatic form of the constant gamma clutter model was used.[1,7] It is given by

(18)

where is the per unit RCS, is the reflectivity based on the nature of the terrain, is the grazing angle relative to the transmit antenna, and is the grazing angle relative to the receive antenna. The grazing angle is the compliment of the angle of incidence. The angle of incidence is the angle between the vector cast in the direction of the incident radar energy and the normal of the surface upon which that energy will impinge. The equation in (18) is for the bistatic radar case and takes into account the grazing angle of both transmit and receive antennas.[7] The reflectivity value was taken to be -21 dB for the environment which was dry desert terrain. [15]

To simulate surface clutter return, the per unit RCS and grazing angle were calculated for each triangle in the mesh and each triangle was treated as a discrete scatterer. This process involved using the phased.Radiator, phased.FreeSpace, phased.RadarTarget, and phased.Collector objects to simulate the return from each triangle. The RCS for the triangle was a product of its calculated per unit RCS and the triangle area.

Only the diffuse return from each triangle was considered. It appeared unlikely that strong specular returns would result given illumination grazing angles, the observed surface roughness of the terrain, and consideration of the Rayleigh smoothness criterion.[7] Since diffuse returns were modeled by a single RCS value, it was necessary that the dimensions of each triangle fulfill the far field criterion approximated by

(19)

54 where is the largest lateral dimension of the object under illumination, is the wavelength, and is the minimum distance that the transmit and receive antennas must be from the object.[15] To fulfill this, each triangle in the mesh was subdivided until the criterion was met. This resulted in the ground surface mesh shown in Figure 5.9.6 where each triangle gets progressively smaller as it nears the radar location. This also resulted in significant computational overhead for the radar simulation.

Figure 5.9.6: Subdivided triangle clutter mesh

The signal returns from all clutter mesh triangles and discrete clutter objects in the environment were then simulated and summed together to arrive at the final clutter return signal. The plausibility of this method was derived from the calculation of power returned from an effective illuminated area given by Long (2001, [7]).

55

The coupling of the transmit and receive antennas was simulated using the phased.Radiator, phased.FreeSpace, and phased.Collector objects in that order. The distance between transmit and receive antennas was simulated with the phased.FreeSpace object and was 0.5 meters. The antennas were each pointed due east in the simulation, the gain of the transmit and receive antenna patterns were taken into account using the phased.Radiator and phased.Collector objects. The antenna gain at negative 90 degrees off boresight (to the right) is approximately -7.3 dBi, the gain at positive 90 degrees off boresight (to the left) is approximately -7.9 dBi.

The simulated return from the target, antenna coupling, and clutter were summed together before being passed to the phased.ReceiverPreamp object which represented the LNA in the radar receive path. Please see Clutter.m, CalculateClutterReturn.m, Environment2.m, and Simulation2.m MATLAB files in Appendix A for complete implementation and source code used to model the simulation environment.

56

Section 6: Testing and Results

The goal of the project was to simulate an FM-CW radar system operating at 2.4 to 2.5

GHz in order to demonstrate how target velocity and range measurements were obtained.

To this end, there were 6.7 ms of radar data generated by the simulation using MATLAB software objects. While this is a modest amount of data, it was plenty to demonstrate basic FM-CW radar concepts and fulfill the objective of the project.

The first step taken to verify simulation results was to check the average signal power of the simulated signals resulting from the target return, antenna coupling, and clutter.

While other noise sources such as receiver thermal noise were modeled, they tended to be dominated by interference signals from antenna coupling and clutter. For this reason, other noise sources such as flicker noise were not simulated. The high strength of interference was due to the relatively close proximity of the radar to the ground (the transmit and receive antennas were modeled as being 1 meter above ground level) and the distance from the radar to other discrete scatterers within the environment (within 100 meters). Table 6.1 displays the theoretically calculated signal power and the measured signal power from simulation results.

Table 6.1: Theoretical vs. Measured Signal Power Theoretical Measured Power in Received Signal Return Type Received Signal Simulation Signal (dBm) Power (dBm)

Non-Fluctuating -83 -82.6 Target at 100 m Antenna Coupling -37.7 -35.6 Clutter not calculated -57.4

57

The returns from the three main backscatter sources presented in Table 6.1 were present in the final output signal which was amplified and then filtered according to the video amplification and filtering stage discussed in Section 5.8. The resulting signal was representative of a real world signal that would have been recorded for later processing.

The signal then had the receive window intervals applied to it for both the increasing and decreasing sides of the frequency ramp. This produced two signals, one which corresponded to the return obtained during increasing frequency modulation and the other corresponded to the return obtained during decreasing frequency modulation. A Kaiser window was then applied to these signals with a beta value of four to enhance the main lobes of the returned tones.[8] The signals were then processed with a discrete Fourier transform (the fft function in MATLAB) so that the Magnitude spectrum of each could be viewed. The magnitude spectrum of each return signal was then plotted with the frequency band from 0 to 25 kHz displayed on the x-axis and the magnitude in dB displayed on the y-axis. Recall from Section 4.1 and 5.1 that the final output would be a signal with frequencies of interest in the audio band which correspond to target velocity and range. There were several target scenarios used to demonstrate how velocity and range measurements could be obtained.

For the first scenario, depicted in Figure 6.1, the target was stationary at approximately

100 meters from the radar. The frequency of the dominant tone at 20 kHz corresponded to the return of a target at approximately 100 meters by (4) as expected. To demonstrate this, (4) was solved for target range using the results from the plot in Figure 6.1 and fixed radar design parameters presented in Table 6.2.

58

Figure 6.1: The resulting tone from a simulated stationary target at 100 m

Table 6.2: Target Range Calculation Parameters

Parameter Value Units Explanation

Observed tone from stationary target in spectrum from 20 kHz Figure 6.1. 100 MHz Bandwidth of the transmitted FM-CW signal. 3e8 m/s Speed of light in free-space. Duration of return signal processed, determined by 3.33 ms receive window period.

When solved for range, one obtained m, which is remarkably close

to the value of 100 m used for the simulation scenario. It is noted from Figure 6.1 that the frequency of the tones from each receive window are approximately the same, each can be seen overlapped upon the other. This is indicative of a stationary target. Also of note in the plot is the sloping nature of the tones produced from clutter and antenna

59 coupling which are stronger at lower frequencies. Since the lower frequency tones are produced by objects which are closer to the radar, this is expected. The coupling and clutter interference compete with the desired target return. The target is distinguished by approximately 14 dB from the strength of the interference.

For the second scenario, depicted in Figure 6.2, the target is at 60 m from the radar, still stationary. The only value that changed in this scenario is as evidenced by the plot.

Figure 6.2: The resulting tone from a simulated stationary target at 60 m

In this case, can be observed at approximately 12,080 Hz. Then using this value

and solving, m, very close to the expected value. While these first

two scenarios demonstrated how to obtain a range measurement from a stationary target,

60 the next two will focus on how range and velocity measurements can be obtained using

(1) and (4).

For the third scenario, depicted in Figure 6.3 the target was moving away with a velocity of 25 m/s (approximately 55 mph) and was 72 meters from the radar. In this case, to resolve the actual target range, the return signals from the receive windows for both increasing and decreasing frequencies were used as described in Section 2.

Figure 6.3: Resulting tones from a simulated target at 72 m, moving at 25 m/s (55 mph)

As seen in Figure 6.3, the tones are offset in frequency described by (1) due to the target velocity. Taking their average yields the frequency which in this case was

14,410 Hz. Each tone was shifted by Hz relative to this average. It can be seen that

was 430 Hz in this case. Based on these observations, Table 6.3 lists all parameters

61 used to obtain target range and velocity measurements according to (1) and (4) for this scenario.

Table 6.3: Moving Target, Velocity and Range Calculation Parameters

Parameter Value Units Explanation

Observed average tone from moving target in spectrum 14,410 Hz from Figure 6.3. Observed Doppler shift (from ) of moving 430 Hz target in spectrum from Figure 6.3. .12 m Wavelength of the transmitted signal. 100 MHz Bandwidth of the transmitted FM-CW signal. 3e8 m/s Speed of light in free-space. Duration of return signal processed, determined by 3.33 ms receive window period.

When solved for range using (4), m, which is within a meter of

the actual value of 72 m. To obtain velocity, (1) was solved where m/s

which is reasonable when the actual value was 25 m/s. In this scenario, the target is moving away from the radar system. This is evidenced by the target return tone obtained during the increasing frequency ramp (blue in the plots) which had a lower frequency than the return tone obtained during the decreasing frequency ramp (green in the plots).

Scenario four is a variation of the third and further illustrates this point.

For the fourth and final scenario examined, the target is still moving at a speed of 25 m/s but is instead moving towards the radar and is closer at a range of 43 m. This is depicted in Figure 6.4.

62

Figure 6.4: Resulting tones from a simulated target at 43 m, moving at -25 m/s (55 mph) towards the radar

It can be seen from the plot that the Doppler shift in the tones has been flipped. The target return tone obtained during the decreasing frequency ramp (green in the plots) had a lower frequency than the return obtained during the increasing frequency ramp (blue in the plots). This is opposite of the previous scenario and illustrates how, with some book keeping, a determination can be made as to whether the target is moving toward or away from the radar. In this case was 8561.5 Hz and was 404.5 Hz. When solved

for range using (4), m, which is within a meter of the actual

value of 43 m. To obtain velocity, (1) was solved for m/s which, again,

is reasonable given the actual value was 25 m/s.

63

Thus, demonstration of both range and velocity measurements by the FM-CW radar simulation has been achieved.

64

Conclusion

The results of the FM-CW radar simulation indicated the project was successful. Small errors were present in the range and velocity measurements obtained in Section 6 which are presented in Table 7.1. However, they were relatively small and the measurements still served to enforce the validity of the radar design and plausibility of simulation results.

Table 7.1: Range and Velocity Measurement Errors Radar Simulated Radar Simulated Range Velocity Measured Target Measured Scenario Target Measurement Measurement Target Velocity Target Range (m) Error (m) Error (m/s) Range (m) (m/s) Velocity (m/s) 1 100 99.9 0.1 0 not measured not measured 2 60 59.7 0.3 0 not measured not measured 3 72 71.3 0.7 25 25.8 0.8 4 43 42.4 0.6 -25 24.3 0.7

The mean range error was 0.425 meters with a standard deviation of 0.28 meters. The mean velocity error was 0.75 m/s with a standard deviation of 0.07 m/s for the two samples obtained.

In this project, a top down approach to the design of the FM-CW radar system was presented. The basic concept of the FM-CW radar was introduced first, followed by a component level design and analysis review. Radar system components were based on their real-world electronic counterparts. The significant parameters for each real-world device were taken into account when implementing the radar simulation. The simulation was carried out using MATLAB software objects. The goal of the project was to demonstrate how range and velocity measurements could be obtained from the radar system simulation. This involved modeling each radar system component and the

65 environment in which the radar was to operate. Radar functionality was then simulated and results were obtained. Theoretically calculated values tended to compare well with measured simulation results as shown in Table 6.1 and 7.1. Valid range and velocity measurements were obtained with the simulated radar system and all project objectives were met.

66

References

1. Barton, David K. “Land Clutter Models for Radar Design and Analysis.” Proceedings of the IEEE, vol. 73, no. 2, Feb. 1985, pp. 198–204. 2. Boothe, Robert R. “The Weibull distribution applied to the ground clutter backscatter coefficient.”, June 1969. 3. Charvat, Gregory, and Jonathan Williams, Alan Fenn, Steve Kogon, and Jeffrey Herd. Build a Small Radar System Capable of Sensing Range, Doppler, and Synthetic Aperture Radar Imaging. January IAP 2011. Massachusetts Institute of Technology: MIT OpenCourseWare, https://ocw.mit.edu. 4. Charvat, Gregory L. Small and Short-Range Radar Systems. CRC Press, Taylor & Francis, 2017. 5. ECFR - Code of Federal Regulations, 16 July 2018, www.ecfr.gov/cgi-bin/text- idx?SID=10194d6bcc5c4eb470c7e6f6d19e5408. 6. Kulpa, Krzysztof Stefan. Signal Processing in Noise Waveform Radar. Artech House, 2013. 7. Long, Maurice W. Radar Reflectivity of Land and Sea. Artech House, 2001. 8. Lyons, Richard. G. Understanding digital signal processing. Pearson Education International, 2011. 9. Mahafza, Bassem R. Radar Systems Analysis and Design Using MATLAB. CRC/Taylor & Francis, 2013. 10. Mahafza, Bassem R., and Atef Z. Elsherbeni. MATLAB Simulations for Radar Systems Design. CRC Press/Chapman & Hall, 2004. 11. Pettit, Ray H. ECM and ECCM Techniques for Digital Communication Systems. Lifetime Learning, 1982. 12. Sherman, S. M. Monopulse Principles and techniques. Artech House, 1985. 13. Shirman, Yakov D. Computer Simulation of Aerial Target Radar Scattering, Recognition, Detection and Tracking. Artech House, 2002. 14. Skolnik, Merrill I. Introduction to Radar Systems. McGraw-Hill, 1962. 15. Skolnik, Merrill I. Introduction to Radar Systems. McGraw-Hill, 2001. 16. Skolnik, Merrill I. Radar handbook. McGraw-Hill, 2008. 17. Stimson, George W. Introduction to Airborne Radar. SciTech Pub., 1998.

67

18. The Google Elevation API, 23 October 2018, https://developers.google.com/maps/documentation/elevation/start.

68

Appendix A: MATLAB Source Code

Source File Page Antenna2.m 69 CalculateClutterReturn.m 72 Clutter.m 77 Clutter_Elevation_Script_Helper.m 81 clutterCube.m 82 createFacet.m 83 Environment2.m 85 low_pass_filter_bank.m 86 genPatch.m 87 getPatch.m 87 gps2vert.m 88 gps_bearing.m 88 gps_dist.m 89 Modulator.m 89 processDiscrete.m 91 processFacet.m 93 processFacet2.m 96 Radar_Equation.m 97 Receiver.m 98 subdivide.m 98 Simulation2.m 99 Transmitter_Radiator2.m 104 VCO.m 105 VCO2.m 106

Antenna2.m

%% Mark Fessia %% ECE Grad Project %% Antenna Gain Pattern Modeling

%% Description: Create the antenna taking into account the published antenna pattern of % the "cantenna" elements (these values were taken from the published % e and h plane cuts)

69 clear all; fv = [2.4e9,2.5e9]; fr = [0,0]; azangles = -180:9:180; elangles = -180:9:180;

% -8.0 at -90, -8.0 at 90 h_plane = [-10.0,-10.5,-11.0,-16.0,-20.0,-40.0,-27.0,-16.0,-12.0,-8.0,- 7.1,... -6.0, -4.0, -2.0, 1.0, 3.0, 4.5, 6.0, 6.3, 7.0, 7.2,... 7.0, 6.3, 6.0, 4.3, 3.3, 0, -2.2, -4.0, -6.0, -8.0, - 12.0, -14.1,... -17.0, -23.0, -24.0, -16.0, -14.5, -12.5, -10.2, -10.0]; e_plane = [-10.0,-12.0,-30.0,-23.0,-12.0,-8.0,-8.0,-9.0,-13.0,-8.0,- 7.0,... -7.0, -6.0, -4.5, 0.0, 3.0, 4.5, 6.0, 6.8, 7.0, 7.3,... 7.0, 6.7, 6.0, 4.3, 3.3, 1.0, -2.0, -4.0, -4.5, -5.0, - 8.0, -10.1,... -6.2, -5.5, -6.0, -7.0, -8.0, -12.0, -11.0, -10.0]; el_sweep = -90:9:90; back_e_plane_idxs = [sort(find(elangles <= - 90),'descend'),sort(find(elangles >= 90 & elangles < 180),'descend')]; % axis for back half back_angles = elangles(back_e_plane_idxs); e_plane_back_vals = e_plane(back_e_plane_idxs); % going from -90 to 90 front_e_plane_idxs = find(elangles >= -90 & elangles <= 90); %axis for front half front_angles = elangles(front_e_plane_idxs); e_plane_front_vals = e_plane(front_e_plane_idxs); % going from -90 to 90 mag_pattern = zeros(length(el_sweep),length(azangles)); for az=1:length(azangles) %-180:9:180

az_mag = h_plane(az); az_ang = azangles(az);

if az_ang == -180 || az_ang == 180

mag_pattern(:,az) = e_plane_back_vals;

elseif az_ang == 0

mag_pattern(:,az) = e_plane_front_vals;

elseif az_ang <= -90 || az_ang >= 90

if az_ang < 0

70

el_ang_pos = abs(-180-az_ang); else el_ang_pos = abs(180-az_ang); end

el_ang_neg = -el_ang_pos;

pos_idx = find(el_sweep == el_ang_pos); neg_idx = find(el_sweep == el_ang_neg);

pos_sweep_idxs = find(el_sweep >= 0); neg_sweep_idxs = find(el_sweep < 0);

pos_mag = e_plane_back_vals(pos_sweep_idxs); neg_mag = e_plane_back_vals(neg_sweep_idxs);

mag_n = (az_mag.*abs(cosd(el_sweep(neg_sweep_idxs)))) + (neg_mag.*abs(sind(el_sweep(neg_sweep_idxs)))); mag_p = (az_mag.*abs(cosd(el_sweep(pos_sweep_idxs)))) + (pos_mag.*abs(sind(el_sweep(pos_sweep_idxs))));

mag_sweep = [mag_n,mag_p];

% trim some maximum values according to the vertical cut for i=1:length(el_sweep) % sweep -90 to 90 if el_sweep(i) ~= 0 mag_sweep(i) = min(mag_sweep(i),e_plane_back_vals(i)); end end

mag_pattern(:,az) = mag_sweep;

elseif az_ang > -90 && az_ang < 90

el_ang_pos = abs(az_ang); el_ang_neg = -el_ang_pos;

pos_idx = find(el_sweep == el_ang_pos); neg_idx = find(el_sweep == el_ang_neg);

pos_sweep_idxs = find(el_sweep >= 0); neg_sweep_idxs = find(el_sweep < 0);

pos_mag = e_plane_front_vals(pos_sweep_idxs); neg_mag = e_plane_front_vals(neg_sweep_idxs);

mag_n = (az_mag.*abs(cosd(el_sweep(neg_sweep_idxs)))) + (neg_mag.*abs(sind(el_sweep(neg_sweep_idxs)))); mag_p = (az_mag.*abs(cosd(el_sweep(pos_sweep_idxs)))) + (pos_mag.*abs(sind(el_sweep(pos_sweep_idxs))));

mag_sweep = [mag_n,mag_p];

% trim some maximum values according to the vertical cut 71

for i=1:length(el_sweep) % sweep -90 to 90 if el_sweep(i) ~= 0 mag_sweep(i) = min(mag_sweep(i),e_plane_front_vals(i)); end end

mag_pattern(:,az) = mag_sweep;

end end phase_pattern = zeros(size(mag_pattern,1),size(mag_pattern,2)); cantenna = phased.CustomAntennaElement('FrequencyVector',fv,'AzimuthAngles',azangl es,... 'ElevationAngles',el_sweep,'MagnitudePattern',mag_pattern,... 'PhasePattern',phase_pattern); figure; polarpattern(azangles,h_plane); title('Antenna Gain Pattern Polar Plot (H Plane)'); figure; polarpattern(elangles,e_plane); title('Antenna Gain Pattern Polar Plot (E Plane)');

% verify directivity is consistent with published results d = directivity(cantenna,2.4e9,[-90 0 90]); figure; pattern(cantenna,2.4e9,azangles,el_sweep,'CoordinateSystem','polar'); figure; tx = txsite('Name','Grad Project Test Location',... 'Latitude',34.649280, ... 'Longitude',-118.199696, ... 'Antenna',cantenna, ... 'AntennaAngle',-2.2, ... 'AntennaHeight',1', ... 'TransmitterFrequency',2.4e9, ... 'TransmitterPower',db2pow(13.5)*0.001); % specified in watts show(tx); coverage(tx,'PropagationModel','freespace','ReceiverGain',0,'SignalStre ngths',-60:1:-5)

CalculateClutterReturn.m

%% Mark Fessia %% ECE Grad Project %% Clutter Modeling

%% Description: Use the clutter model to create the clutter return signal. 72

% Ensure that the Clutter.m file is called before this one

% tx_baseband: ensure this signal has already been generated % clutter_sig: is the signal result vtx = [0 0 0]; % tx antenna is at origin

% get rx antenna point (vertex) vrx = gps2vert([Rx_Antenna_GPS_Coord(1) Rx_Antenna_GPS_Coord(2) (Rx_Antenna_Elev+Rx_Antenna_Height)],gps_origin); sigma_m = db2pow(-27); % median clutter values, in dB a = 3.6; lambda = 3e8/2.4e9; if exist('facets.mat','file') load('facets.mat') else queue1 = facets; queue2 = [];

final_q = [];

n_subdivides = 1;

while n_subdivides ~= 0

queue2 = []; n_subdivides = 0;

for i=1:length(queue1)

% subdivide facets if the longest edge of the triangle doesn't % meet the far field criteria f = queue1(i);

%get the shortest distance from the points of the triangle d = min([f.tx_dist_v1, f.tx_dist_v2, f.tx_dist_v3]);

% get the longest edge of the triangle edge_len = max([f.vd1, f.vd2, f.vd3]);

if d < 2*(edge_len^2)/lambda % is the edge small enough to be considered in the far field? % no, so subdivide the facet (triangle)

% add new facet to queue [f2 f3] = subdivide(f,vtx,vrx);

queue2 = [queue2 f2 f3];

73

n_subdivides = n_subdivides + 1; else % put this triangle in the queue final_q = [final_q f]; end end

queue1 = queue2; end

save('facets.mat','final_q') end

% figure; % for i=1:length(final_q) % genPatch(final_q(i),[1 1 0],[1 1 0],min_elev,max_elev,Tx_Antenna_Elev+Tx_Antenna_Height); % end close all; clear vco2; save_at_end = 1; if exist('clutter.mat','file') load('clutter.mat'); % loads clutter_signal and last i that was completed

if i == length(final_q) save_at_end = 0; end

t0 = i+1; else clutter_signal = zeros(length(tx_baseband),1); t0 = 1; end

% use constant gamma model for now gamma = db2pow(-21); % reflectivity for desert for i=t0:length(final_q)

% taking into account the antenna gain pattern radiate the % signal towards the ground facet f = final_q(i);

if f.tx_incid_angle > 90 % this facet won't be reached by the beam, it is in a shadow

if mod(i,500) == 0 disp('saving clutter.mat'); save('clutter.mat','clutter_signal','i'); end

74

continue; end

sigma0 = sqrt(sind(f.tx_graze_angle)*sind(f.rx_graze_angle))*gamma; %adjust for bistatic case rcs = sigma0*f.area;

s1 = radiator(tx_baseband,[f.tx_azd - Tx_Antenna_Angle; f.tx_eld]);

reset(channel); s2 = channel(s1,radar_pos.InitialPosition,[f.mid_point(1); f.mid_point(2); f.mid_point(3)],[0;0;0],[0;0;0]);

clut_tgt = phased.RadarTarget('Model','Nonfluctuating','MeanRCS',rcs,...

'PropagationSpeed',physconst('LightSpeed'),'OperatingFrequency',2.4e9);

s3 = clut_tgt(s2);%,true); % set true if using a Swerling fluctuation model

reset(channel); s4 = channel(s3,[f.mid_point(1); f.mid_point(2); f.mid_point(3)],radar_pos_recv_antenna.InitialPosition,[0;0;0],[0;0;0]) ;

s5 = collector(s4, [f.rx_azd - Rx_Antenna_Angle; f.rx_eld]);

clutter_signal = clutter_signal + s5;

% get a Weibull distributed RCS from acceptable spread of values % for this terrain

% r1 = rand(); % sigma_zero = (sigma_m/(log(2)^a))*(log(1/(1-r1))^a); % sigma_zero = 10*log10(sigma_zero); % % sigmas = [sigmas,sigma_zero];

disp(num2str(i));

if mod(i,500) == 0 disp('saving clutter.mat'); save('clutter.mat','clutter_signal','i'); end end if save_at_end == 1 save('clutter.mat','clutter_signal','i'); end

75

if exist('discrete_clutter.mat','file') load('discrete_clutter.mat'); else discrete_rcs = db2pow(-10); % reflectivity for desert discrete_clutter_signal = zeros(length(tx_baseband),1);

for i=1:length(discretes_queue)

% taking into account the antenna gain pattern radiate the % signal towards the discrete object d = discretes_queue(i);

s1 = radiator(tx_baseband,[d.tx_azd - Tx_Antenna_Angle; d.tx_eld]);

reset(channel); s2 = channel(s1,radar_pos.InitialPosition,[d.mid_point(1); d.mid_point(2); d.mid_point(3)],[0;0;0],[0;0;0]);

tgt = phased.RadarTarget('Model','Swerling1','MeanRCS',discrete_rcs,...

'PropagationSpeed',physconst('LightSpeed'),'OperatingFrequency',2.4e9); s3 = tgt(s2,true);

reset(channel); s4 = channel(s3,[d.mid_point(1); d.mid_point(2); d.mid_point(3)],radar_pos_recv_antenna.InitialPosition,[0;0;0],[0;0;0]) ;

s5 = collector(s4, [d.rx_azd - Rx_Antenna_Angle; d.rx_eld]);

discrete_clutter_signal = discrete_clutter_signal + s5;

disp(num2str(i)); end save('discrete_clutter.mat','discrete_clutter_signal'); end clutter_signal = clutter_signal + discrete_clutter_signal;

% slope parameter is a, % median is sigma_m,

% figure; % n_cols = 20; % [m,z] = hist(sigmas,n_cols); % w = (max(z)-min(z))/n_cols; % mm = m/n_cols/w;

76

% bar(z,mm); % colormap(cool);

Clutter.m %% Mark Fessia %% ECE Grad Project %% Clutter Modeling

%% Description: Create the clutter model for the FMCW radar simulation.

% Start be collecting GPS coordinates for each important point. Tx_Antenna_GPS_Coord = [34.649280, -118.199696]; Tx_Antenna_Angle = -2.2; % degrees from due east, radar is pointing in the slightly south/east direction Tx_Antenna_Height = 1; % meters above elevation Tx_Antenna_Elev = 756.3386840820312; Tx_Antenna_Beam_Width = 70; % degrees 3db beam width (roughly symmetric in horizontal an vertical plane)

Rx_Antenna_GPS_Coord = [34.6492755, -118.19969621]; Rx_Antenna_Angle = -2.2; % degrees from due east, radar is pointing in the south/east direction Rx_Antenna_Height = 1; % meters Rx_Antenna_Elev = 756.3386840820312; Rx_Antenna_Beam_Width = 70; % degrees, 3db beam width (roughly symmetric in horizontal an vertical plane)

% Point of car at distance of 100 m Hundred_m_Point = [34.649244, -118.198597]; Hundred_m_Point_Elev = 757.3050537109375;

% Extents of test area NW_Corner = [34.649880, -118.199696]; SW_Corner = [34.648680, -118.199696]; NE_Corner = [34.649844, -118.198097]; SE_Corner = [34.648644, -118.198097];

Grid_Resolution = 30; Grid_Long_Cell_Width = gps_dist(NW_Corner,NE_Corner)/Grid_Resolution; Grid_Lat_Cell_Height = gps_dist(NW_Corner,SW_Corner)/Grid_Resolution;

% Generate GPS grid to collect ground elevation data W_NS_LatLine = linspace(NW_Corner(1),SW_Corner(1),Grid_Resolution); W_NS_LongLine = linspace(NW_Corner(2),SW_Corner(2),Grid_Resolution);

E_NS_LatLine = linspace(NE_Corner(1),SE_Corner(1),Grid_Resolution); E_NS_LongLine = linspace(NE_Corner(2),SE_Corner(2),Grid_Resolution);

LatGrid = zeros(Grid_Resolution,Grid_Resolution); LongGrid = zeros(Grid_Resolution,Grid_Resolution); for i = 1:Grid_Resolution

77

LatGrid(1:Grid_Resolution,i) = linspace(W_NS_LatLine(i),E_NS_LatLine(i),Grid_Resolution); LongGrid(1:Grid_Resolution,i) = linspace(W_NS_LongLine(i),E_NS_LongLine(i),Grid_Resolution); end discretes{1} = {34.649231, -118.199585, 'tree'}; discretes{2} = {34.649402, -118.199318, 'tree'}; discretes{3} = {34.649125, -118.199256, 'tree'}; discretes{4} = {34.649098, -118.199183, 'tree'}; discretes{5} = {34.649052, -118.198959, 'tree'}; discretes{6} = {34.649130, -118.198940, 'tree'}; discretes{7} = {34.649210, -118.198887, 'tree'}; discretes{8} = {34.649124, -118.198807, 'tree'}; discretes{9} = {34.649161, -118.198808, 'tree'}; discretes{10} = {34.649099, -118.198692, 'tree'}; discretes{11} = {34.649063, -118.198910, 'tree'}; discretes{12} = {34.649174, -118.198925, 'tree'}; discretes{13} = {34.649385, -118.199024, 'tree'}; discretes{14} = {34.649440, -118.199242, 'tree'}; discretes{15} = {34.649342, -118.198706, 'tree'}; discretes{16} = {34.649405, -118.198672, 'tree'}; discretes{17} = {34.649357, -118.198649, 'tree'}; discretes{18} = {34.649324, -118.198649, 'other'}; discretes{19} = {34.649320, -118.198569, 'tree'}; discretes{20} = {34.649288, -118.198543, 'tree'}; discretes{21} = {34.649275, -118.198599, 'tree'}; discretes{22} = {34.649280, -118.198472, 'tree'}; discretes{23} = {34.649194, -118.198428, 'tree'}; discretes{24} = {34.649485, -118.198662, 'tree'}; discretes{25} = {34.649520, -118.198819, 'tree'}; discretes{26} = {34.649590, -118.198820, 'tree'}; discretes{27} = {34.648989, -118.199178, 'tree'};

% gather data generated from google elevation api elevations elev_list = []; for y = 1:Grid_Resolution for x = 1:Grid_Resolution elev_list = [elev_list,elev_grid{x,y}{3}]; end end for i=1:length(elev_discretes) elev_list = [elev_list,elev_discretes{i}{3}]; end min_elev = min(elev_list); % meters max_elev = max(elev_list); % meters avg_elev = mean(elev_list); % meters

78

% determine which patches in the land surface are illuminated by the main % beam out to the max range of 100 m dist_thresh = 0.12; % km facets = []; patches = []; vx = []; vy = []; vz = []; vc = []; figure; for y = 1:Grid_Resolution-1 for x = 1:Grid_Resolution-1 gps1 = elev_grid{x,y}; gps2 = elev_grid{x,y+1}; gps3 = elev_grid{x+1,y}; gps4 = elev_grid{x+1,y+1};

in_az_beam_v1 = false; in_az_beam_v2 = false; in_az_beam_v3 = false; in_az_beam_v4 = false;

az_v1 = gps_bearing(Tx_Antenna_GPS_Coord,[gps1{1},gps1{2}]); az_v2 = gps_bearing(Tx_Antenna_GPS_Coord,[gps2{1},gps2{2}]); az_v3 = gps_bearing(Tx_Antenna_GPS_Coord,[gps3{1},gps3{2}]); az_v4 = gps_bearing(Tx_Antenna_GPS_Coord,[gps4{1},gps4{2}]);

if az_v1 <= ((Tx_Antenna_Beam_Width/2)+Tx_Antenna_Angle) && az_v1 >= -((Tx_Antenna_Beam_Width/2)-Tx_Antenna_Angle) in_az_beam_v1 = true; end if az_v2 <= ((Tx_Antenna_Beam_Width/2)+Tx_Antenna_Angle) && az_v2 >= -((Tx_Antenna_Beam_Width/2)-Tx_Antenna_Angle) in_az_beam_v2 = true; end if az_v3<= ((Tx_Antenna_Beam_Width/2)+Tx_Antenna_Angle) && az_v3 >= -((Tx_Antenna_Beam_Width/2)-Tx_Antenna_Angle) in_az_beam_v3 = true; end if az_v4 <= ((Tx_Antenna_Beam_Width/2)+Tx_Antenna_Angle) && az_v4 >= -((Tx_Antenna_Beam_Width/2)-Tx_Antenna_Angle) in_az_beam_v4 = true; end

in_dist_beam_v1 = false; in_dist_beam_v2 = false; in_dist_beam_v3 = false; in_dist_beam_v4 = false;

dist_v1 = gps_dist(Tx_Antenna_GPS_Coord,[gps1{1},gps1{2}]); dist_v2 = gps_dist(Tx_Antenna_GPS_Coord,[gps2{1},gps2{2}]);

79

dist_v3 = gps_dist(Tx_Antenna_GPS_Coord,[gps3{1},gps3{2}]); dist_v4 = gps_dist(Tx_Antenna_GPS_Coord,[gps4{1},gps4{2}]);

if dist_v1 <= dist_thresh in_dist_beam_v1 = true; end if dist_v2 <= dist_thresh in_dist_beam_v2 = true; end if dist_v3 <= dist_thresh in_dist_beam_v3 = true; end if dist_v4 <= dist_thresh in_dist_beam_v4 = true; end

if (in_az_beam_v1 || in_az_beam_v2 || in_az_beam_v3 || in_az_beam_v4) && (in_dist_beam_v1 || in_dist_beam_v2 || in_dist_beam_v3 || in_dist_beam_v4)

f1 = processFacet2(gps1,gps2,gps3, Tx_Antenna_GPS_Coord, Tx_Antenna_Elev, Tx_Antenna_Height, Rx_Antenna_GPS_Coord, Rx_Antenna_Elev, Rx_Antenna_Height); f2 = processFacet2(gps3,gps2,gps4, Tx_Antenna_GPS_Coord, Tx_Antenna_Elev, Tx_Antenna_Height, Rx_Antenna_GPS_Coord, Rx_Antenna_Elev, Rx_Antenna_Height);

facets = [facets,f1,f2]; genPatch(f1,[1 1 0],[1 1 0],min_elev,max_elev,Tx_Antenna_Elev+Tx_Antenna_Height); genPatch(f2,[0 0 1],[0 0 1],min_elev,max_elev,Tx_Antenna_Elev+Tx_Antenna_Height);

% verify normals are correct %line([f1.mid_point(1) f1.normal_point(1)],[f1.mid_point(2) f1.normal_point(2)],[f1.mid_point(3) f1.normal_point(3)]); %line([f2.mid_point(1) f2.normal_point(1)],[f2.mid_point(2) f2.normal_point(2)],[f2.mid_point(3) f2.normal_point(3)]); end

end end gps_origin = [Tx_Antenna_GPS_Coord(1) Tx_Antenna_GPS_Coord(2) (Tx_Antenna_Elev+Tx_Antenna_Height)]; % <-- origin of scene tx_point = [0 0 0];

[v,f] = clutterCube(tx_point,[1.0,1.0,1.0]); tx = patch('Faces',f,'Vertices',v,'FaceColor','yellow','LineWidth',1,'FaceAl pha',1); rx_point = gps2vert([Rx_Antenna_GPS_Coord(1) Rx_Antenna_GPS_Coord(2) (Rx_Antenna_Elev+Rx_Antenna_Height)],gps_origin); [v,f] = clutterCube(rx_point,[1.0,1.0,1.0]);

80 rx = patch('Faces',f,'Vertices',v,'FaceColor','yellow','LineWidth',1,'FaceAl pha',1); tgt_point = gps2vert([Hundred_m_Point(1) Hundred_m_Point(2) (Hundred_m_Point_Elev+1)],gps_origin); [v,f] = clutterCube(tgt_point,[4.5,2.4,3.5]); car = patch('Faces',f,'Vertices',v,'FaceColor','red','LineWidth',1,'FaceAlpha ',1); discretes_queue = []; for i=1:length(elev_discretes) discrete_point = gps2vert([elev_discretes{i}{1} elev_discretes{i}{2} elev_discretes{i}{3}],gps_origin); d = processDiscrete(elev_discretes{i},Tx_Antenna_GPS_Coord, Tx_Antenna_Elev, Tx_Antenna_Height, Rx_Antenna_GPS_Coord, Rx_Antenna_Elev, Rx_Antenna_Height); discretes_queue = [discretes_queue,d]; [v,f] = clutterCube(discrete_point,[4,4,2]); tx = patch('Faces',f,'Vertices',v,'FaceColor','green','LineWidth',1,'FaceAlp ha',0.9); end

%view(3); axis equal; camproj('perspective'); title('Modeled Test Location'); xlabel('East/West Axis (m)'); ylabel('North/South Axis (m)'); %zlim([-4 4]);

Clutter_Elevation_Script_Helper.m

%% Mark Fessia %% ECE Grad Project %% Clutter Elevation Sript Helper

%% Description: Generate the python scricpt for clutter elevation points for the FMCW radar simulation. %% This script will generate a python script file used to get elevation data from the google %% elevation API.

Clutter file = fopen('gps_vars.py','w'); fprintf(file,'gps_n_width = %d\n',Grid_Resolution); fprintf(file,'gps_n_height = %d\n',Grid_Resolution); fprintf(file,'gps_grid = [');

81 for y = 1:Grid_Resolution

fprintf(file,'['); for x = 1:Grid_Resolution grid{x,y} = [LatGrid(x,y),LongGrid(x,y)]; fprintf(file,'''%3.7f,%3.7f'',',LatGrid(x,y),LongGrid(x,y)); end fprintf(file,'],\n'); end fprintf(file,']\n'); fprintf(file,'\n\n'); fprintf(file,'n_discretes = %d\n',length(discretes)); fprintf(file,'gps_discretes = ['); for i=1:length(discretes) fprintf(file,'''%3.7f,%3.7f'',',discretes{i}{1},discretes{i}{2}); end fprintf(file,']\n'); fclose(file);

clutterCube.m function [v,f] = clutterCube(coord,size)

s = size.*0.5;

v(1,1) = coord(1)+s(1); v(1,2) = coord(2)-s(2); v(1,3) = coord(3)+s(3);

v(2,1) = coord(1)+s(1); v(2,2) = coord(2)+s(2); v(2,3) = coord(3)+s(3);

v(3,1) = coord(1)-s(1); v(3,2) = coord(2)-s(2); v(3,3) = coord(3)+s(3);

v(4,1) = coord(1)-s(1); v(4,2) = coord(2)+s(2); v(4,3) = coord(3)+s(3);

v(5,1) = coord(1)+s(1); v(5,2) = coord(2)-s(2); v(5,3) = coord(3)-s(3);

v(6,1) = coord(1)+s(1); v(6,2) = coord(2)+s(2); v(6,3) = coord(3)-s(3);

82

v(7,1) = coord(1)-s(1); v(7,2) = coord(2)-s(2); v(7,3) = coord(3)-s(3);

v(8,1) = coord(1)-s(1); v(8,2) = coord(2)+s(2); v(8,3) = coord(3)-s(3);

f = [1 2 3; 3 2 4; 1 2 5; 5 2 6; 3 4 7; 7 4 8; 5 6 7; 7 6 8; 1 3 5; 5 3 7; 4 2 8; 8 2 6]; end

createFacet.m function F = createFacet(v1,v2,v3,tx,rx)

% calc distances between each of the verts vd1 = sqrt((v1(1) -v2(1))^2 + (v1(2)-v2(2))^2 + (v1(3)- v2(3))^2); vd2 = sqrt((v2(1) -v3(1))^2 + (v2(2)-v3(2))^2 + (v2(3)- v3(3))^2); vd3 = sqrt((v3(1) -v1(1))^2 + (v3(2)-v1(2))^2 + (v3(3)- v1(3))^2);

vec12 = v2-v1; vec13 = v3-v1;

theta = acos(dot(vec12,vec13)/(norm(vec12)*norm(vec13))); area = 0.5*(norm(vec12)*norm(vec13))*sin(theta); % m^2

% calculate the normal of the facet normal = cross(vec13,vec12); normal = normal./(norm(normal)); %normalize the normal =)

% calculate the mid_point of the facet m1 = (v1(1) + v2(1) + v3(1))/3; m2 = (v1(2) + v2(2) + v3(2))/3; m3 = (v1(3) + v2(3) + v3(3))/3;

mid_point = [m1 m2 m3]; normal_point = mid_point + (normal);

% calculate distance from tx and rx antennas to mid point vtx = tx; % tx antenna is at origin

% get rx antenna point (vertex) vrx = rx;%gps2vert([Rx_Antenna_GPS_Coord(1) Rx_Antenna_GPS_Coord(2) (Rx_Antenna_Elev+Rx_Antenna_Height)],gps_origin);

83

tx_rx_dist = sqrt((vtx(1) - vrx(1))^2 + (vtx(2) - vrx(2))^2 + (vtx(3) - vrx(3))^2); % verify this is about 0.5 m

% calculate the incident plane angle the facet makes with the tx antenna tx_incident_ray = (vtx - mid_point)./(norm(mid_point)); % and normalize it

tx_inc_angle = acos(dot(tx_incident_ray,normal)); % both are already normalized tx_inc_angled = rad2deg(tx_inc_angle); tx_graze_angled = 90 - tx_inc_angled;

% calculate the incident plane angle the facet makes with the rx antenna rx_incident_ray = (vrx - mid_point)./(norm(mid_point)); % and normalize it

rx_inc_angle = acos(dot(rx_incident_ray,normal)); % both are already normalized rx_inc_angled = rad2deg(rx_inc_angle); rx_graze_angled = 90 - rx_inc_angled;

% calculate average distance to the facet from the transmit % antenna tx_dist = sqrt((mid_point(1) - vtx(1))^2 + (mid_point(2) - vtx(2))^2 + (mid_point(3) - vtx(3))^2); % avg dist in meters

% calculate average distance to the facet from the receive % antenna rx_dist = sqrt((mid_point(1) - vrx(1))^2 + (mid_point(2) - vrx(2))^2 + (mid_point(3) - vrx(3))^2); % avg dist in meters

% calculate the tx az and elevation angles to the facet mid % point tx_azd = rad2deg(atan2(-tx_incident_ray(2),- tx_incident_ray(1))); %tx_eld = rad2deg(atan2(-tx_incident_ray(3),- tx_incident_ray(1))); xy_dist = sqrt((mid_point(1) - vtx(1))^2 + (mid_point(2) - vtx(2))^2); z_dist = mid_point(3); tx_eld = rad2deg(atan2(z_dist,xy_dist));

rx_azd = rad2deg(atan2(-rx_incident_ray(2),- rx_incident_ray(1))); %rx_eld = rad2deg(atan2(-rx_incident_ray(3),- rx_incident_ray(1))); xy_dist = sqrt((mid_point(1) - vrx(1))^2 + (mid_point(2) - vrx(2))^2); z_dist = mid_point(3); rx_eld = rad2deg(atan2(z_dist,xy_dist));

% calc the distance from the transmit antenna to each of the

84

% verts tx_dist_v1 = sqrt((v1(1) - vtx(1))^2 + (v1(2) - vtx(2))^2 + (v1(3) - vtx(3))^2); tx_dist_v2 = sqrt((v2(1) - vtx(1))^2 + (v2(2) - vtx(2))^2 + (v2(3) - vtx(3))^2); tx_dist_v3 = sqrt((v3(1) - vtx(1))^2 + (v3(2) - vtx(2))^2 + (v3(3) - vtx(3))^2);

facet.v1 = v1; facet.v2 = v2; facet.v3 = v3;

facet.vd1 = vd1;%sqrt((v1(1) -v2(1))^2 + (v1(2)-v2(2))^2 + (v1(3)-v2(3))^2); facet.vd2 = vd2;%sqrt((v2(1) -v3(1))^2 + (v2(2)-v3(2))^2 + (v2(3)-v3(3))^2); facet.vd3 = vd3;%sqrt((v3(1) -v1(1))^2 + (v3(2)-v1(2))^2 + (v3(3)-v1(3))^2);

facet.tx_dist_v1 = tx_dist_v1; facet.tx_dist_v2 = tx_dist_v2; facet.tx_dist_v3 = tx_dist_v3;

facet.tx_dist = tx_dist; facet.rx_dist = rx_dist;

facet.tx_graze_angle = tx_graze_angled; facet.tx_incid_angle = rx_inc_angled;

facet.rx_graze_angle = rx_graze_angled; facet.rx_incid_angle = rx_inc_angled;

facet.tx_azd = tx_azd; facet.tx_eld = tx_eld;

facet.rx_azd = rx_azd; facet.rx_eld = rx_eld;

facet.normal = normal; facet.mid_point = mid_point; facet.normal_point = normal_point; facet.area = area;

F = facet; end

Environment2.m

%% Mark Fessia %% ECE Grad Project %% Environment Modeling

85

%% Description: Simulates channel effects/clutter in the environment the %% radiated signal is propagating through.

% Place the radar at the origin radar_pos = phased.Platform('InitialPosition',[0;0;0],'Velocity',[0;0;0]);

% Because this is a bistatic radar ensure that the position of the receive % antenna is taken into account for cross coupling effects. For this % simulation, the receive antenna is situated 0.5 meters to the "right" (along % the negative y axis) of the transmit antenna. radar_pos_recv_antenna = phased.Platform('InitialPosition',[0;- 0.5;0],'Velocity',[0;0;0]);

% Start the target at 20 to 100 meters tgt_posvel = phased.Platform('InitialPosition',[100; 0; 0],'Velocity',[0;0;0]);

% Model target characteristics of a car % Model either Nonfluctuating or Swerling1 tgt_rcs = phased.RadarTarget('Model','Nonfluctuating','MeanRCS',100,...

'PropagationSpeed',physconst('LightSpeed'),'OperatingFrequency',2.4e9);

% Model the channel through which the radar signal propagates (air) channel = phased.FreeSpace(... 'PropagationSpeed',physconst('LightSpeed'),... 'OperatingFrequency',2.4e9,'TwoWayPropagation',false,... 'SampleRate',6e9);

low_pass_filter_bank.m

%% Mark Fessia %% ECE Grad Project %% Low pass filter bank function function y = low_pass_filter_bank(x,lpf_bank)

y = filter(lpf_bank.lpf0_5GHz_fs6GHz,x); y = downsample(y,6); %fs 1GHz

y = filter(lpf_bank.lpf50MHz_fs1GHz,y); y = downsample(y,10); %fs 100MHz

y = filter(lpf_bank.lpf5MHz_fs100MHz,y); y = downsample(y,10); %fs 10MHz

86

y = filter(lpf_bank.lpf0_5MHz_fs10MHz,y); y = downsample(y,10); %fs 1MHz

y = filter(lpf_bank.lpf50kHz_fs1MHz,y); end

genPatch.m function p = genPatch(f,hi_c,low_c,min_elev,max_elev,tx_elev)

vertices = [f.v1;f.v2;f.v3]; faces = [1 2 3];

%elev1_ = f.gps1{3}; %elev2_ = f.gps2{3}; %elev3_ = f.gps3{3};

elev1 = tx_elev + f.v1(3); elev2 = tx_elev + f.v2(3); elev3 = tx_elev + f.v3(3);

p1 = (elev1-min_elev)/(max_elev - min_elev); p2 = (elev2-min_elev)/(max_elev - min_elev); p3 = (elev3-min_elev)/(max_elev - min_elev);

if f.tx_incid_angle > 90 % this facet won't be reached by the beam hi_c = [ 0 0 0 ]; low_c = [0 0 0]; end

r = hi_c(1)-low_c(1); g = hi_c(2)-low_c(2); b = hi_c(3)-low_c(3);

L = 5;

colors = [quant(r*p1+low_c(1),L) quant(g*p1+low_c(2),L) quant(b*p1+low_c(3),L);... quant(r*p2+low_c(1),L) quant(g*p2+low_c(2),L) quant(b*p2+low_c(3),L);... quant(r*p3+low_c(1),L) quant(g*p3+low_c(2),L) quant(b*p3+low_c(3),L)];

p = patch('Faces',faces,'Vertices',vertices,'FaceVertexCData',colors); p.FaceColor = 'interp'; %p.EdgeColor = 'interp'; end

87 getPatch.m function [X,Y,Z] = getPatch(facet)

% get a MATLAB patch from the facet

X = [facet.v1(1) facet.v2(1) facet.v3(1)]; Y = [facet.v1(2) facet.v2(2) facet.v3(2)]; Z = [facet.v1(3) facet.v2(3) facet.v3(3)]; end gps2vert.m function v = gps2vert(gps,gps_origin) % convert gps coords to a 3D rectangular coordinate system with % one meter units and the tx antenna at the origin

% latitude translates to y coordinate % longitude translates to x coordinate % elevation (alt.) translates to z coordinate

vx = gps_dist([gps_origin(1) gps_origin(2)],[gps_origin(1) gps(2)])*1000; vy = gps_dist([gps_origin(1) gps_origin(2)],[gps(1) gps_origin(2)])*1000; vz = gps(3) - gps_origin(3);

% check latitude sign if gps(1) < gps_origin(1) vy = -vy; end

% check longitude sign if gps(2) < gps_origin(2) vx = -vx; end

v = [vx vy vz]; end gps_bearing.m function deg = gps_bearing(loc1,loc2)

lat1 = loc1(1); long1 = loc1(2); lat2 = loc2(1); long2 = loc2(2);

dy = lat2 - lat1; dx = cos(deg2rad(lat1))*(long2 - long1); angle = atan2(dy, dx); deg = rad2deg(angle); end 88

gps_dist.m function km = gps_dist(loc1, loc2)

lat1 = loc1(1); long1 = loc1(2); lat2 = loc2(1); long2 = loc2(2);

% calculate distance between to gps coordinates using haversine method d2r = (pi / 180.0);

dlong = (long2 - long1) * d2r; dlat = (lat2 - lat1) * d2r; a = (sin(dlat/2.0)^2) + cos(lat1*d2r) * cos(lat2*d2r) * (sin(dlong/2.0)^2); c = 2 * atan2(sqrt(a), sqrt(1-a)); d = 6367 * c;

km = d; end

Modulator.m

%% Mark Fessia %% ECE Grad Project %% Modulator Signal Modeling & Details

%% Description: This module produces a triangle wave 'modulator' signal that will %% be used to drive the voltage controlled oscillator. clear modulator; tri = @(x,w) (abs(x) <= w/2).*(1-abs(x)*(2/w)); modulator.c = 3e8; modulator.min_range = 20; % (meters) modulator.max_range = 100; % (meters) modulator.min_rtt = (modulator.min_range*2)/modulator.c; modulator.max_rtt = (modulator.max_range*2)/modulator.c; modulator.fs = 6e9; % sampling at 6 GHz modulator.n_recv_window_samples = 20e6; % desired number of receive window samples modulator.inc_duration = modulator.max_rtt+modulator.n_recv_window_samples*(1/modulator.fs); modulator.dec_duration = modulator.inc_duration; % symmetric modulator.tri_duration = modulator.inc_duration + modulator.dec_duration; 89

modulator.tri_time = - modulator.inc_duration:1/modulator.fs:modulator.dec_duration - (1/modulator.fs); modulator.tri = tri(modulator.tri_time,modulator.tri_duration); modulator.inc_recv_window = ((modulator.tri_time + modulator.inc_duration) >= modulator.max_rtt) & ((modulator.tri_time + modulator.inc_duration) < modulator.inc_duration); modulator.dec_recv_window = ((modulator.tri_time + modulator.inc_duration) >= (modulator.inc_duration + modulator.max_rtt)); modulator.tri_recv_window = (modulator.inc_recv_window + modulator.dec_recv_window).*1; modulator.reps = 1; modulator.min_voltage = 1.91; %modulator.max_voltage = 3.25; %modulator.max_voltage = 1.97; modulator.max_voltage = 3.25; modulator.sweep = modulator.max_voltage - modulator.min_voltage; vco_stats.qfreq = 2.2574e9; % model the ZX95-2536C+ as closely as possible vco_stats.v_hz = 74.66e6; vco_stats.min_freq = vco_stats.qfreq + modulator.min_voltage*vco_stats.v_hz; vco_stats.max_freq = vco_stats.qfreq + modulator.max_voltage*vco_stats.v_hz; vco_stats.bw = vco_stats.max_freq - vco_stats.min_freq; rx_stats.ret_freq_min = (((2*modulator.min_range)/3e8)/modulator.inc_duration)*vco_stats.bw; rx_stats.ret_freq_max = (((2*modulator.max_range)/3e8)/modulator.inc_duration)*vco_stats.bw; disp(['Min Range Freq: ',num2str(rx_stats.ret_freq_min)]); disp(['Max Range Freq: ',num2str(rx_stats.ret_freq_max)]); disp(['Bandwidth: ',num2str(vco_stats.bw)]); modulator.signal_normalized = repmat(modulator.tri,1,modulator.reps); modulator.signal = modulator.min_voltage + modulator.sweep.*repmat(modulator.tri,1,modulator.reps); modulator.sig_recv_window = repmat(modulator.tri_recv_window,1,modulator.reps); modulator.n = 0:length(modulator.signal)-1; modulator.time = modulator.n.*(1/modulator.fs); modulator.duration = max(modulator.time);

indices = find(modulator.sig_recv_window > 0);

90 s1 = 1; s2 = 2; for j=1:modulator.reps

for k=s1+1:length(indices) if indices(k-1)+1 ~= indices(k) break; end end

s2 = k-1; modulator.rep(j).recv_window.inc_indices = indices(s1:s2); s1 = k;

for k=s1+1:length(indices) if indices(k-1)+1 ~= indices(k) break; end end

s2 = k-1; modulator.rep(j).recv_window.dec_indices = indices(s1:s2); s1 = k; end clear indices; clear s1; clear s2; clear j; clear k; clear tri; figure; plot(modulator.time,modulator.signal,'-'); ylabel('Voltage'); xlabel('Time (s)'); grid on title('Modulator Output Voltage'); figure; plot(modulator.time,modulator.signal,'- ',modulator.time,modulator.sig_recv_window.*modulator.max_voltage,'-'); %ylabel('Voltage'); xlabel('Time (s)'); grid on title('Modulator Receive Window');

processDiscrete.m function D = processDiscrete(gps1,Tx_Antenna_GPS_Coord, Tx_Antenna_Elev, Tx_Antenna_Height, Rx_Antenna_GPS_Coord, Rx_Antenna_Elev, Rx_Antenna_Height)

91

disc.gps1 = gps1;

gps_origin = [Tx_Antenna_GPS_Coord(1) Tx_Antenna_GPS_Coord(2) (Tx_Antenna_Elev+Tx_Antenna_Height)];

% convert GPS coords to 3D coordinate system (reasonable since % the area is relatively small v1 = gps2vert([gps1{1} gps1{2} gps1{3}],gps_origin);

% calculate the mid_point of the facet m1 = v1(1); m2 = v1(2); m3 = v1(3);

mid_point = [m1 m2 m3];

% calculate distance from tx and rx antennas to mid point vtx = [0 0 0]; % tx antenna is at origin

% get rx antenna point (vertex) vrx = gps2vert([Rx_Antenna_GPS_Coord(1) Rx_Antenna_GPS_Coord(2) (Rx_Antenna_Elev+Rx_Antenna_Height)],gps_origin);

tx_rx_dist = sqrt((vtx(1) - vrx(1))^2 + (vtx(2) - vrx(2))^2 + (vtx(3) - vrx(3))^2); % verify this is about 0.5 m

% calculate the incident plane angle the facet makes with the tx antenna tx_incident_ray = (vtx - mid_point)./(norm(mid_point)); % and normalize it

% calculate the incident plane angle the facet makes with the rx antenna rx_incident_ray = (vrx - mid_point)./(norm(mid_point)); % and normalize it

% calculate average distance to the facet from the transmit % antenna tx_dist = sqrt((mid_point(1) - vtx(1))^2 + (mid_point(2) - vtx(2))^2 + (mid_point(3) - vtx(3))^2); % avg dist in meters

% calculate average distance to the facet from the receive % antenna rx_dist = sqrt((mid_point(1) - vrx(1))^2 + (mid_point(2) - vrx(2))^2 + (mid_point(3) - vrx(3))^2); % avg dist in meters

% calculate the tx az and elevation angles to the facet mid % point tx_azd = rad2deg(atan2(-tx_incident_ray(2),- tx_incident_ray(1))); %tx_eld = rad2deg(atan2(-tx_incident_ray(3),- tx_incident_ray(1)));

92

xy_dist = sqrt((mid_point(1) - vtx(1))^2 + (mid_point(2) - vtx(2))^2); z_dist = mid_point(3); tx_eld = rad2deg(atan2(z_dist,xy_dist));

rx_azd = rad2deg(atan2(-rx_incident_ray(2),- rx_incident_ray(1))); %rx_eld = rad2deg(atan2(-rx_incident_ray(3),- rx_incident_ray(1))); xy_dist = sqrt((mid_point(1) - vrx(1))^2 + (mid_point(2) - vrx(2))^2); z_dist = mid_point(3); rx_eld = rad2deg(atan2(z_dist,xy_dist));

disc.v1 = v1;

disc.tx_dist = tx_dist; disc.rx_dist = rx_dist;

disc.tx_azd = tx_azd; disc.tx_eld = tx_eld;

disc.rx_azd = rx_azd; disc.rx_eld = rx_eld;

disc.mid_point = mid_point;

D = disc; end

processFacet.m function F = processFacet(gps1,gps2,gps3, Tx_Antenna_GPS_Coord, Tx_Antenna_Elev, Tx_Antenna_Height, Rx_Antenna_GPS_Coord, Rx_Antenna_Elev, Rx_Antenna_Height)

facet.gps1 = gps1; facet.gps2 = gps2; facet.gps3 = gps3;

fd1 = gps_dist([gps1{1},gps1{2}],[gps2{1},gps2{2}])*1000; fd2 = gps_dist([gps2{1},gps2{2}],[gps3{1},gps3{2}])*1000; fd3 = gps_dist([gps3{1},gps3{2}],[gps1{1},gps1{2}])*1000;

hd1 = abs(gps1{3}-gps2{3}); hd2 = abs(gps2{3}-gps3{3}); hd3 = abs(gps3{3}-gps1{3});

d1 = sqrt(fd1^2 + hd1^2); d2 = sqrt(fd2^2 + hd2^2); d3 = sqrt(fd3^2 + hd3^2);

93

% calculate area based on gps coords (so we can compare to 3D % coords) and sanity check s = (d1+d2+d3)/2; facet.gps_area = sqrt(s*(s-d1)*(s-d2)*(s-d3));

gps_origin = [Tx_Antenna_GPS_Coord(1) Tx_Antenna_GPS_Coord(2) (Tx_Antenna_Elev+Tx_Antenna_Height)];

% convert GPS coords to 3D coordinate system (reasonable since % the area is relatively small v1 = gps2vert([gps1{1} gps1{2} gps1{3}],gps_origin); v2 = gps2vert([gps2{1} gps2{2} gps2{3}],gps_origin); v3 = gps2vert([gps3{1} gps3{2} gps3{3}],gps_origin);

% calc distances between each of the verts vd1 = sqrt((v1(1) -v2(1))^2 + (v1(2)-v2(2))^2 + (v1(3)- v2(3))^2); vd2 = sqrt((v2(1) -v3(1))^2 + (v2(2)-v3(2))^2 + (v2(3)- v3(3))^2); vd3 = sqrt((v3(1) -v1(1))^2 + (v3(2)-v1(2))^2 + (v3(3)- v1(3))^2);

vec12 = v2-v1; vec13 = v3-v1;

theta = acos(dot(vec12,vec13)/(norm(vec12)*norm(vec13))); area = 0.5*(norm(vec12)*norm(vec13))*sin(theta); % m^2

% calculate the normal of the facet normal = cross(vec13,vec12); normal = normal./(norm(normal)); %normalize the normal =)

% calculate the mid_point of the facet m1 = (v1(1) + v2(1) + v3(1))/3; m2 = (v1(2) + v2(2) + v3(2))/3; m3 = (v1(3) + v2(3) + v3(3))/3;

mid_point = [m1 m2 m3]; normal_point = mid_point + (normal);

% calculate distance from tx and rx antennas to mid point vtx = [0 0 0]; % tx antenna is at origin

% get rx antenna point (vertex) vrx = gps2vert([Rx_Antenna_GPS_Coord(1) Rx_Antenna_GPS_Coord(2) (Rx_Antenna_Elev+Rx_Antenna_Height)],gps_origin);

tx_rx_dist = sqrt((vtx(1) - vrx(1))^2 + (vtx(2) - vrx(2))^2 + (vtx(3) - vrx(3))^2); % verify this is about 0.5 m

94

% calculate the incident plane angle the facet makes with the tx antenna tx_incident_ray = (vtx - mid_point)./(norm(mid_point)); % and normalize it

tx_inc_angle = acos(dot(tx_incident_ray,normal)); % both are already normalized tx_inc_angled = rad2deg(tx_inc_angle); tx_graze_angled = 90 - tx_inc_angled;

% calculate the incident plane angle the facet makes with the rx antenna rx_incident_ray = (vrx - mid_point)./(norm(mid_point)); % and normalize it

rx_inc_angle = acos(dot(rx_incident_ray,normal)); % both are already normalized rx_inc_angled = rad2deg(rx_inc_angle); rx_graze_angled = 90 - rx_inc_angled;

% calculate average distance to the facet from the transmit % antenna tx_dist = sqrt((mid_point(1) - vtx(1))^2 + (mid_point(2) - vtx(2))^2 + (mid_point(3) - vtx(3))^2); % avg dist in meters

% calculate average distance to the facet from the receive % antenna rx_dist = sqrt((mid_point(1) - vrx(1))^2 + (mid_point(2) - vrx(2))^2 + (mid_point(3) - vrx(3))^2); % avg dist in meters

% calculate the tx az and elevation angles to the facet mid % point tx_azd = rad2deg(atan2(-tx_incident_ray(2),- tx_incident_ray(1))); tx_eld = rad2deg(atan2(-tx_incident_ray(3),- tx_incident_ray(1)));

rx_azd = rad2deg(atan2(-rx_incident_ray(2),- rx_incident_ray(1))); rx_eld = rad2deg(atan2(-rx_incident_ray(3),- rx_incident_ray(1)));

% calc the distance from the transmit antenna to each of the % verts tx_dist_v1 = sqrt((v1(1) - vtx(1))^2 + (v1(2) - vtx(2))^2 + (v1(3) - vtx(3))^2); tx_dist_v2 = sqrt((v2(1) - vtx(1))^2 + (v2(2) - vtx(2))^2 + (v2(3) - vtx(3))^2); tx_dist_v3 = sqrt((v3(1) - vtx(1))^2 + (v3(2) - vtx(2))^2 + (v3(3) - vtx(3))^2);

facet.v1 = v1; facet.v2 = v2; facet.v3 = v3;

95

facet.vd1 = vd1;%sqrt((v1(1) -v2(1))^2 + (v1(2)-v2(2))^2 + (v1(3)-v2(3))^2); facet.vd2 = vd2;%sqrt((v2(1) -v3(1))^2 + (v2(2)-v3(2))^2 + (v2(3)-v3(3))^2); facet.vd3 = vd3;%sqrt((v3(1) -v1(1))^2 + (v3(2)-v1(2))^2 + (v3(3)-v1(3))^2);

facet.tx_dist_v1 = tx_dist_v1; facet.tx_dist_v2 = tx_dist_v2; facet.tx_dist_v3 = tx_dist_v3;

facet.tx_dist = tx_dist; facet.rx_dist = rx_dist;

facet.tx_graze_angle = tx_graze_angled; facet.tx_incid_angle = rx_inc_angled;

facet.rx_graze_angle = rx_graze_angled; facet.rx_incid_angle = rx_inc_angled;

facet.tx_azd = tx_azd; facet.tx_eld = tx_eld;

facet.rx_azd = rx_azd; facet.rx_eld = rx_eld;

facet.normal = normal; facet.mid_point = mid_point; facet.normal_point = normal_point; facet.area = area;

F = facet; end

processFacet2.m function F = processFacet2(gps1,gps2,gps3, Tx_Antenna_GPS_Coord, Tx_Antenna_Elev, Tx_Antenna_Height, Rx_Antenna_GPS_Coord, Rx_Antenna_Elev, Rx_Antenna_Height)

gps_origin = [Tx_Antenna_GPS_Coord(1) Tx_Antenna_GPS_Coord(2) (Tx_Antenna_Elev+Tx_Antenna_Height)];

% convert GPS coords to 3D coordinate system (reasonable since % the area is relatively small v1 = gps2vert([gps1{1} gps1{2} gps1{3}],gps_origin); v2 = gps2vert([gps2{1} gps2{2} gps2{3}],gps_origin); v3 = gps2vert([gps3{1} gps3{2} gps3{3}],gps_origin);

vtx = [0 0 0]; % tx antenna is at origin

96

% get rx antenna point (vertex) vrx = gps2vert([Rx_Antenna_GPS_Coord(1) Rx_Antenna_GPS_Coord(2) (Rx_Antenna_Elev+Rx_Antenna_Height)],gps_origin);

F = createFacet(v1,v2,v3,vtx,vrx); end

Radar_Equation.m

%% Mark Fessia %% ECE Graduate Project %% Fall 2018 %% Prof. Van Alphen (Chair)

%% Radar Equation Calculations

Pt = 0.001 * db2pow(13.5); % 1 mW = Pave fc = 2.45e9; % frequency of carrier lambda_c = physconst('LightSpeed')/fc; % wavelength of carrier Gt = db2pow(7.3); % gain of transmit antenna Gr = db2pow(7.3); % gain of receive antenna Ar = Gr*(lambda_c^2) / (4*pi); % effective aperture of receive antenna k = 1.38e-23; % (joul/deg) Boltzmann's constant Ls = db2pow(6); % assume 6 dB of misc. system losses sigma_tgt = 100; % RCS of target m^2 Fn = db2pow(1.2); % receiver noise figure taken from data sheet To = 290; %standard temp in Kelvin t_sample = 0.0033; % the length of one receive window in seconds Bn = 2/t_sample; % noise bandwidth, 2*1/t_sample since using a direct conversion receiver tau_Fr = 1;% duty cycle, 1 for a CW radar SNR = db2pow(13.4); % desired signal to noise ratio for probability of false alarm = 10e-6 alpha = 0; % atmospheric attenuation, assume 0 at this distance rho_r = 1; % antenna efficiency, this has been factored into the antenna gain

R = 0:0.5:200; % range in meters

S = Pt.*Gt.*Ar.*sigma_tgt; N = ((4.*pi).^2).*k.*To.*Bn.*Fn.*Ls.*(R.^4); figure; plot(10*log10((S./N)/0.001)) figure; Pr_tgt = Pt.*((lambda_c./(4.*pi.*R)).^2).*Gt.*1; % Friis equation for power received at target location plot(10*log10((Pr_tgt)/0.001)) figure; Pr_tgt = Pt.*((lambda_c./(4.*pi.*R)).^2).*db2pow(-7.06).*db2pow(-7.96); % Friis equation for power due to antenna coupling

97 plot(10*log10((Pr_tgt)/0.001))

Rmax4 = (Pt*Gt*Ar*rho_r*sigma_tgt*exp(0))/(((4*pi)^2)*k*To*Fn*Bn*1*SNR*Ls) Rmax = Rmax4^(1/4) f3 = figure; hold on Pr = ((Pt.*Gt)./(4.*pi.*R.^2)).*(10./(4.*pi.*R.^2)).*Ar; plot(10*log10(Pr/0.001),'--');

Pr = ((Pt.*Gt)./(4.*pi.*R.^2)).*(100./(4.*pi.*R.^2)).*Ar; plot(10*log10(Pr/0.001),'-.'); title('Received Power vs. Target Range'); xlabel('Range (m)'); ylabel('Received Power (dBm)'); grid on hold off legend('\sigma = 10 m^2','\sigma = 100 m^2');

Receiver.m

%% Mark Fessia %% ECE Grad Project %% Receiver Modeling

%% Description: This models the receiver LNA placed after the receive antenna.

% Model the receiver low noise amplifier used after the receive antenna receiver = phased.ReceiverPreamp('Gain',14,'NoiseFigure',1.2,... 'ReferenceTemperature',290,'SampleRate',6e9,... 'EnableInputPort',false);%,'SeedSource','Property','Seed',1e3);

subdivide.m function [f2,f3] = subdivide(f,vtx,vrx)

mid = []; pta = []; ptb = []; p2c = []; % get the mid point of the longest edge if f.vd1 > f.vd2 if f.vd1 > f.vd3 % get midpoint of v1 and v2 mid = [(f.v1(1) + f.v2(1))/2 (f.v1(2) + f.v2(2))/2 (f.v1(3) + f.v2(3))/2]; % get point of v3

98

pta = f.v3; ptb = f.v1; ptc = f.v2; else % get midpoint of v3 and v1 mid = [(f.v3(1) + f.v1(1))/2 (f.v3(2) + f.v1(2))/2 (f.v3(3) + f.v1(3))/2]; % get point of v2 pta = f.v2; ptb = f.v3; ptc = f.v1; end else if f.vd2 > f.vd3 % get midpoint of v2 and v3 mid = [(f.v2(1) + f.v3(1))/2 (f.v2(2) + f.v3(2))/2 (f.v2(3) + f.v3(3))/2]; % get point of v2 pta = f.v1; ptb = f.v2; ptc = f.v3; else % get midpoint of v3 and v1 mid = [(f.v3(1) + f.v1(1))/2 (f.v3(2) + f.v1(2))/2 (f.v3(3) + f.v1(3))/2]; % get point of v2 pta = f.v2; ptb = f.v3; ptc = f.v1; end end

f2 = createFacet(pta,ptb,mid,vtx,vrx); f3 = createFacet(pta,mid,ptc,vtx,vrx); end

Simulation2.m

%% Mark Fessia %% ECE Graduate Project %% Fall 2018 %% Prof. Van Alphen (Chair)

%% FM-CW Radar Simulation using antenna toolbox and phased array toolbox components. clc clear all close all

99

% Calculate theoretical performance of the radar system Radar_Equation

% Create antenna objects based on antenna parameters Antenna2

% Calculate the triangle wave and receive windows, based on Modulator characteristics Modulator

% Create the VCO signal from the Modulator output VCO2

% Create the phased.Transmitter and phased.Radiator objects Transmitter_Radiator2

% Create the target and environment objects Environment2

% Create the clutter model for the test location Clutter

% Ceaat the receiver objects Receiver

% Create the low pass filters lpf_bank = load('low_pass_filters.mat'); hpf_bank = load('hpf_dc2.mat');

% Now that these objects have been created, the signal simulation can be conducted

% Apply the effects of the attenuator and the LNA to the transmit signal % Convert the signal to its in-phase only (real) version, taking into % account the correct signal power vco_sig = real(vco2.baseband_and_noise).*(1/0.7071);

% Apply the effect of the attenuator atten_vco_sig = vco_sig.*(0.7071);

% Apply the effect of the LNA with its noise figure = 0.8 dB Fn = db2pow(0.8); k = physconst('Boltzmann'); T0 = 290; B = 400e6; G = db2pow(14); Nout = Fn*k*T0*B*G; % calculate the output noise power lna_noise = sqrt(Nout).*randn(1,length(atten_vco_sig)); lna_sig = atten_vco_sig.*db2mag(14) + lna_noise;

% Apply the effects of the splitter, attenuate the signal by 3.2 dB splitter_out_sig = lna_sig.*db2mag(-3.2);

100

% Create IQ samples from the splitter so the signal can be passed to the % transmitter splitter_out_IQ = hilbert(splitter_out_sig);

% Put the baseband signal through the transmitter stage % The transmitter stage ensures that the signal at the right power level of % 13.5 dBm tx_baseband = transmitter(splitter_out_IQ');

% Radiate the signal towards the target taking into consideration % the antenna characteristics tx_sig = radiator(tx_baseband,[0;0]);

% Radiate the power from the transmit antenna toward the receive antenna to % simulate coupling between them tx_sig2 = radiator(tx_baseband, [-90;0]);

% Simulate the radiated signal as it travels through the environment % towards the the target tgt_posvel.InitialPosition(1) = 100; %m relative to the front of the radar (x-axis) tgt_posvel.Velocity(1) = 0; %m/s yon_sig = channel(tx_sig, radar_pos.InitialPosition, tgt_posvel.InitialPosition, [0;0;0], tgt_posvel.Velocity);

% Simulate the scattering of the signal from a car sized object %echo_sig1 = tgt(yon_sig,true); % use this line when model is set to % swerling1, 2, 3, or 4 echo_sig1 = tgt_rcs(yon_sig); % use this model for Nonfluctuating

% Simulate the reflected echo as it travels back towards the radar receive % antenna, take into account the fact the receive antenna is not in the % same position as the transmit antenna. % Establish the initial range and angle of the target [tgtrng,tgtang] = rangeangle(tgt_posvel.InitialPosition, radar_pos_recv_antenna.InitialPosition); echo_sig2 = channel(echo_sig1, tgt_posvel.InitialPosition, radar_pos_recv_antenna.InitialPosition, tgt_posvel.Velocity, [0;0;0]);

% Simulate collection of the signal by the receive antenna echo_sig3 = collector(echo_sig2, tgtang);

% Also calculate cross coupling from transmit and receive antennas % at 0.5 meters away to the right (along negative y axis) receive antenna % will be in the far field, so a plane wave approximation will be used coupled_sig = channel(tx_sig2,radar_pos.InitialPosition,radar_pos_recv_antenna.Initia lPosition,[0;0;0],[0;0;0]);

101 coupled_sig = collector(coupled_sig,[90;0]);

% Calculate the clutter signal (this takes a long time to compute) CalculateClutterReturn

%sig_clutter_only = clutter_signal;

% Consider the different parts of the signal echo and interferance %sig_coupled_only = coupled_sig; %sig_echo_only = echo_sig3; sig_total = coupled_sig + echo_sig3 + clutter_signal; %sig_total = echo_sig3 + clutter_signal;

% Simulate the returned signal echo as it is amplified and processed %sig_c = receiver(sig_coupled_only); %sig_e = receiver(sig_echo_only); %sig_clut = receiver(sig_clutter_only); sig_tot = receiver(sig_total);

% Simulate the mixing of the received echo with the transmitted signal, the % conversion loss is 6 dB %mixed_sig_c = (real(tx_baseband).*db2mag(3)).*(real(sig_c).*db2mag(3)).*db2mag(-6); %mixed_sig_e = (real(tx_baseband).*db2mag(3)).*(real(sig_e).*db2mag(3)).*db2mag(-6); mixed_sig_tot = (real(tx_baseband).*db2mag(3)).*(real(sig_tot).*db2mag(3)).*db2mag(-6);

% Video Amplifier/Filter Stage - Decimation to 1 MHz sample rate and 50 kHz as highest % frequency component. We need to retain signals in the audio band (up to % 22 kHz) video_sig = low_pass_filter_bank(mixed_sig_tot,lpf_bank);

% Apply receive windows to signal for incrementing and decrementing sides % of triangl wave, 6000 = 6e9/1e6 -> the down sample factor inc_recv_window_sig = ceil(modulator.rep(1).recv_window.inc_indices(1)/6000):floor(modulator. rep(1).recv_window.inc_indices(end)/6000); dec_recv_window_sig = ceil(modulator.rep(1).recv_window.dec_indices(1)/6000):floor(modulator. rep(1).recv_window.dec_indices(end)/6000);

% Get one signal for the incrementing side & one for the decrementing side r1 = video_sig(inc_recv_window_sig); r2 = video_sig(dec_recv_window_sig);

102

% Apply kaiser window r1_wind = kaiser(length(r1),4); r2_wind = kaiser(length(r2),4); s1 = r1.*r1_wind; s2 = r2.*r2_wind; f1 = figure; plot(linspace(- 0.5e6,0.5e6,1e6),20.*log10(abs(fftshift(fft(s1,1e6)))),'b',... linspace(- 0.5e6,0.5e6,1e6),20.*log10(abs(fftshift(fft(s2,1e6)))),'g'); title(['Target, RCS = ',num2str(pow2db(tgt_rcs.MeanRCS)),' dBsm, Range = ',num2str(tgt_posvel.InitialPosition(1)),' m, Velocity = ',num2str(tgt_posvel.Velocity(1)),' m/s']); xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); legend('Return from increasing freq. ramp','Return from decreasing freq. ramp');

% r1i_c = mixed_sig_c(modulator.rep(1).recv_window.inc_indices); % r1i_c_no_window = r1i_c; % %r1d = mixed_sig(modulator.rep(1).recv_window.dec_indices); % wind = kaiser(length(r1i_c),4); % r1i_c = r1i_c.*wind; % % r1i_e = mixed_sig_e(modulator.rep(1).recv_window.inc_indices); % r1i_e_no_window = r1i_e; % r1i_e = r1i_e.*wind; % % r1i_t = mixed_sig_tot(modulator.rep(1).recv_window.inc_indices); % r1i_t_no_window = r1i_t; % r1i_t = r1i_t.*wind; % % % low pass filter and down sample the signal to produce the video signal % s1i_c = low_pass_filter_bank(r1i_c,lpf_bank); % s1i_c_no_window = low_pass_filter_bank(r1i_c_no_window,lpf_bank); % % s1i_e = low_pass_filter_bank(r1i_e,lpf_bank); % s1i_e_no_window = low_pass_filter_bank(r1i_e_no_window,lpf_bank); % % s1i_t = low_pass_filter_bank(r1i_t,lpf_bank); % s1i_t_no_window = low_pass_filter_bank(r1i_t_no_window,lpf_bank); % % % f1 = figure; % plot(linspace(- 0.5e6,0.5e6,1e6),20.*log10(abs(fftshift(fft(s1i_t,1e6)))),'b',... % linspace(- 0.5e6,0.5e6,1e6),20.*log10(abs(fftshift(fft(s1i_c,1e6)))),'g',... % linspace(- 0.5e6,0.5e6,1e6),20.*log10(abs(fftshift(fft(s1i_e,1e6)))),'r'); 103

% % f2 = figure; % plot(linspace(- 0.5e6,0.5e6,1e6),20.*log10(abs(fftshift(fft(s1i_t_no_window,1e6)))),'b' ,... % linspace(- 0.5e6,0.5e6,1e6),20.*log10(abs(fftshift(fft(s1i_c_no_window,1e6)))),'g' ,... % linspace(- 0.5e6,0.5e6,1e6),20.*log10(abs(fftshift(fft(s1i_e_no_window,1e6)))),'r' );

30 + 10*log10(rms(echo_sig3)^2) % echo strength prior to the receiver pre-amp %30 + 10*log10(rms(r1i_e_no_window)^2) % echo strength prior to the low pass filter

Transmitter_Radiator2.m

%% Mark Fessia %% ECE Grad Project %% Transmitter and Radiator Modeling

%% Description: Simulates the transmitter and radiator components of the radar system %% using the modelled (cantenna) antenna parameters and VCO baseband waveform.

% The signal will be approx. 13 dbm prior to the antenna %transmitter = phased.Transmitter('PeakPower',0.001,'Gain',13); % old transmitter = phased.Transmitter('PeakPower',0.0224,'Gain',13.5);

% Create a radiator object that takes into account the antenna pattern radiator = phased.Radiator('Sensor',cantenna,...

'PropagationSpeed',physconst('LightSpeed'),'OperatingFrequency',2.4e9,. .. 'SensorGainMeasure','dBi');

% Create the receiving collector which takes into account the receive % antenna pattern. This object will also work for modeling the % cross-coupling between antennas since the far-field begins at % (2D^2)/lambda far_field_begins = (2*0.099^2)/(3e8/2.4e9); collector = phased.Collector('Sensor',cantenna,... 'PropagationSpeed',physconst('LightSpeed'),'Wavefront','Plane',... 'OperatingFrequency',2.4e9,'SensorGainMeasure','dBi');

104

VCO.m

%% Mark Fessia %% ECE Grad Project %% VCO Signal Details

%% Description: This receives input from the modulator, and produces the output waveform. clear vco; vco.qfreq = 2.2574e9; % model the ZX95-2536C+ as closely as possible vco.v_hz = 74.66e6; vco.min_freq = vco.qfreq + modulator.min_voltage*vco.v_hz; vco.max_freq = vco.qfreq + modulator.max_voltage*vco.v_hz; vco.bw = vco.max_freq - vco.min_freq; vco.n = modulator.n; vco.fs = modulator.fs; vco.time = modulator.time; vco.avg_freq = (vco.min_freq+vco.max_freq)/2; vco.freq = vco.qfreq + modulator.signal.*vco.v_hz;

% power output at this frequency is approx. 5.69 dBm % this is 0.0037 watts, or 3.7 mW % thus to output the correct power, solve for % amplitude -> (A^2)/2 = 0.0037 % A = 0.0861 figure; plot(vco.time.*1e3,vco.freq./1e9); title('VCO Output Signal'); xlabel('Time (\mus)'); ylabel('Frequency (GHz)'); grid on

vco.object = comm.DiscreteTimeVCO('OutputAmplitude',0.0861,... 'QuiescentFrequency',vco.qfreq,... 'Sensitivity',vco.v_hz,... 'InitialPhase',0,... 'SampleRate',vco.fs); vco.signal = zeros(1,length(modulator.signal)); for j=1:length(modulator.signal) %vco.signal(j) = step(vco.object,modulator.signal(j)); vco.signal(j) = vco.object(modulator.signal(j)); if mod(j,1e6) == 0 disp(['vco signal ',num2str((j/length(modulator.signal))*100)]); end end clear j; vco.IQ = hilbert(vco.signal);

105

%vco.phase_noise = comm.PhaseNoise([-76,-105,-128,- 148],[1e3,10e3,100e3,1e6],6e9); vco.phase_noise = comm.PhaseNoise(-76,1e3,6e9); vco.signal_and_noise = zeros(1,length(vco.IQ)); for j=1:length(vco.IQ) vco.signal_and_noise(j) = vco.phase_noise(vco.IQ(j)); if mod(j,1e6) == 0 disp(['phase noise ',num2str((j/length(vco.IQ))*100)]); end end figure;

% calculate number of samples necessary for a good fft read n = 19*1024*1024; freq = linspace(-3e9,3e9,n); xdft = fftshift(fft(real(vco.signal_and_noise),n)); psdx = (1/(vco.fs*n)) * 2.*(abs(xdft).^2); % <- multiply by 2 when looking at one side psdx = 10.*log10(psdx); freq = freq((end/2):end); psdx = psdx((end/2):end); plot(freq,psdx); title('Power Spectral Density of VCO FM Signal'); xlabel('Frequency (Hz)') ylabel('Power/Frequency (dB/Hz)') grid on

VCO2.m

%% Mark Fessia %% ECE Grad Project %% VCO Signal Modeling

%% Description: This produces the output waveform using the phased array toolbox %% and modelled using the VCO properties of real-world components clear vco; clear vco2; if exist('vco2_1_data.mat','file') load('vco2_1_data.mat') else

106 vco = phased.FMCWWaveform('SweepBandwidth',vco_stats.bw,...

'SampleRate',modulator.fs,'SweepDirection','Triangle','NumSamples',leng th(modulator.n),...

'SweepTime',modulator.inc_duration,'SweepInterval','Positive','OutputFo rmat','Samples');

% SweepBandwidth is the bandwidth of the sweep % The SweepTime is the time it takes for an increase % from min freq. to max. freq. Since this is a triangle % (increasing then decreasing freq.). The total time for one % period is SweepTime*2. The total time of this % waveform is (1/SampleRate)*NumSamples. And the number of full % periods is (1/SampleRate)*NumSamples / (SweepTime*2)

% create the baseband FMCW waveform vco2.baseband = vco();

% scale the signal to the approx. amplitude of the real signal vco2.baseband_scaled = vco2.baseband.*(0.0861*db2mag(-3));

% add phase noise as appropriate given the spec sheets vco2.phase_noise = comm.PhaseNoise(-76,1e3,6e9); vco2.baseband_and_noise = zeros(1,length(vco2.baseband));

for j=2:length(vco2.baseband_scaled) vco2.baseband_and_noise(j) = vco2.phase_noise(vco2.baseband_scaled(j)); if mod(j,1e6) == 0 disp(['phase noise ',num2str((j/length(vco2.baseband_scaled))*100)]); end end n = 19*1024*1024; freq = linspace(-3e9,3e9,n); xdft = fftshift(fft(real(vco2.baseband_and_noise).*(1/.7071),n)); psdx = (1/(modulator.fs*n)) * 2.*(abs(xdft).^2); % <- multiply by 2 when looking at one side psdx = 10.*log10(psdx); freq = freq((end/2):end); psdx = psdx((end/2):end); plot(freq,psdx); title('Power Spectral Density of Baseband VCO FM Signal'); xlabel('Frequency (Hz)') ylabel('Power/Frequency (dB/Hz)') grid on end

107