<<

LiU-ITN-TEK-A--18/015--SE

Analysis of angular accuracy in the IFF Monopulse receiver Filip Bengtsson David Sköld

2018-06-08

Department of Science and Technology Institutionen för teknik och naturvetenskap Linköping University Linköpings universitet nedewS ,gnipökrroN 47 106-ES 47 ,gnipökrroN nedewS 106 47 gnipökrroN LiU-ITN-TEK-A--18/015--SE

Analysis of angular accuracy in the IFF Monopulse receiver Examensarbete utfört i Elektroteknik vid Tekniska högskolan vid Linköpings universitet Filip Bengtsson David Sköld

Handledare Anna Lombardi Examinator Adriana Serban

Norrköping 2018-06-08 Upphovsrätt

Detta dokument hålls tillgängligt på Internet – eller dess framtida ersättare – under en längre tid från publiceringsdatum under förutsättning att inga extra- ordinära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervisning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säkerheten och tillgängligheten finns det lösningar av teknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sammanhang som är kränkande för upphovsmannens litterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida http://www.ep.liu.se/

Copyright

The publishers will keep this document online on the Internet - or its possible replacement - for a considerable time from the date of publication barring exceptional circumstances. The online availability of the document implies a permanent permission for anyone to read, to download, to print out single copies for your own use and to use it unchanged for any non-commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional on the consent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping University Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its WWW home page: http://www.ep.liu.se/

© Filip Bengtsson, David Sköld Abstract

This master thesis investigates how certain components error margin may affect the accuracy of a IFF monopulse receiver. The IFF monopulse receiver measures the angle of arrival of the incident signal by comparing sum and difference signals created in the receiver. The components of interest are phase shifters and attenuators, where both can give individual and different errors depending on the steering angle.

The project is conducted at Saab Aeronautics, based on a receiver in development for the Gripen E aircraft. A model of the receiver was made as close as possible for an ideal case using the program Matlab Simulink. The model is an ideal model based on component characteristics coded with function blocks, based on theory. Simulated measurements of the antenna pattern and the values of look-up tables for the existing receiver have been provided for comparison. Further, the ideal model is compared with the non-ideal model where the components have their errors enabled.

Although the simulation environment Simulink may not be ideal for simulations of this type of system, the results of the thesis generated results showing that the angular accuracy decreases with the increase of steering angle. The angular deviation can for some cases be seen as sufficiently small for the receiver to work properly in the ideal case.

i

Acknowledgments

We would like to thank our supervisor at Saab, Mikael Håkansson Borg, for his feedback and support throughout this thesis. Also, we would like to thank other colleagues at Saab for their technical support and for welcoming us to the office.

We would also like to thank both our supervisor, Anna Lombardi, and our examiner, Adriana Serban, at Linköpings University for their feedback on the report and for their encouragement.

David Sköld and Filip Bengtsson Norrköping, June 20, 2018

iii Contents

Contents iv

List of Figures vi

List of Tables viii

Abbreviations and acronyms ix

Symbols xi

1 Introduction 1 1.1 Background ...... 1 1.2 Motivation ...... 1 1.3 Aim...... 2 1.4 Research questions ...... 2 1.5 Method ...... 2 1.6 Delimitations ...... 3 1.7 Outline of the thesis ...... 3

2 technology 5 2.1 Antennas ...... 5 2.2 Secondary Surveillance Radar ...... 10 2.3 Signals ...... 10 2.4 Monopulse SSR ...... 14 2.5 Identification Friend or Foe ...... 15 2.6 IFF monopulse antenna ...... 16 2.7 Single pulse detection ...... 17 2.8 System design ...... 17 2.9 Errors ...... 21

3 Signal model 23 3.1 System design ...... 23 3.2 Signal ...... 24

4 Receiver model 35 4.1 Receiver system ...... 35 4.2 Transmit receive unit ...... 36 4.3 Low-noise amplifier ...... 39 4.4 Phase shifter ...... 39 4.5 Attenuator ...... 42 4.6 Random error generator ...... 44 4.7 Wilkinson power divider ...... 45 ˝ 4.8 The 180 hybrid coupler ...... 46

iv 4.9 Diff/Sum ratio ...... 47

5 Data management 49 5.1 Simulink to Matlab file ...... 49 5.2 Matlab file to graph ...... 50

6 Simulation results and discussion 55 6.1 Scenario ...... 55 6.2 System ...... 56 6.3 Input signals and parameters ...... 56 6.4 Signal modulation ...... 56 6.5 Transmit receive unit ...... 57 6.6 Couplers ...... 58 6.7 Model validation ...... 59 6.8 Ideal antenna pattern ...... 59 ˝ 6.9 Steer 0 ...... 60 ˝ 6.10 Steer 10 ...... 67 ˝ 6.11 Steer 20 ...... 69 ˝ 6.12 Steer 30 ...... 70 ˝ 6.13 Steer 40 ...... 72 ˝ 6.14 Steer 50 ...... 74 6.15 Comparison ...... 75

7 Conclusion and future work 79 7.1 Conclusion ...... 79 7.2 Future work ...... 80

Bibliography 81

Webography 83

Appendices A Simulink blocks ...... B Matlab code ......

v List of Figures

2.1 (a) polar diagram. (b) Radiation pattern rectangular diagram. . . 6 2.2 Radiation pattern example for broadside linear array with different elements. . . . 7 2.3 Incident wave with angle of arrival θ...... 8 2.4 antenna operation principle...... 9 2.5 Radar operation principle...... 10 2.6 Illustration of the interrogation signal...... 11 2.7 Illustration of the reply signal...... 12 2.8 Illustration of the sliding-window method...... 13 2.9 The beam pattern of the monopulse SSR...... 14 2.10 Top of the beam pattern of the monopulse SSR...... 15 2.11 Interrogate and control beam patterns...... 18 ˝ 2.12 The 180 hybrid coupler...... 19

3.1 Conceptual image of the system...... 23 3.2 The entire system in Simulink...... 24 3.3 The SBB system...... 25 3.4 Inside the SBB system...... 25 3.5 The propagation block...... 26 3.6 The configuration of the propagation system...... 26 3.7 The relative speed function block...... 27 3.8 The Doppler function block...... 28 3.9 The Friis function block...... 29 3.10 The distance calculation function block...... 29 3.11 The effective area function block...... 30 3.12 Input_signal subsystem of the SBB...... 31 3.13 Inside the Input_signal subsystem of the SBB...... 31 3.14 The phase calculation block...... 32 3.15 The phase calculation function block...... 32 3.16 Phase shifter block in the SBB subsystem...... 34 3.17 Phase shifter function in the SBB subsystem...... 34

4.1 Conceptual block model of the receiver...... 35 4.2 Receiver system block...... 36 4.3 Inside receiver system subsystem...... 36 4.4 TRU block...... 36 4.5 Inside the TRU block...... 37 4.6 The steer calculation function...... 37 4.7 The RF module block...... 38 4.8 The subsystems of the RF module block...... 38 4.9 The LNA block...... 39 4.10 Inside the LNA block...... 39 4.11 The phase shifter block...... 40

vi 4.12 Inside the phase shifter block...... 40 4.13 The steer function block...... 41 4.14 The state generator function block...... 42 4.15 The attenuator block ...... 43 4.16 Inside the attenuator block...... 43 4.17 The attenuator function ...... 43 4.18 The Random Matlab function block...... 44 4.19 The WPD block...... 45 4.20 The WPD function...... 45 4.21 The rat-race block...... 46 4.22 Rat-race function...... 46 4.23 Ratio calculation block...... 47 4.24 Inside the ratio calculation block...... 47

5.1 The to_matfile function...... 49

6.1 The received signal at one antenna element...... 56 6.2 The phase shifted signal...... 57 6.3 The attenuated signal...... 58 6.4 The sum and difference signal...... 58 6.5 Antenna pattern of the ideal system...... 59 6.6 Sum diff ratio of ideal the system...... 60 6.7 Sum diff signals with phase shifter error enabled...... 61 6.8 Sum diff signals with attenuation error enabled...... 61 6.9 Sum diff signals with attenuator and phase shifter error enabled...... 62 ˝ 6.10 Ratio with attenuator error for steer 0 ...... 63 ˝ 6.11 Ratio with phase shifter error for steer 0 ...... 63 ˝ 6.12 Ratio with attenuator error for steer 0 ...... 64 ˝ 6.13 Ratio with attenuator and phase shifter error for steer 0 ...... 64 ˝ 6.14 Ratio deviation for steer 0 ...... 65 ˝ 6.15 Maximum, minimum and ideal ratio for steer 0 ...... 66 ˝ 6.16 Max and min angle deviation for steer 0 ...... 66 ˝ 6.17 Sum and difference with attenuator and phase shifter error enabled for steer 10 . . 67 ˝ 6.18 Ratio with attenuator and phase shifter error for steer 10 ...... 68 ˝ 6.19 Max and min angular deviation with both errors enabled for steer 10 ...... 68 ˝ 6.20 Sum and difference with attenuator and phase shifter error enabled for steer 20 . . 69 ˝ 6.21 Ratio with attenuator and phase shifter error for steer 20 ...... 69 ˝ 6.22 Max and min angular deviation with both errors enabled for steer 20 ...... 70 ˝ 6.23 Sum and difference pattern with attenuator and phase shifter error for 30 steer. . 71 ˝ 6.24 Ratio with both attenuator and phase shifter error for 30 steer...... 71 ˝ 6.25 Max and min angular deviation with both errors enabled for steer 30 ...... 72 ˝ 6.26 Sum difference pattern with attenuator and phase shifter error for 40 steer. . . . . 72 ˝ 6.27 Ratio with attenuator and phase shifter for 40 steer...... 73 ˝ 6.28 Maximum and minimum angular deviation with both errors enabled for steer 40 . 73 ˝ 6.29 Sum difference pattern with attenuator and phase shifter error for 50 steer. . . . . 74 ˝ 6.30 Ratio with attenuator and phase shifter for 50 steer...... 74 ˝ 6.31 Max and min angular deviation with both errors enabled for steer 50 ...... 75 6.32 Angular deviation for all the different steering angles with attenuator error enabled. 76 6.33 Angular deviation for all the different steering angles with phase shifter error en- abled...... 76 6.34 Ideal ratio for different steer...... 77 6.35 Angular deviation for all the different steering angles with both errors enabled. . . 77

vii List of Tables

2.1 Interrogation modes for SSR...... 11

4.1 Maximum phase variance...... 40

viii Abbreviations and acronyms

Abbreviation Description

IFF Identification Friend or Foe SSR Secondary Surveillance Radar AoA Angle-of-Arrival ESA Electrically Scanned System AESA Active Electrically Scanned System ATC Air Traffic Control MSSR Monopulse Secondary Surveillance Radar SLS Suppression SPI Special Position Pulse FRUIT False Replies Unsynchronized In Time LNA Low-Noise Amplifier NF Noise Figure ISLS Interrogation Side Lobe Suppression WPD Wilkinson Power Divider TRU Transmit Receive Unit SBB Signal Black Box DSP Digital Signal Processing

ix

Symbols

Notation Description

D U Ratio Ptot Total power transmitted Ae λ Wavelength N Number of antenna elements ∆ϕ Phase difference n Number of the antenna element x Space difference between antenna elements AF Array factor wi Weight factor k Wavenumber θ Angle deviation vp Speed of the signal c Speed of light R Distance from target ttravel Travel time for wave Pr Power received Pt Power transmitted Gr Gain of receiving antenna Gt Gain of transmitting antenna Ar Antenna aperture of receiving antenna At Antenna aperture of transmitting antenna σ Antenna cross-section d Distance between antennas fd Doppler frequency fs Signal frequency V0 Velocity of observer Vw Velocity of signal Vr Radial velocity L Losses S Scattering parameter ∆ Difference signal Σ Sum signal Fi Noise factor Gi Gain Si Signal

xi

Chapter One

Introduction

This master thesis investigates how certain components error margin may affect the accuracy of the new IFF monopulse receiver for Gripen E. The project was done as a Master thesis at the Electronic Design Engineering program at Linköpings University provided by Saab Aeronautics in Linköping, Sweden.

1.1 Background

Saab is currently developing the new JAS 39E Gripen. This new aircraft will use a new type of Monopulse IFF radar which is electronically controlled instead of mechanically controlled. The project will analyze and validate data of different parameters for this radar.

Aeronautics, a business area of Saab offers advanced airborne systems, related subsystems, unmanned aerial systems, aerostructures and services to defense customers and commercial aerospace industries, worldwide. Aeronautics is also responsible for development, produc- tion, marketing, selling and supporting of the Gripen fighter.

The section Radar and IFF (Identification, Friend or Foe) works with integration of to- day’s and future radar and IFF systems. This work will be a part of the tactical systems area who develops functions in the fields of communication and data links, target acquisition, electronic warfare, navigation, reconnaissance and decision support.

1.2 Motivation

Identification of aircrafts is important for both daily travel and for military purposes. To identify an aircraft, a radar could be used and the aircraft could be contacted through to request identification and purpose. However, this solution requires a lot of manpower and has been replaced by a Secondary Surveillance Radar (SSR) which handles the described problem. This system contacts the aircraft, requests information and processes the answer, which can be presented in a manageable way for the operators. SSR can in some cases also determine where the aircraft is sending its reply from, effectively producing a more or less reliable map of where nearby aircrafts are. Depending on how accurate the position data is, more aircrafts can be directed in a finite area with less risk for accidents to happen.

This project evaluates a new model of a SSR system to determine the angular accuracy of the system. The project is conducted at Saab Aeronautics in Linköping, Sweden.

1 1. INTRODUCTION

1.3 Aim

The goal of this work is to analyze and calculate the angular accuracy and uncertainty of the IFF receiver system developed for Gripen E.

A monopulse IFF receiver system determines the “angle-of-arrival” (AoA) of a transpon- der reply by comparing the reply amplitude in different antenna lobes; the main and control lobe. In an Electrically Scanned Array (ESA) the lobe characteristics change depending on the desired steering angle.

The scope of the work is to identify parameters that have an impact on the accuracy of the measured AoA within the antenna system and receiver system and to evaluate the per- formance of the system. The goal is to present a model of how much the measured value differs from the true AoA. What this project is designed to achieve is the following:

1. Model the receiver system in software, taking into consideration as many relevant vari- ables as possible.

2. Acquire data from the system for the nominal case and the non nominal case.

3. By comparing the different cases, angular dependency will be analyzed and evaluated.

4. Summarize and present the results of the analysis.

1.4 Research questions

The main questions of the project are presented here and will be answered in the conclusion. Although there are several more questions that undoubtedly will be of interest to the master thesis, these were the questions that guided this project.

1. At what accuracy can this specific system measure the angle of arrival of a signal?

2. Which factors is the accuracy most dependent on?

3. How close is this theoretical system to the real system?

1.5 Method

The work will be separated into stages that will be evaluated in Chapter 6. The theory will be presented in Chapter 2 to get a good understanding of the technology used in the system. This chapter includes a background study for similar projects and old work. It is mostly the understanding of microwave theory, the secondary surveillance radar and how to model it using mathematic equations that are of importance.

A model will show a system of the radar which will be analyzed. This will give an un- derstanding of how this specific radar system works, which parameters are unique to it and which parameters could be changed for testing. The model will be presented in Chapters 3, 4 and 5. All the different components and contributing factors will be identified to make sure the model which is created in a later stage will be as similar to the real system as possible. In this part it is important to consider how each and every part of the system affects the signal for the next stage to be as successful as possible.

Simulation results can be analyzed and used to evaluate the radar system in the softwares

2 1.6. Delimitations

Matlab and Simulink. The purpose is to make the model as close to the real system as pos- sible and trying to include as many variables as possible. The model will be simulated with various settings and parameters to extract data which will reveal e.g., angular dependency.

The data from the simulations will be analyzed and processed in a way, were the char- acteristics of the radar system become more visible and easier to understand. The accuracy of the project will be taken into consideration to make a valid conclusion of the results.

1.6 Delimitations

The work will focus on a specific IFF monopulse SSR developed by Saab. The subject of primary surveillance systems will be explained briefly to highlight the differences between this system and the SSR. The results will be published in two different forms:

• One redacted version which will be public and accessible to all.

• One complete version presented only to Saab.

In this project, specific components in the receiver chain have been studied. Therefore, a nominal model of the system has been implemented which does not take into consideration some factors which can affect the performance of the system. For instance, the model has no noise implemented. The low noise amplifiers have no gain errors implemented, instead the attenuators have errors in gain, and the attenuator is variable making its impact more interesting in the model.

Some of the theory explained is not applicable in the final model since the use of isotropic antenna elements. However, all the theory discussed has been implemented at some stage of the system and is kept by the authors to be used for future work. This is not included in this thesis.

1.7 Outline of the thesis

Chapter 2 explains theory of the radar technology and the signals in the system. This includes the Identical Friend or Foe theory and system design.

Chapter 3 describes the signal model.

Chapter 4 describes the hardware part of the receiver model.

Chapter 5 describes how the model data is processed.

Chapter 6 shows the results of the simulations and calculations of the model. It will also evaluate the result as it is presented.

Chapter 7 concludes the entire project.

3

Chapter Two

Radar technology

This Section will explain the theory behind radar technology. At first, antennas antenna array and antenna parameters are introduced. Then, the primary radar operation principle is explained. After this, the Secondary Surveillance Radar (SSR), monopulse SSR and Identifi- cation Friend or Foe (IFF) technology are introduced. Also, signals, radar equation, Doppler effect and system design aspects are shortly presented in this chapter.

The word radar is an abbreviation for radio detection and ranging. The concept of radar is not a new one, the technology has been used since at least the beginning of the 19th century and later improved and developed to be applicable to different situations. In most cases, radar systems use modulated waveforms and directive antennas to transmit electromagnetic energy into a specific volume in space to search for targets. Objects within a search volume will reflect portions of the incident energy in the direction of the radar. These echoes are then processed by the radar receiver to extract target information such as range, velocity, angular position, and other target identifying characteristics [16].

Radars can be located in different places and can be classified as ground-based, airborne, space borne, or ship-based radar systems. These can be separated into numerous categories based on the radar characteristics, such as the frequency band, antenna type, and wave- forms. Radar systems using continuous waveforms, modulated or otherwise, are classified as continuous wave . Radar systems using time-limited pulsed waveforms are clas- sified as Pulsed Radars. Another radar systems classification are with the mission and the functionality of the specific radar. This includes: weather, acquisition and search, tracking, track-while-scan, fire control, early warning, over-the-horizon, terrain following, and terrain avoidance radars [16].

There are different types of radar available today for applicable in aeronautics, the two main categories are primary surveillance radar and secondary surveillance radar, SSR.

2.1 Antennas

Antennas are used to transmit and receive electromagnetic pulses traveling through the air. Antennas come in all different sizes and forms, which affect their performance. All antennas however can be operated in two modes: transmitting and receiving. Antennas have the useful property of reciprocity which states that an antenna transmits and receives signals in the same radiation pattern.

When transmitting, an antenna is fed with a signal which radiates electromagnetic waves when propagating through the conducting antenna element. Depending on the phase, fre- quency and amplitude of the signal as well as the characteristics of the antenna, the signal

5 2. RADARTECHNOLOGY will radiate from the antenna according to a radiation pattern. An arbitrary radiation pattern is shown in Figure 2.1.

Figure 2.1: (a) Radiation pattern polar diagram. (b) Radiation pattern rectangular diagram [5].

Antenna radiation patterns represent graphically radiation properties such as electric field and magnetic field magnitude or radiated power as a function of direction. In Figure 2.1, the pattern is represented in polar coordinates. In both graphs, the patterns are shown with normalized dB scale. Hence, 0 dB corresponds to a normalized value of 1, e.g., the power is maximum power value for that direction [13].

Directivity is a measure of the degree to which the radiation that is emitted is concen- trated in a single direction and is an important property of the antenna. The directivity is calculated as in (2.1) where U is the maximum radiation intensity in the main beam and Ptot is the total power transmitted [2], [13].

U D = (2.1) Ptot 4π The antenna aperture, also called effective area and receiving cross-section, is a measure of how effectively an antenna can receive power. In the case of an isotropic antenna it can be expressed as in (2.2), where Ae is antenna aperture and λ is wavelength. Antenna aperture can be used to calculate the and is used in the Friis transmission equation which will be explained in Section 2.3.1 [13].

λ2 A = (2.2) e 4π

6 2.1. Antennas

Antenna arrays Antenna arrays can be used to create different antenna patterns, achieve higher gain and directivity. The antenna array used in this project is a broadside linear array with N elements and distance d between the elements. A broadside linear array is a one dimensional linear array with the directed perpendicular to the antenna plane. An illustration of a broadside linear array can be seen in Figure 2.4. The number of elements in the array affects the radiation pattern and with more elements comes a narrower beamwidth for the main lobe, as illustrated in Figure 2.2 [2].

Figure 2.2: Radiation pattern example for broadside linear array with different elements [7].

In Figure 2.2, the three different lines shows the radiation pattern for different number of antenna elements in the array. As can be observed, the beamwidth of the main lobe reduces with the increase antenna elements and the damping of the sidelobes increases. Also, the number of antenna elements affect the gain of the main lobe. It is therefore common in complex military systems to use a lot of antenna elements to achieve a high gain and narrow beam. This reduces interferences and increases the range of the antenna array. The power of the incident signal is equally divided between the antenna elements, e.g., if there are two antenna elements, they receive half of the power, each.

When using an antenna array, the distance between the antenna elements creates both phase delays (∆ϕ) and amplitude differences in the signals received by antenna elements in the array. The amplitude difference is explained by the losses in power as the wave prop- agates, and it is mathematically quantified in Friis transmission equation, see Section 2.3.1. The phase difference is the phase delay that every signal acquires when propagating. For example, in Figure 2.3, there is a phase delay in the signal received by Antenna 2 due to the extra distance, ∆x, it needs to travel.

If the antennas are identical, isotropic antennas, then the ideal phase delay between Antenna 1 and Antenna 2 in Figure 2.3 is given by (2.3).

2π array 2π φ(t)= k∆x = x sin θ = nx sin θ (2.3) λ ÝÝÝÑ λ

2π Where k is the propagation constant or wave factor, k = λ and λ is the wavelength.

7 2. RADARTECHNOLOGY

Figure 2.3: Incident wave with angle of arrival θ.

When antenna array is of interest, a way to express e.g., the total electrical field of the array is by assuming that the total field is equal with the field of one single antenna element positioned in the origin multiplied by the array factor, AF.

The array factor is an important factor for optimizing the functionality of antenna arrays. It is an equation of the positions of the antenna elements and a weight factor. The array factor, AF, can be calculated using (2.4).

´ jkri AF = wie (2.4) In (2.4) the variable k is a wave vector whichÿ describes the phase variation of a plane wave in x, y and z directions. It can be expressed as in (2.5).

2π k =(k , k , k )= (sin θ cos φ, sin θ sin φ, cos θ) (2.5) x y z λ

The r variable in (2.4) refers to the position of the antenna element as ri = (xi, yi, zi). The weight factor can be interpreted as a complex amplitude which can be represented with phase shifters and amplifiers in the system to apply which will be explained further.

Active electronically scanned array An active electronically scanned array (AESA) is a type of phased array. A phased array is an antenna array which can be electronically controlled to steer the radiation in different directions without rotating the antenna array. This is widely used within radar systems and is achieved by introducing phase shifters to every antenna element. The phase shifters are controlled by a computer system which calculates the required phase shift to steer the radiation to the specified angle. This is illustrated in Figure 2.4.

The phase shifters create a phase delay which creates a delay in radiation from the antenna elements, just as the phase delay due to the distance between antenna elements discussed in the previous section. E.g., for Figure 2.4, if the desired angle of radiation is θ = 20°, the wavelength is 20 cm and the distance between elements is half the wavelength. Then the antenna element at the top must radiate without phase delay; then the phase delay which is applied for certain beam steering is calculated using (2.3). ∆φ = 2π 1 0.1 sin 20° yields the 0.2 ¨ ¨ ¨

8 2.1. Antennas

Figure 2.4: Phased array antenna operation principle [19]. phase delay ∆φ = 61.56° which is added to the closest antenna element. Then, this phase delay is incremented for each antenna element further away from the top element, this is done by incrementing n in (2.3).

What separates AESA from other phased arrays is that it has a transmit/receive module for each antenna element instead of just one. This allows the AESA to radiate multiple beams at different frequencies, making it more difficult to detect the radar system.

2.1.1 Primary radar The model of the radar system as described at the beginning of Section 2.1 is called primary radar. To determine the range to an object, a strong electromagnetic signal in the form of a pulse is transmitted by the antenna. The reflected signal is then received by the radar device and the range can be calculated from the time between the transmission of the signal and the time at which the reflected signal was received. This time is twice the time it took for the signal to travel to the object, meaning that if the signals speed is known, then the distance to the object is also known. A simple radar illustration is shown in Figure 2.5. Since the speed of the signal in air is the same as the speed of light in vacuum, the distance to the object can be calculated with (2.6).

t Air : v = c 2 R = t c R = travel c (2.6) p Ñ ¨ travel ¨ Ñ 2 Using a rotating antenna, the surroundings of the antenna can be scanned. For example, the direction of an aircraft can be deduced from the direction of the radar antenna when the signal is received. However, this points out one of the weakness of the primary radar, i.e., any object that can reflect enough signal power will be picked up by the radar. The distance to the object the signal reflected of is given by the radar equation:

2 2 4 PtG λ σ R = 3 (2.7) d Pr(4π)

9 2. RADARTECHNOLOGY

Figure 2.5: Radar operation principle [8].

In (2.7) G is the gain of the transmitting antenna, Pt is the power being transmitted, R is the distance between the radar and the object, σ is the antenna cross-section and Pr is the power received.

2.2 Secondary Surveillance Radar

A Secondary Surveillance Radar (SSR), used in air traffic control (ATC), sends out an electro- magnetic pulse towards a target. But in this case the transmitting radar also encodes some data. Instead of being reflected by the aircraft, the signal is received by the aircraft via a transponder. The transponder then replies to the SSR in a different frequency. Therefore the energy required is less, than of the primary radar since the SSR is not dependent on a reflected response which needs to be sufficiently strong to identify. The SSR relies on targets with a radar transponder equipped on the aircraft.

The to receiver system is called an "interrogator". The interrogator requests information from the aircraft such as identity and height. The aircraft transponder then answers by sending the requested information, simply called a "reply". This is one of the main advantages of a SSR compared to the primary radar, the communication between the aircrafts to relay additional information. Also, the power and size of the radar can be signif- icantly reduced and still cover long ranges, making it more cost effective. What often limits the range of a SSR system placed on the ground is the screening of the target by the horizon. The range increases with the height of the antenna and the height of the aircraft which results in (2.8) where ha and ht is the height of the antenna and the aircraft [6].

1 1 2 2 R = 1.23(ha + ht ) (2.8)

In the equation presented above, a "four-thirds earth" is assumed. This is a common assump- 4 tion in radar calculations were the earth radius Re is replaced by the factor kRe with k = 3 to compensate for the attenuation by the atmosphere for higher frequencies [18].

2.3 Signals

The signal transmitted by the interrogator and the reply are at two different frequencies. Typically, the interrogator transmits at 1090 MHz and the reply is at 1030 MHz. By having two different frequencies some of the problems experienced by the primary radar can be avoided, e.g., the reflected interrogator signal will not be confused with a response from the aircraft.

10 2.3. Signals

Interrogation can be done in different modes depending on what information is required from the aircraft and who is using the SSR system. The interrogation signal consists of 3 pulses named P1, P2 and P3. The spacing of the two main beams, the pulses P1 and P3, determine what interrogating mode is used. The different modes are presented in Table 2.1, where the spacing for different modes are specified [6].

Table 2.1: Interrogation modes for SSR. Mode Purpose User P1-P3 pulse spacing in micro S 3/A Identity Military/Civil 8 B Undefined Civil 17 C Altitude Civil 21 D Undefined Civil 25 S Multipurpose Civil 3.5

When used by the military, the SSR distinguishes a friendly aircraft from an enemy aircraft, naming the process Identify Friend or Foe (IFF). There are more modes than what is dis- played in Table 2.1 that are in use by the military, but these are the most common ones. Other modes include more combat specified functions such as encryption of replies.

The second pulse named P2 is radiated from the control beam and has a lower amplitude. This allows the aircraft transponder to compare the pulses P1 and P2 to determine if the signal received originates from the main or side lobe to determine if a response is necessary. By doing this evaluation of the signal, the transponder can minimize the risk of responding several times causing errors in the identification process. This is known as interrogator side lobe suppression (SLS). Combining these three pulses, the form of the interrogator signal can be illustrated as in Figure 2.6 [6].

Figure 2.6: Illustration of the interrogation signal [6].

This simple signal is enough to request different forms of information from aircrafts. The reply signal is a bit more complex since it contains more information, it needs a total of 16 pulses in the following way: two framing pulses to mark the start and end of transmission, twelve data pulses giving a total of 4096 permutations, one pulse named x which remains unused and a Special Position Pulse (SPI), which is only used when the ATC requests it for further identification.

11 2. RADARTECHNOLOGY

Figure 2.7: Illustration of the reply signal [21].

In Figure 2.7, the data pulses, named A, B, C and D with suffixes 1, 2 and 4, are framed by the framing pulses F1 and F2. The figure also illustrates the following time specifications:

• Pulse duration: 0.45 µs 0.1 µs ˘ • Duration between pulses: 1 µs 0.1 µs ˘ • Time from F to F : 20.3 µs 0.1 µs 1 2 ˘ • Delay from pulse F to the SPI pulse: 4.35 µs 0.1 µs 2 ˘ Depending on the mode of communication, not all 4096 codes are used, e.g., mode C does not use the D1 pulse which leaves it with 2048 codes. The military mode S uses 24 bits, which allows for 16 million permutations [12], [21].

To relay height information, mode C is most commonly used and, as mentioned earlier, it has 2048 permutations which are used to indicate the height according to the aneroid barometer. These 2048 permutations are sufficient to indicate the height in 100 ft increment in the range of -1000 ft to +121000 ft.

Since the SSR system relies on a response of the airborne transponder, it cannot deter- mine the direction of the airplane in the same way as the primary radar, by receiving the reflected signal. Instead the SSR system uses a method called the "sliding-window" which determines the direction of the airplane by monitoring when communication starts and stops with the aircraft. Replies from the aircraft are received by the antenna when the leading edge of the rotating antenna points towards the direction of the aircraft and the antenna stops receiving when the trailing edge of the antenna passes it. The average from these two positions reveals the direction of the antenna. The sliding-window method is illustrated in Figure 2.8 [6].

A problem that is present in this system is due to continuous communication. Since a large amount of replies are being requested from the transponder it presents a problem for the transponder, which can handle a finite amount of signals during a period of time. The ground station also receives replies which have been requested by other SSR systems, these replies are called false replies unsynchronized in time (FRUIT). Fruit signals can affect the accuracy of the direction measurements since the signals can overlap, which confuses the equipment and can create phantom aircrafts [6].

A more advanced type of SSR is the Monopulse SSR which will be discussed in Section 2.4.

12 2.3. Signals

Figure 2.8: Illustration of the sliding-window method [6].

2.3.1 Friis Transmission equation To calculate the power received at each antenna terminal of the receiving antenna elements, the Friis transmission equation (2.9) can be used. This equation uses the ideal case of free space transmission. The equation depends on the transmitted power, the distance between the transmitting antenna and the receiving antenna, the wavelength and the gain of the an- tennas [13]. 2 GtGrλ Pr = Pt (2.9) (4π)2R2

2.3.2 Doppler effect The Doppler effect describes how the frequency of a signal can be affected for an observer, by the movement of the source of the signal. For example, if the source moves towards the observer the frequency is higher than it would have been if the source was moving away from the observer. The relation between speed and frequency can be seen as in the equation for the Doppler frequency in (2.10).

Vo fd = fs (1 ) (2.10) ¨ ˘ Vw

In (2.10), fd is the Doppler frequency, fs is the transmitted signal frequency, Vo is the observer velocity relative to the source and Vw is the velocity of the signal, which is the speed of light in vacuum. This is the case when a stationary source is used and the part would be positive ˘ if moving towards the source and negative if moving away from the source. If instead the observer was stationary the equation would change to that in (2.11). Where Vs is the velocity of the source relative to the observer

Vw fd = fs (1 ) (2.11) ¨ ˘ Vs Combining (2.10) and (2.11), the frequency that the observer detects can be found when both the source and observer are moving. This is given in (2.12).

1 Vo c V ˘ c o fd = fs ( V )= fs ˘ (2.12) ¨ 1 s ¨ c Vs ˘ c ˘

13 2. RADARTECHNOLOGY

The in the numerator is positive when the observer is moving towards the source and ˘ negative when moving away from the source. The in the denominator is positive when ˘ moving away from the source and negative when moving towards the source. This results in the frequency which is observed by the observer is greater when observer and source are moving towards each other. The velocity of the observer in (2.10) and (2.11) are relative to the source and the velocity of the source is relative to the observer. This implies that the radial velocity is to be used in (2.12).

The radial velocity is the velocity which is proportional to the increase or decrease be- tween the observer and source. Using Cartesian coordinates in a 3D-space, the velocity can be defined as the vector Vt =[VxVyVz] where Vt is the total velocity and the three elements in the vector are the velocities in each dimension. The radial velocity is then defined as in (2.13).

2 2 2 Vr = Vx + Vy + Vz (2.13) b Using this, radars can extract the targets radial velocity using the difference in frequency between the transmitted signal and the received signal. This enables the radar systems to more successfully identify clutter and separate aircrafts flying in proximity of each other. Monopulse antennas can be susceptible to interference from such sources as stationary ob- jects and weather-phenomena.

2.4 Monopulse SSR

The monopulse SSR system uses a single reply to determine the direction of arrival of the signal instead of the sliding-window method. This is made possible by introducing a second beam pattern called the difference beam. The difference beam has a lower gain than the sum beam at boresight and a higher gain at the sidelobes of the sum beam. The beam pattern is shown in Figure 2.9. A more specified figure of the top of the graph in Figure 2.9 is shown in Figure 2.10 [6].

Figure 2.9: The radiation pattern of the monopulse SSR [6].

Seen in Figure 2.10, the notch along the boresight which is important to the functionality of the monopulse SSR. Similar to interferometry technique, the system can determine the angle of arrival (AoA) by comparing the received signal at the sum and difference channels. An

14 2.5. Identification Friend or Foe

Figure 2.10: Top of the radiation pattern of the monopulse SSR [6]. interferometer can be implemented with two or more antennas placed side-by-side which produces a single high-gain beam with low sidelobes. Combined by a 180° hybrid coupler, which will be discussed in Section 2.8.4, the sum output of the ring produces the original high-gain sum beam and the difference output produces the difference beam. With a differ- ence in phase related to the extra distance traveled to the antenna which is the furthest away. The relative phase delay can be calculated using the method described in Section 2.1.

If the incident signal aligns with the antenna boresight, the relative phase difference is zero and the signal on the difference beam is greatly dampened. In an ideal case this would eliminate the signal on the difference channel since there would be total destructive inter- ference. In other cases, the ratio between the sum and difference signals can be analyzed to indicate the incident signals angle of arrival. The receiver in this project uses the L1 process- ing method, therefore all other methods will not be discussed. The L1 processing method uses that the ambiguity is located at the beam center, the phase difference between the sum and difference channels must be analyzed to reveal at which side of the ambiguity point the signal arrives as discussed in Section 2.8.5 [9].

The monopulse SSR is similar to an interferometer. However, one difference is for trans- mission between antenna and receiver the signals are converted to sum and difference beam form. There are two different monopulse processing methods: the amplitude processing and phase processing method. The amplitude processing method compares the amplitude of the sum and difference channel to find the angle of arrival and the phase processing method uses the phase information.

2.5 Identification Friend or Foe

The Identification Friend or Foe (IFF) system is a military and civil system; mainly dedicated to identification. SSR is based on the military IFF technology originally developed during World War II. The system is composed, like SSR, of the two active devices: an interrogating device, interrogator, and a replying device, transponder. The interrogating device sends an interrogation using a carrier frequency in the direction of the object equipped with a transponder. The replying device receives and decodes the interrogation, then, a coded reply is sent on a different carrier frequency. When received by the interrogation device, the reply signal is processed and decoded. The result is presented in a suitable way, for example visually or in the form of digital data. To decode the encrypted data, both systems must use

15 2. RADARTECHNOLOGY the same predetermined encryption which can vary depending on the user. For instance, the encryption used by NATO and the encryption used by Brazil is not the same. If the encryption is the same, the replying object is recognized as a friend. If not, it is treated as an unidentified object or foe [4].

The generation of undesirable replies by a properly working transponder can occur in the following cases: • Interrogations from other interrogators. • Reception of reflected signals, interrogations, from the friendly interrogator, not exceed- ing the receiver dynamic range. • Reception of interrogation from the friendly interrogator, not exceeding the receiver dy- namic range and not responding to Interrogation Side Lobe Suppression (ISLS) criteria. The interrogator and transponder devices are characterized by following parameters. • Transmission frequency • Output power • Sensitivity • Antenna gain • System losses Other parameters are as follows: • Atmospherically attenuation • Free space range

2.6 IFF monopulse antenna

The purpose of the Identification Friend or Foe (IFF) system is to minimize own losses com- ing from friendly fire. The main feature of the system should be high identification and data transmission reliability. The problems with these transmission signals are sidelobe elevation covering characteristics, reflection from field objects known as multipath, replies generated by transponders for other interrogators’ requests.

The secondary search radar’s issue is an important part of radio location technology. In practice, the simplest antenna solutions could not fulfill the severe requirements concerning characteristics of radiation pattern in IFF systems. The solution is the suppression of the sidelobes in the antenna pattern. Two methods that can result in sidelobe suppression. • Monopulse with sidelobes suppression units forming by an addi- tional omni-directional antenna. • Monopulse antenna with sidelobes suppression based on dependencies between sig- nals in both channels sum and difference one. Monopulse antennas are meant to work in short range interrogators which have monopulse pattern in azimuth axis and/or in elevation axis. Short range interrogator devices are in- stalled on self-propelled systems or on naval weapons. The weight and dimension of those interrogators must be minimal, especially in hand-held applications. In mobile systems it is important to assure synchronization of antenna movement with the movement of devices installed on vehicles like anti-aircraft guns or missile launchers. This synchronization can be implemented in different ways, depending on the complexity of the system [10].

16 2.7. Single pulse detection

2.7 Single pulse detection

In its simplest form, a radar signal can be represented by a single pulse comprising a sinu- soid of known amplitude and phase. A returned signal will also comprise a sinusoid. Under the assumption of completely known signal parameters, a returned pulse from a target has known amplitude and known phase with no random components; and the radar signal pro- cessor will attempt to maximize the probability of detection for a given probability of false alarm. In this case, detection is referred to as coherent detection or coherent demodulation. A radar system will declare detection with a certain probability of detection if the received voltage signal envelope exceeds a pre-set threshold value. In this kind of detection, envelope detectors are used [16].

2.8 System design

Given the operation of a SSR, the range R can be calculated from Friis transmission equation (2.14), presented in Section 2.3.1.

λ P G G R = t t r (2.14) 4πd LPr

Where a supplementary factor L was added to model losses in the system. Reciprocally, the received power in a SSR can be written as:

P G G λ P = t t r ( )2 (2.15) r L 4π R ¨ 2.8.1 Dynamic range The dynamic range for the radar is the power ratio between minimum and maximum for the echo signals in close range or of objects from a long distance. If there is a large power difference it will be difficult to process the digital data. It can be described with (2.16), where D is the dynamic range and Pr is the power. P D = rmax (2.16) Prmin The dynamic range is highly sensitive to the radar cross-section σ and the range R, as the other parameters in (2.15) do not vary. Hence, the received power and the dynamic range D can be rewritten as (2.17) and (2.18) [20].

2 PtλG σ σ Pr = = k (2.17) (4π)3R4 R4

4 4 Prmax kσmax/Rmin σmax Rmax D = = 4 = 4 (2.18) Prmin kσmin/Rmax σminRmin

2.8.2 Horizontal characteristics The horizontal characteristics refer to the accuracy of the aircraft bearing measurement, to identify separate aircrafts which are close to each other and minimize the interference of the aircraft replies outside the main beam. The antenna has two different beams in its beam pattern, one interrogate beam and one control beam [6].

17 2. RADARTECHNOLOGY

Interrogate beam An interrogate beam, also called a main beam, has a radiation pattern for the horizontal antenna. The beam has a high-gain and narrow main lobe with low sidelobes. The sidelobes should be at least 24 dB below the main lobe. If the interrogation beam is lower than the control beam at the sidelobes, attenuation is applied on the variable attenuator in the receiver which will lower the gain of the interrogation beam. The interrogate beam transmits the pulses P1 and P3. If the interrogate beam is too broad it will be more sensitive to ground reflections [6].

Control beam The control signal is the second antenna beam that is broader but has a lower peak gain around boresight. As seen in Figure 2.11, the control signal has a higher gain than the interro- gate beam except for the main lobe. It is used to prevent the aircraft from replying to signals from the interrogate beam sidelobes. Using the interrogate beam distribution the control signal can be formed while the center element in the array is in anti-phase. The signal of the control beam transmit the pulse P2. The transponder compares the pulse amplitudes of P1 and P2 to determine if the signal is received from the antenna sidelobes or from the main beam. Depending on whether if P1 is greater than P2 by more than 9 dB, the transponder must reply. The transponder does not need to reply if P2 is larger than P1.

When an aircraft is at close range, the transponder receiver dynamic range can cause ampli- tude limiting. Leading to a weaker signal for P1 and can be compared with P2. Therefore the amplitude of P2 at the direction of P1 will be reduced [6].

Figure 2.11: Interrogate and control beam patterns.

Difference beam To find the angle of arrival of the incident signal a difference beam is used. To get both the sum beam and the difference beam a hybrid ring coupler is used which will produce two out- puts. The hybrid ring coupler is explained in Section 2.8.4. If the difference peak gain is high the accuracy will be increased. The smaller peaks will not affect the monopulse performance and therefore it is good if they have a low amplitude so it wont be any extraneous signals [6].

18 2.8. System design

2.8.3 Changes in the horizontal characteristics with elevation In a perfect antenna the three horizontal beam pattern originates from a common phase cen- ter and will have the relative shape with elevation. In reality the three beam shapes will be broaden with elevation angle. This is because the radar assumes that bearing measurements are made in the horizontal plane even when the incident signal is arriving from a significant elevation angle. This broadening effect is of importance for the monopulse direction finding and for elevation angles above 20°. The error can be corrected by dividing the measured angle by the cosine of the elevation angle with slant range and the Mode C height. Either side of the boresight is of the monopulse direction is measured and averaged which leads to a reduced error [6].

The beam patterns produced are dependent on the distribution of power across the an- tenna aperture which can be maintained at all elevation angles but is difficult to achieve in practice. The control beam may in some cases not cover the sidelobes of the interrogate beam which will give erroneous replies [6].

2.8.4 The 180° hybrid coupler The 180° hybrid is a passive network usually easily implemented using microstrip transmis- sion lines of 50 Ω characteristic impedance at a given frequency of operation and for a spec- ified substrate on a printed circuit board. The structure of a 180° hybrid is shown in Figure 2.12. Four ports are available and they can be assigned as input and output ports. The hybrid uses transmission line of quarter wave length λ/4. The port is assumed to work on loads of 50 Ω impedance, e.g., following elements are of 50 Ω impedance. In (2.19), the S-parameters matrix of the hybrid is shown [14].

Figure 2.12: The 180° hybrid coupler [14].

0 1 1 0 j 1 0 0 1 [S]= ´ ´ (2.19) ? 1 0 0 1 2   0 1 1 0   ´  The way the 180° hybrid can be used can be understood knowing that a λ/4 length con- tribute to a phase delay of 90°. Main operation are as combiner of two incoming signals and divider of one signal. Combiner: With reference to Figure 2.12, it can be seen that if signals are applied at ports 2 and 3, they will reach port 1 in phase hence, they add, Σ. In opposite,

19 2. RADARTECHNOLOGY at port 4, the signals are coming with 180° phase difference, hence they subtract, ∆. Divider: If the input signal is applied to port 1, the signal will be evenly split at port 2, 3 and port 4 will be isolated 180° out of phase. Port 1 is the sum and port 4 is the difference.

The amplitudes of the scattering waves can be calculated by decomposing the case into a superposition of the two simpler circuits and excitations, using the even-odd mode analy- sis technique. The amplitudes of the scattered waves shows that the input port is matched, port 4 is isolated, and the input power is evenly divided and in phase between ports 2 and 3. These results form the first row and column of the scattering matrix (2.19) [14].

If a unit amplitude wave incident at port 4, the difference port, of the ring hybrid, the two wave components on the ring will arrive in phase at port 2 and at port 3, with a relative phase difference of 180° between these two ports. The two wave components will be 180° out of phase at port 1. This case can also be decomposed into a superposition of the two simpler circuits and excitations [14].

2.8.5 Ratio calculations The 180° hybrid coupler produces a sum Σ and difference ∆ signal. The ratio of these signals, U, contains information about how much the angle of arrival differs from the angle of the interrogation beam. The ratio can be calculated according to (2.20) [3]. ∆ U = Σ (2.20)

By using the ratio the sum and difference signals can be evaluated using a look-up table. For an ideal system the ratio should relate to the error angle according to (2.21).

k d sin θ U = j tan ¨ ¨ (2.21)  2 

2π In (2.21), the angular wavenumber k = λ , d is the distance between antenna elements and θ is the angle deviation from the boresight. The j factor determines which side of the boresight the signal is arriving on and when crossing the boresight it changes from j to j representing ´ a phase difference of π. To determine which side of the lobe the signal is coming from an one-bit ambiguity comparison is made in the system. In the interval where the sum has a higher gain the ratio will be lower than 1. At two points, on each side of the boresight, the ratio will be one as the sum and difference signals crossing each other, i.e. has the same gain. For larger angles the difference gain will be higher than the sum gain and the ratio will therefore be larger than 1. This can be seen in Figure 2.10, which shows the top of the sum and difference pattern. The sum and difference beam could have the same gain for even higher angles as Punch-Through can occur. Although this can occur the angles are most likely not of importance [3].

The radiation pattern is different for each elevation angle and also changes when beam steering is applied. To apply beam steering, a look-up table is used to find the phase delay needed in the phase shifters. The angles are not likely to be exactly on point, but are of good approximation. An uncertainty of the angle exist as there is an interval in the look-up table, and angle uncertainty in the phase shifter. In the realization of the system it is also impossible to gain ideal characteristics, therefore look-up tables containing measured data is used to reveal a more realistic result.

20 2.9. Errors

2.8.6 Interrogation side lobe suppression Interrogation side lobe suppression (ISLS) is similar to the SLS. But for the interrogator it is implemented using attenuation. Attenuation is applied to the sum beam to lower the amplitude. The ratio of the un-dampened difference beam and the dampened sum beam is analyzed. With variable attenuators the user can make sure that the sidelobes of the in- terrogator beam all have a lower amplitude than the resulting control beam as discussed in Section 2.8.2.

2.9 Errors

The angle error is created from the difference signal by calculating a complex ratio. This is done for the left/right difference beams, as well as for the up/down difference beams. In this project, only one difference beam is used. An explanation of how real and imaginary parts are used with radar can be found in the description of Pulse Doppler. The outcome of the calibration process is to rotate the complex antenna angle error vector onto the real axis to reduce signal processing losses. The angle error is used to make an adjustment to position the target along the centerline of the antenna.

The error sources for the monopulse bearing measurement system are as follows:

• Antenna pattern errors.

• Effects of receiver noise.

• Receiver errors dependent upon frequency.

• Receiver errors dependent upon reply signal strength.

• Errors in the conversion of video to angle units.

• Electrical errors and azimuth encoder.

Some of the errors are random with different degrees of error. Other errors are fixed with the same error [6].

21

Chapter Three

Signal model

In this Section the signal model will be presented with Simulink blocks and Matlab code.

3.1 System design

To measure signals for the receiver, a model will be made and simulated using Matlab and Simulink. There are some common blocks used in the model already existing in Simulink. The more uncommon blocks are listed in Appendix A for explanation. Most of those un- common blocks are in the DSP Toolbox or the Communication System Toolbox in Simulink. Throughout the model, different signal sinks will be added for troubleshooting and verifi- cation of the system and will not be discussed in detail and will not be shown in any figure. All Matlab code can be found throughout the text under corresponding function block. The gray blocks in the figures are subsystem blocks which are used to divide a larger system into smaller subsystems and the white blocks with Matlab symbols are Matlab functions. The Matlab functions have the same name in the box as the Matlab code name.

Figure 3.1: Conceptual image of the system.

Figure 3.1 shows a conceptual block diagram of the system. The system consists of: the signal black box block, the receiver system block and the output signal. Figure 3.2 shows the entire system in Simulink. There is also a function outside of the Simulink model to calculate the angle error. The function of the signal black box is described in this Chapter. The Steer_angle block, the Attenuation block, the Enable_error_attenuator and the Enable_error_phaseshifter are data memory block. These blocks are used in the System blocks seen in the Figure 3.2. The on-off switches are connected to the constant blocks and are used to enable or disable the attenuator and phase shifter errors.

23 3. SIGNALMODEL

Figure 3.2: The entire system in Simulink.

3.2 Signal

To model the signal from the transmitter to the receiver a system which calculates the Doppler effect, the Friis transmission, the received phase at each antenna element and the effective area of the antenna elements is needed. These functions are considered to be the most important to produce a good signal. This subsystem is named the Signal Black Box (SBB). All that is required by the user to operate this subsystem is to define the inputs into the subsystem. The inputs of the SBB subsystem are seen in Figure 3.3. From this block eight signals are produced for each antenna element and also the angle of the ’ position, which is used for calculations in Matlab.

• Velocity of the transmitter, given in a X Y Z vector.

• Velocity of the receiver, given in a X Y Z vector.

• Position of the receiver, given in a X Y Z vector.

• Position of the transmitter, given in a X Y Z vector.

• Frequency of the transmitted signal is always 1090 MHz.

• Power of the transmitted signal is in watts.

24 3.2. Signal

Figure 3.3: The SBB system.

The system block, which is shown in Figure 3.3, consists of several subsystems shown in Figure 3.4. There is a propagation block which calculates what happens to the signal before it reaches the antenna elements. The Input_signal block creates the specified sine signals. These blocks will produce eight signals at each antenna element. The Phase_calc and Phase_shifting blocks calculates and applies a phase difference between the antenna elements. The subsystems of the SBB are further explained in Sections 3.2.1 to 3.2.4. The rest of the system is presented in Chapters 4 and 5.

Figure 3.4: Inside the SBB system.

3.2.1 Propagation subsystem Figure 3.5 shows the propagation subsystem block. The input parameters for this block are the same as for the entire system. The output signals are used in the Input_signal block and the Phase_Calc block. The propagation subsystem is configured as in Figure 3.6.

25 3. SIGNALMODEL

Figure 3.5: The propagation block.

Figure 3.6: The configuration of the propagation system.

The relativespeed function calculates the speed of the transmitter and receiver relative to each other. This is needed in the calculations of the Doppler frequency. Since the Doppler frequency is calculated differently depending on if the objects are moving towards or away from each other, as described in Section 2.3.2, the relative_speed function also works as a state machine. It therefore tells the Doppler function what equation to use according to these states:

• 1. The transmitter is moving away from the receiver, the receiver is moving towards the source.

• 2. The transmitter and receiver are moving towards each other.

• 3. The transmitter is moving towards the receiver, the receiver is moving away from the source.

• 4. The transmitter and receiver is moving away from each other.

The relative speed is calculated using the Matlab function radialspeed shown in Figure 3.7 with the Matlab code shown in Code block 3.1, which returns the radial speed of an

26 3.2. Signal object relative to another object. It also takes into consideration the speed of the other object. However, in the Doppler equation (2.12) the relative speed is divided into two separate variables. Therefore the relative_speed function is used to calculate the speed vector of one object relative to a stationary second object. This is done as in (3.1), where the function radialspeed is used. The function, which is part of the Phased Array Toolbox, calculates the relative radial speed between two objects. In (3.1) the P variables are the position of the receiver and transmitter and the V variables are the velocity vectors of the transmitter and receiver. The second of the velocity vectors is set to zero to calculate the radial velocity for both the transmitter and receiver relative to each other when the other part is stationary. The Matlab code is also using the function ge(A, B) which determines if A is greater than B.

Vr = radialspeed(Pr, Vr, Pt, Vt) (3.1)

Figure 3.7: The relative speed function block.

1 function [V_relative_transmitter, V_relative_receiver, state] = ... relativespeed(V_transmitter, V_receiver, P_transmitter, P_receiver) 2 3 c = physconst('LightSpeed'); 4 5 V_relative_receiver = radialspeed(P_receiver,V_receiver,P_transmitter,[0;0;0]); 6 V_relative_transmitter = ... radialspeed(P_transmitter,V_transmitter,P_receiver,[0;0;0]); 7 8 if ge(V_relative_receiver,0) 9 if ge(V_relative_transmitter,0) 10 state = 2; 11 else 12 state = 1; 13 end 14 else 15 if ge(V_relative_transmitter,0) 16 state = 3; 17 else 18 state = 4; 19 end 20 end 21 22 end Code block 3.1: Relative speed Matlab code.

The relative velocity is passed on to the Doppler function shown in Figure 3.8 with cor- responding code presented in Code block 3.2, which calculates the Doppler frequency ac- cording to the theory described in Section 2.3.2. The Doppler function outputs the Doppler frequency which is used in the Friis function shown in Figure 3.9, with the corresponding code in Code block 3.3. The Friis function calculates the received power for the different

27 3. SIGNALMODEL antenna elements, which were described in Section 2.3.1. The Friis function also requires the distance from the transmitter to the receiver, or more accurately it requires the distance from the transmitter to each antenna element. This is calculated using the Distance_calc function shown in Figure 3.10. The code used in the Distance_calc function is presented in Code block 3.4. This function identifies the position of each antenna element depending on the position of the receiver, interpreted as the center of the array, and the distance between antenna elements. For simplicity, the receiving antenna array is fixed with the boresight parallel to the x-axis which means that the position of each antenna element only varies from the position of the receiver on the y-axis. An example of this, is the case of two antenna elements with the distance λ/4 between:

Receiver_Position = [0 0 0] λ Distance between elements: d = 4 d Position of antenna element 1: Pos_A1 = [0 2 0] d Position of antenna element 2: Pos_A2 = [0 - 2 0]

Figure 3.8: The Doppler function block.

1 function f_doppler = doppler(V_r_transmitter,V_r_receiver,state,f_source) 2 3 c = physconst('LightSpeed'); 4 5 Va_receiver = abs(V_r_receiver); 6 Va_transmitter = abs(V_r_transmitter); 7 8 switch state 9 case 1 10 f_doppler = f_source * ((c+Va_receiver)/(c+Va_transmitter)); 11 case 2 12 f_doppler = f_source * ((c+Va_receiver)/(c-Va_transmitter)); 13 case 3 14 f_doppler = f_source * ((c-Va_receiver)/(c-Va_transmitter)); 15 case 4 16 f_doppler = f_source * ((c-Va_receiver)/(c+Va_transmitter)); 17 otherwise 18 f_doppler = f_source; 19 end 20 21 end Code block 3.2: Doppler effect Matlab code.

28 3.2. Signal

Figure 3.9: The Friis function block.

1 function [A1,A2,A3,A4,A5,A6,A7,A8] = Friis(d_A1,d_A2,d_A3, ... d_A4,d_A5,d_A6,d_A7,d_A8,f,Pt,Ar,At) 2 3 c = physconst('LightSpeed'); 4 lambda = c/f; 5 6 A1 = (Pt/4)*((At*Ar)/((d_A1^2)*lambda^2)); 7 A2 = (Pt/4)*((At*Ar)/((d_A2^2)*lambda^2)); 8 A3 = (Pt/4)*((At*Ar)/((d_A3^2)*lambda^2)); 9 A4 = (Pt/4)*((At*Ar)/((d_A4^2)*lambda^2)); 10 A5 = (Pt/4)*((At*Ar)/((d_A5^2)*lambda^2)); 11 A6 = (Pt/4)*((At*Ar)/((d_A6^2)*lambda^2)); 12 A7 = (Pt/4)*((At*Ar)/((d_A7^2)*lambda^2)); 13 A8 = (Pt/4)*((At*Ar)/((d_A8^2)*lambda^2)); 14 15 end Code block 3.3: Friis equation Matlab code.

Figure 3.10: The distance calculation function block.

29 3. SIGNALMODEL

1 function [d_A1,d_A2,d_A3,d_A4,d_A5,d_A6,d_A7,d_A8] = ... distance_calc(pos_tran,pos_rec,f) 2 3 c = physconst('LightSpeed'); 4 lambda = c/f; 5 d = lambda/4; 6 pos_A1 = [pos_rec(1) pos_rec(2)+3.5*d pos_rec(3)]; 7 pos_A2 = [pos_rec(1) pos_rec(2)+2.5*d pos_rec(3)]; 8 pos_A3 = [pos_rec(1) pos_rec(2)+1.5*d pos_rec(3)]; 9 pos_A4 = [pos_rec(1) pos_rec(2)+0.5*d pos_rec(3)]; 10 pos_A5 = [pos_rec(1) pos_rec(2)-0.5*d pos_rec(3)]; 11 pos_A6 = [pos_rec(1) pos_rec(2)-1.5*d pos_rec(3)]; 12 pos_A7 = [pos_rec(1) pos_rec(2)-2.5*d pos_rec(3)]; 13 pos_A8 = [pos_rec(1) pos_rec(2)-3.5*d pos_rec(3)]; 14 15 d_A1 = sqrt((pos_tran(1)-pos_A1(1))^2 + (pos_tran(2)-pos_A1(2))^2 + ... (pos_tran(3)-pos_A1(3))^2); 16 d_A2 = sqrt((pos_tran(1)-pos_A2(1))^2 + (pos_tran(2)-pos_A2(2))^2 + ... (pos_tran(3)-pos_A2(3))^2); 17 d_A3 = sqrt((pos_tran(1)-pos_A3(1))^2 + (pos_tran(2)-pos_A3(2))^2 + ... (pos_tran(3)-pos_A3(3))^2); 18 d_A4 = sqrt((pos_tran(1)-pos_A4(1))^2 + (pos_tran(2)-pos_A4(2))^2 + ... (pos_tran(3)-pos_A4(3))^2); 19 d_A5 = sqrt((pos_tran(1)-pos_A5(1))^2 + (pos_tran(2)-pos_A5(2))^2 + ... (pos_tran(3)-pos_A5(3))^2); 20 d_A6 = sqrt((pos_tran(1)-pos_A6(1))^2 + (pos_tran(2)-pos_A6(2))^2 + ... (pos_tran(3)-pos_A6(3))^2); 21 d_A7 = sqrt((pos_tran(1)-pos_A7(1))^2 + (pos_tran(2)-pos_A7(2))^2 + ... (pos_tran(3)-pos_A7(3))^2); 22 d_A8 = sqrt((pos_tran(1)-pos_A8(1))^2 + (pos_tran(2)-pos_A8(2))^2 + ... (pos_tran(3)-pos_A8(3))^2); 23 end Code block 3.4: Distance calculations Matlab code.

The effective area is calculated using the effective_area function in Figure 3.11 which uses the code in Code block 3.5. The area outputs is used in the Friis function explained previously.

Figure 3.11: The effective area function block.

1 function [A_eff_r,A_eff_t] = effective_area(fr,ft) 2 c = physconst('LightSpeed'); 3 lambda_t = c/f_t; 4 lambda_r = c/f_r; 5 6 A_eff_t = lambda_t^2/(4*pi); 7 A_eff_r = lambda_r^2/(4*pi); 8 end Code block 3.5: Effective area Matlab code.

30 3.2. Signal

3.2.2 Input signal subsystem The Input_signal subsystem, seen in Figure 3.12, creates a sinusoidal signal with the correct amplitude and frequency. Figure 3.13 shows the inside of the signal create subsystem.

Figure 3.12: Input_signal subsystem of the SBB.

Figure 3.13: Inside the Input_signal subsystem of the SBB.

The subsystem consists of a DSP-sine block and one multiplier for each antenna element, as can be observed in Figure 3.13. The DSP-sine block, from the DSP toolbox, outputs samples of a specified sine wave. The configurable parameters are configured as follows:

• Amplitude = 1

• Frequency = Doppler frequency from the propagation subsystem.

• Phase Offset = 0

• Sample mode = Discrete

• Output complexity = Complex

• Computation method = Trigonometric fcn

• Sample time = 1/1000000000000

• Samples per frame = 1

31 3. SIGNALMODEL

The frequency is 1090 MHz, there is no need for a phase offset, the sample mode is discrete and output complexity is set to complex because both a real and a complex signal are needed. The sample time follows the Nyquist criteria and samples per frame is default value. The amplitude is set to 1 because the input of the subsystem is the received power for each of the specified antenna element, which is multiplied with the signal from the DSP-sine block to get the correct amplitude and then passed on to the output.

3.2.3 Phase calculation subsystem The Phase_calc subsystem shown in Figure 3.14, calculates the shift in phase for each antenna element depending on the distance between the antenna elements and the angle between receiver boresight and transmitter. These computations require the position of the receiver, position of the transmitter and the Doppler frequency previously calculated in the propagation subsystem.

Figure 3.14: The phase calculation block.

Inside the Phase_Calc subsystem, as illustrated in Figure 3.15, there is a single Matlab function block named phase_calc. It outputs the required phase shift for each antenna element. It positions the antenna elements in the same way as in the propagation subsystem, calculates the angle of arrival for the incident signal and the individual phase difference for each antenna element relative to the element closest to the transmitter. This is described in Section 2.1. It also outputs the angle of arrival in both azimuth and elevation for trou- bleshooting and verification. The code which implements this can be seen in Code block 3.6.

Figure 3.15: The phase calculation function block.

32 3.2. Signal

1 function [p_A1,p_A2,p_A3,p_A4p_A5,p_A6,p_A7,p_A8,Theta] = ... phase_calc(f_doppler,pos_rec,pos_tran) 2 3 c = physconst('LightSpeed'); 4 lambda = c/f_doppler; 5 d = lambda/4; 6 7 theta_rad = atan2(pos_tran(2)-pos_rec(2), pos_tran(1)-pos_rec(1)); 8 Theta =rad2deg(theta_rad); 9 10 if Theta > 0 11 p_A1 = 0; 12 p_A2 = 2*pi*d*sin(theta_rad)/lambda; 13 p_A3 = 2*pi*2*d*sin(theta_rad)/lambda; 14 p_A4 = 2*pi*3*d*sin(theta_rad)/lambda; 15 p_A5 = 2*pi*4*d*sin(theta_rad)/lambda; 16 p_A6 = 2*pi*5*d*sin(theta_rad)/lambda; 17 p_A7 = 2*pi*6*d*sin(theta_rad)/lambda; 18 p_A8 = 2*pi*7*d*sin(theta_rad)/lambda; 19 elseif Theta < 0 20 p_A8 = 0; 21 p_A7 = 2*pi*d*sin(abs(theta_rad))/lambda; 22 p_A6 = 2*pi*2*d*sin(abs(theta_rad))/lambda; 23 p_A5 = 2*pi*3*d*sin(abs(theta_rad))/lambda; 24 p_A4 = 2*pi*4*d*sin(abs(theta_rad))/lambda; 25 p_A3 = 2*pi*5*d*sin(abs(theta_rad))/lambda; 26 p_A2 = 2*pi*6*d*sin(abs(theta_rad))/lambda; 27 p_A1 = 2*pi*7*d*sin(abs(theta_rad))/lambda; 28 else 29 p_A4 = 2*pi*0.5*d*sin(theta_rad)/lambda; 30 p_A3 = 2*pi*1.5*d*sin(theta_rad)/lambda; 31 p_A2 = 2*pi*2.5*d*sin(theta_rad)/lambda; 32 p_A1 = 2*pi*3.5*d*sin(theta_rad)/lambda; 33 p_A5 = p_A4; 34 p_A6 = p_A3; 35 p_A7 = p_A2; 36 p_A8 = p_A1; 37 end 38 end Code block 3.6: Phase calculation Matlab code.

3.2.4 Phase shifting subsystem The Phase_Shifting subsystem shown in Figure 3.16 contains a single Matlab function block also named Phase_Shifting shown in Figure 3.17. This function takes the created signals from the Input_signal subsystem and the phase shift from the Phase_Calc sub- system and applies the specified phase shift to the signal for each antenna element.

The Matlab uses the Equation (3.2) to apply the desired phase shift without affecting the amplitude or frequency of the signals. This is shown in Code block 3.7. The variable φ is the phase in radians, which is applied. ´ Out = e iφ signal (3.2) ¨ The output of the subsystem is the shifted signals with the correct amplitude for each of the antenna elements. This phase shifting technique is used and explained further in Section 4.4.

33 3. SIGNALMODEL

Figure 3.16: Phase shifter block in the SBB subsystem.

Figure 3.17: Phase shifter function in the SBB subsystem.

1 function ... [Signal_A1,Signal_A2,Signal_A3,Signal_A4,Signal_A5,Signal_A6,Signal_A7, ... 2 Signal_A8] = Phase_Shifting(A_1,A_2,A_3,A_4,A_5,A_6,A_7,A_8, ... p_A1,p_A2,p_A3,p_A4,p_A5,p_A6,p_A7,p_A8) 3 4 Signal_A1 = exp(-1i*p_A1)*A_1; 5 Signal_A2 = exp(-1i*p_A2)*A_2; 6 Signal_A3 = exp(-1i*p_A3)*A_3; 7 Signal_A4 = exp(-1i*p_A4)*A_4; 8 Signal_A5 = exp(-1i*p_A5)*A_5; 9 Signal_A6 = exp(-1i*p_A6)*A_6; 10 Signal_A7 = exp(-1i*p_A7)*A_7; 11 Signal_A8 = exp(-1i*p_A8)*A_8; 12 13 end Code block 3.7: Phase shifter Matlab code.

34 Chapter Four

Receiver model

In this Chapter, the receiver model created in Simulink is presented and explained including the Simulink blocks and Matlab code.

4.1 Receiver system

The receiver model follows the Signal Black Box model. As shown in Figure 4.1, the model includes three main processing components, the low-noise amplifier (LNA), the phase shifter and the attenuator. The input signal number corresponds to the number of antenna elements ∆ in the array. The expected output signals are the sum (Σ), the difference (∆) and the ratio Σ signals, as indicated in Figure 4.2.

Figure 4.1: Conceptual block model of the receiver.

As detailed in Figure 4.3, the Receiver_System block gets the input signals A1 to A8 and processes them firstly in the Transmit receive unit (TRU). Then, TRU results are further processed by means of microwave passive components, i.e., the Wilkinson power divider (WPD) and the rat-race, 180° hybrid combiner. The WPD-network implement superposition of the signals coming out from TRU, and the 180° hybrid delivers the desired sum Σ and difference ∆ signals. Finally, the ratio is calculated. These systems are further described in Sections 4.2 to 4.9.

35 4. RECEIVERMODEL

Figure 4.2: The Receiver_system block.

Figure 4.3: Inside the Receiver_system block.

4.2 Transmit receive unit

The TRU shown in Figure 4.3 mainly contain the modules modeling the radio frequency (RF) circuits, i.e., the LNA, the phase shifter and the attenuator. From Figures 4.4 and 4.5, it can be seen that two other input signals are assigned to the TRU, i.e., Steer_angle and Attenuation.

Figure 4.4: TRU block.

In Figure 4.5, the TRU is detailed as implemented in Simulink. The Steer_calc block calcu- lates the required phase delay for the phase shifters so that the desired beam steer is applied to each of eight RF modules. Shown in Figure 4.8 in detail and as implemented in Simulink, the RF module block perform amplification, controlled phase shifting and attenuation onto each signal coming from the eight antenna elements in the array.

36 4.2. Transmit receive unit

Figure 4.5: Inside the TRU block.

Figure 4.6: The steer calculation function.

The code of the Steer_calc function is shown in Code block 4.1. It implements (2.3), i.e., the phase delay for each antenna element when the desired beam steer is specified. It can be seen that the phase delay increase linearly with the position of the antenna element relative to the antenna element closest to the transmitter.

37 4. RECEIVERMODEL

1 function [steer_A1, steer_A2, steer_A3, steer_A4, steer_A5, steer_A6, ... steer_A7, steer_A8] = Steer_calc(steer) 2 3 f = 1090e6; 4 c = physconst('LightSpeed'); 5 lambda = c/f; 6 k = 2*pi/lambda; 7 d = lambda / 4; 8 9 steering_rad = deg2rad(steer); 10 ∆_phi = k*d*sin(steering_rad); 11 12 if ge(steer,0) 13 steer_A1 = 0; 14 steer_A2 = ∆_phi; 15 steer_A3 = ∆_phi*2; 16 steer_A4 = ∆_phi*3; 17 steer_A5 = ∆_phi*4; 18 steer_A6 = ∆_phi*5; 19 steer_A7 = ∆_phi*6; 20 steer_A8 = ∆_phi*7; 21 else 22 steer_A8 = 0; 23 steer_A7 = ∆_phi; 24 steer_A6 = ∆_phi*2; 25 steer_A5 = ∆_phi*3; 26 steer_A4 = ∆_phi*4; 27 steer_A3 = ∆_phi*5; 28 steer_A2 = ∆_phi*6; 29 steer_A1 = ∆_phi*7; 30 end 31 32 end Code block 4.1: Steer calculation Matlab code.

Figure 4.7: The RF module block.

Figure 4.8: The subsystems of the RF module block.

38 4.3. Low-noise amplifier

4.3 Low-noise amplifier

In RF/microwave front-end systems, the first active circuit is the LNA. The low-noise ampli- fier has the task to a) amplify usually weak signals and b) to minimize the noise figure at its output.

From Friis noise figure equation for cascaded stages in (4.1), it can be seen that first ac- tive stage in a receiver front-end with e.g., gain G1, minimize the noise figure of following stages, Fi, observe division with G1. Also from (4.1), it can be seen that it is important that the noise figure of the first stage F1 is minimized. The minimization of the noise figure at the output of the amplifier is the main characteristic of the LNA and it is realized through amplifier special design.

F2 1 F3 1 Fn 1 Ftotal = F1 + ´ + ´ + ... + ´ (4.1) G1 G1G2 G1G2...Gn´1 The receiver model in this project includes only one active block, the LNA block in Figure 4.1, so that (4.1) can be simplified as (4.2). The phase shifter and attenuator in Figure 4.8 are usually passive components contributing only with losses, losses that translate into noise figure contribution, denoted with Frest in (4.2). In this project, the LNA block was modeled as a gain block of 20 dB. No noise figure aspects were considered [13].

Frest 1 Freceiver = FLNA + ´ (4.2) GLNA

Figure 4.9: The LNA block.

Figure 4.10: Inside the LNA block.

4.4 Phase shifter

In an active electronically scanned array (AESA), the phase shifters are crucial to apply steering. It is used to apply a phase delay to steer the beam as described in Section 2.1. When phase shifting, there will be an insertion loss which will change the amplitude of the wave. For an active phase shift the amplitude will increase and for the passive it will decreases, which is why it is good to have an attenuator after the phase shifter. In this ideal model insertion loss is not applied. In the receiver a variable phase shifter is implemented to be able to steer the beam. This gives a phase error which depends on the size of the phase delay. When the phase delay is increased the phase error increases according to Table 4.1 which is based on an existing phase shifter, model 984-1. The phase shifter block seen in Figure 4.11, is placed between LNA and attenuator in the model. Figure 4.12 shows the inside of the Phase_shifter subsystem, containing a State_generator Matlab function, a random Matlab function, a Steer_function Matlab function, a Random Integer block and some math operation blocks [17].

39 4. RECEIVERMODEL

Figure 4.11: The phase shifter block.

Figure 4.12: Inside the phase shifter block.

Table 4.1: Maximum phase variance [17]. Maximum phase variance 0-10° 20° 40° 80° 160° 320° 1.5° 2° 3.5° 5.5° 10° 10° ˘ ˘ ˘ ˘ ˘ ˘

The steer_function shown in Figure 4.13 shifts the phase with (4.3) and is dependent on the State_generator to apply the correct phase shift. The code for the steer_function is shown in Code block 4.2

Out = eiφ signal (4.3) ¨

40 4.4. Phase shifter

Figure 4.13: The steer function block.

1 function shifted_signal = steer_function(signal,state,P1,P2,P3,P4,P5) 2 3 if state == 1 4 shifted_signal = signal; 5 shift = 0; 6 elseif state == 2 7 shifted_signal = exp(1i*P1)*signal; 8 shift = P1; 9 elseif state == 3 10 shifted_signal = exp(1i*P2)*signal; 11 shift = P2; 12 elseif state == 4 13 shifted_signal = exp(1i*P3)*signal; 14 shift = P3; 15 elseif state == 5 16 shifted_signal = exp(1i*P4)*signal; 17 shift = P4; 18 elseif state == 6 19 shifted_signal = exp(1i*P5)*signal; 20 shift = P5; 21 else 22 shifted_signal = 0; 23 shift = 0; 24 end 25 end Code block 4.2: Steer function Matlab code.

Five separate states indicate the different degree intervals of shifting according to Table 4.1. The states are generated by the Matlab function state_generator, seen in Figure 4.14 with the corresponding code presented in Code block 4.3. Depending on the input from the Steer_calc, different states will be chosen and for each state the corresponding phase error is applied. This function does not affect the amplitude of the signal.

41 4. RECEIVERMODEL

Figure 4.14: The state generator function block.

1 function [state,phase_out] = state_generator(phase_steer) 2 3 phase_steer_deg = rad2deg(phase_steer); 4 phase_shift = phase_steer_deg; 5 phase_out = phase_steer_deg; 6 7 if phase_shift == 0 8 state = 1; 9 elseif ((abs(phase_shift) > 0) && (abs(phase_shift) ď 15)) 10 state = 2; 11 elseif ((abs(phase_shift) > 15) && (abs(phase_shift) ď 30)) 12 state = 3; 13 elseif ((abs(phase_shift) > 30) && (abs(phase_shift) ď 60)) 14 state = 4; 15 elseif ((abs(phase_shift) > 60) && (abs(phase_shift) ď 120)) 16 state = 5; 17 elseif ((abs(phase_shift) > 120) && (abs(phase_shift) ď 360)) 18 state = 6; 19 else 20 state = 7; 21 end 22 23 end Code block 4.3: State generator Matlab code.

The required phase shift is the output from the State_generator and an error signal is added from the Random function, seen in Figure 4.12. The Random function will generate a phase error between 0 and 1. The amplifiers will then amplify the error to match the intervals in Table 4.1. The random generator is presented in Section 4.6. The non-selected states will not affect the chosen state since the steer_function only uses the signal corresponding to the active state.

4.5 Attenuator

The attenuator decreases the amplitude of the signal. It is used to improve impedance match- ing and to lower the amplitude of the signal for measuring and protection. Attenuation is often expressed in decibel, this means that 3 dB attenuation will decrease the power by a half. Some requirements are low deviation, for instance coaxial structure, and low SWR. In the receiver, a variable attenuator is used to apply sidelobe suppression. Accuracy can differ for different attenuation levels, for example: a specific attenuator AT-264 has the accuracy of 0.3 dB +5% of the attenuation setting for the frequency used [1]. ˘ The subsystem for the attenuator is shown in Figure 4.15. The implementation of the at- tenuator functions are shown in Figure 4.16. The model has a gain with negative constant which will add up with the accuracy of the attenuator implemented as a Matlab function Attenuator seen in Figure 4.17. The accuracy is modeled with a Matlab random function

42 4.5. Attenuator just like in the phase shifter. The equation for the attenuator is modeled as (4.4), where A is attenuation level, Aloss is attenuation accuracy and signal is the input signal. The code which implements this can be seen in Code block 4.4.

Out = A A signal (4.4) ¨ loss ¨

Figure 4.15: The attenuator block

Figure 4.16: Inside the attenuator block.

Figure 4.17: The attenuator function

1 function out = attenuator(in,rand_in,attenuation_dB) 2 3 rand_number = rand_in*(0.05*attenuation_dB); 4 rand_number_pwr = 10^(rand_number/10); 5 attenutation_pwr = 10^(-attenuation_dB/10); 6 7 out = attenuation_pwr*rand_number_pwr*in); 8 9 end Code block 4.4: Attenuator Matlab code.

43 4. RECEIVERMODEL

4.6 Random error generator

Simulink has different toolboxes containing blocks which generate pseudo random numbers. Also, Matlab has different functions for generating pseudo random numbers. When using a Matlab function block in Simulink to generate a random number, the same seed is used at every simulation unless manually changed. This means that it generates the same number every time. To generate a random number within a specified range the following method can be used. For this simulation, a finite array of random numbers can be predefined by a Matlab function and then one of these numbers can be chosen by a separate Simulink block. By using the function rand(1000,1) a vector of 1000 random numbers between 0 and 1 can be generated. If a different range of numbers is required the range is specified by doing the following:

1 a = 50 b = 100; 2 x = (b-a).*rand(1000.1)+a

This generates a vector of 1000 random numbers between 50 and 100. It uses a random integer block from Simulink DSP Toolbox. With this block a random number from the vector can be chosen at random each simulation.

Generating a random number to the attenuator and phase shifter errors it is sufficient to generate a finite vector of numbers within the required range. This vector is predefined in the Matlab functions random and generated beforehand in a Matlab script. Then a Random_integer block can be used to generate an integer between 1 and the size of the vector. This integer is used as input to the Matlab function and the integer determines which value is used from the vector. The system is displayed in Figure 4.18. A variable is used as an input which enables the error generator. If set to zero, the errors are disabled. The code implemented in the random is shown in Code block 4.5. However, the 1000 random numbers have been excluded.

Figure 4.18: The Random Matlab function block.

One of these systems is used for each attenuator and for each of the phase shifters of the TRU. The enable variable is stored in a Data Store Memory, which can be used as input to the Matlab function block. The Data Store Memory block is, as the name suggests, a storage block for variables. This storage can be accessed by write or read blocks. The write block inputs data to the storage, overwriting the previous value. The read block outputs the value from the storage. This enables the user to enable all errors at once by changing the value in the Data Store Memory. The errors have been divided into phase shifter errors and attenuator errors which both have an enable button each. This can be seen in Figure 3.2.

44 4.7. Wilkinson power divider

1 function random_number = random(random_int,enable) 2 3 x = [ "Array with 5318 numbers" ]; 4 5 if enable == 0 6 number = 0; 7 else 8 random_number = x(random_int+1); 9 end 10 11 end Code block 4.5: Random generator Matlab code.

4.7 Wilkinson power divider

Power dividers are microwave components used for power division, i.e., one input power will be split into two outputs with less power. It can also be used the other way around as a combiner with two inputs and one output. The equal 3 dB Wilkinson power divider (WPD) is used as a combiner in this model. A great advantage with the WPD is that the outputs are isolated, S23 = S32 = 0, so it is lossless when perfectly matched. The length of the transmission lines between input ports and output port is λ/4, which means that the signal will be 90° phase shifted. Figure 4.19 shows the WPD block and Figure 4.20 shows the Matlab function WPD in Simulink [14]. Code block 4.6 shows the code implemented in the WPD block.

Figure 4.19: The WPD block.

Figure 4.20: The WPD function.

1 function port_1 = WPD(port_2,port_3) 2 3 port_1 = port_2*exp(1i*pi/4) + port_3*exp(1i*pi/4); 4 5 end Code block 4.6: WPD Matlab code.

45 4. RECEIVERMODEL

4.8 The 180° hybrid coupler

The hybrid, also referred to as rat-race coupler, is a four-port network with two inputs and two outputs. The coupler will be used as a combiner with the outputs phase shifted 180° to produce the difference signal and with a tuned output to which the signals are coming in phase, hence producing the sum of the signals. The input signals are applied at port 2 and 3 so that the sum signal will be produced at port 1 and the difference signal will be produced at port 4.

As described in Section 2.8.4, the distance between the input ports 2 and 3 to port 1 is λ/4. The same distance will produce the same phase shifting so that the signals will add Σ up like = S1 + S2. The distance from the inputs ports 2 and 3 to port 4 is unequal. This results in different phase shift for the signals: 90° for port 3 and 270° for port 2. This means that there will be destructive interference and the signals will be subtracted ∆ = S S . 1 ´ 2 Ideally, if the signals on the input ports are in phase, port 4 is zero in amplitude. Figure 4.21 shows the rat-race subsystem block and Figure 4.22 shows the rat_race Matlab function in Simulink with the corresponding code shown in Code block 4.7. In the function block port 1 is called sum_1 and port 4 is called diff_4. The outputs of this subsystem can be used to make a graph of the antenna pattern as described in Chapter 2 [14].

Figure 4.21: The rat-race block.

Figure 4.22: Rat-race function.

1 function [sum_1,diff_4] = rat_race(port_2,port_3) 2 3 sum_1 = port_2*exp(1i*pi/4) + port_3*exp(1i*pi/4); 4 5 diff_4 = port_2*exp(1i*pi/4) + port_3*exp(-3i*pi/4); 6 7 end Code block 4.7: Rat-race Matlab code.

46 4.9. Diff/Sum ratio

4.9 Diff/Sum ratio

Equation (4.5) shows how the monopulse ratio is calculated, where U is the monopulse ratio, ∆ is the difference signal, Σ is the sum signal and ϕ is the phase difference between two antennas. Equation (4.6) shows how the ratio phase can be calculated, where R1 and R2 are the distances between the transmitter and the antennas, λ is wavelength, d is distance between the antennas and θ is the deviation angle from boresight [3], [15], [16].

|∆| ϕ U = = tan( ) (4.5) |Σ| 2 2π 2π U = (R R )= d sin θ (4.6) λ 1 ´ 2 λ The amplitude comparison subsystem block, in Figure 4.23, calculates the max sum and difference values of the signal, and also the ratio by using these values. The max value is taken because in theory the signal is a pulse. The amplitude comparison block is modeled as in Figure 4.24, with the difference and sum signals as input.

Figure 4.23: Ratio calculation block.

Figure 4.24: Inside the ratio calculation block.

47

Chapter Five

Data management

In this Chapter, the method for how the data is processed is explained, using Matlab code.

The high frequency sine wave is making pulses, which are analyzed. Because it is a pulse which is received, only the max value is used for calculating the ratio. These are the max values of the sum and difference signals from the rat-race. With signals measured for the different positions of the transmitter relative to the receiver, these angles will give different results. By summarizing a set of data the antenna pattern is achieved. This antenna pattern will be plotted with 10 different measurement values of 5° interval. There will be different cases of measurement setups:

• The ideal system.

• Only the phase shifter error enabled.

• Only the attenuation error enabled.

• Both the phase shifter error and the attenuation error enabled.

With this method, the phase shifters and the attenuators can be evaluated separately. Fur- thermore, the ideal pattern is used as comparison to calculate how much the errors affect the angle measurements.

5.1 Simulink to Matlab file

By using the to_matfile function in Figure 5.1, the simulated data is sent to a Matlab file that can be processed by Matlab code. The variables needed are ratio, sum signal, difference signal and the angle theta. The ratio has also been calculated with a Matlab script, which yielded the same results.

Figure 5.1: The to_matfile function.

49 5. DATA MANAGEMENT

1 function to_file = to_matfile(theta,ratio,sum,diff) 2 3 to_file = [theta ratio sum diff]; 4 5 end Code block 5.1: To file Matlab code.

The function in Figure 5.1 works as a multiplexer, which can be seen in Code block 5.1. A Matlab function block was used instead of a regular multiplexer block because of its flexi- bility. Meaning that it is easier to output parts of the string, which will be sent to the file, in Simulink for verification. The block can be modified to take as many inputs as required.

5.2 Matlab file to graph

The Matlab code in Code block 5.2, loads data from Matlab files and sorts the values to the right position in a Matlab workspace variable. It sorts it in the following way: column one is always the θ corresponding to the measurements, column two is the ratio of the first mea- surement followed by the sum and difference values in columns three and four. The same sorting is used for all performed measurements.

1 row = 1; 2 3 load('Results.mat'); 4 load('Results2.mat'); 5 load('Results3.mat'); 6 load('Results4.mat'); 7 8 s_a = size(sim_results_attenuator); 9 s_p = size(sim_results_phase_shifter); 10 s_i = size(sim_results_ideal); 11 s_a_p = size(sim_results_attenuator_phaseshifter); 12 13 DS_a_p(row,1) = sim_results_attenuator_phaseshifter(2,s_a_p(2)); 14 DS_a_p(row,2:(s_a_p(1)-1)) = ... sim_results_attenuator_phaseshifter(3:s_a_p(1),s_a_p(2)); 15 DS_a(row,1) = sim_results_attenuator(2,s_a(2)); 16 DS_a(row,2:(s_a(1)-1)) = sim_results_attenuator(3:s_a(1),s_a(2)); 17 DS_p(row,1) = sim_results_phase_shifter(2,s_p(2)); 18 DS_p(row,2:(s_p(1)-1)) = sim_results_phase_shifter(3:s_p(1),s_p(2)); 19 DS_ideal(24+row,1) = sim_results_ideal(2,s_i(2)); 20 DS_ideal(24+row,2:(s_i(1)-1)) = sim_results_ideal(3:s_i(1),s_i(2)); Code block 5.2: Sorting Matlab code.

In the Matlab code in Code block 5.2, there is a row variable. This variable is used to specify which row in the dataset the results of the simulation should be put in. For simplicity, it is suggested that the user starts at the lowest angle and increments the row variable for each angle.

The files are then processed by the following code to sort out, calculate and plot: ratio data and the sum and difference signals in dB. The first part in Code block 5.3 extracts the ratio data from the file and puts them in a new variable named ratio_ f ile. Only some key parts of the code is presented here, the entirety of the code is presented in Appendix B.

50 5.2. Matlab file to graph

1 %% Ratioextractor 2 % Extracts the ratio data out of the file and gives a file with only ratio ... data and corresponding angle. 3 file = DS; % Name of your data set as file here. 4 file_size = size(file); 5 6 ratio_file(:,1) = file(:,1); 7 i = 1; 8 9 while le(i,file_size(1)+2) 10 u = 2; 11 p = 2; 12 while le(p,file_size(2)) 13 ratio_file(i,u) = file(i,p); 14 p = p + 3; 15 u = u +1; 16 end 17 i = i + 1; 18 end Code block 5.3: Ratio extracting Matlab code.

The sum and diff data can also be extracted by the code in Code block 5.4, which uses the same principle as the code which extracts the ratio.

1 %% SUM DIFF EXTRACTOR 2 % Extracts the sum and diff values out of your file 3 file = DS; % Name of your dataset as file here 4 file_size = size(file); 5 6 sum_diff_file(:,1) = file(:,1); 7 i = 1; 8 9 while le(i,file_size(1)+2) 10 u = 2; 11 p = 3; 12 while le(p,file_size(2)) 13 sum_diff_file(i,u) = file(i,p); 14 sum_diff_file(i,u+1) = file(i,p+1); 15 p = p + 3; 16 u = u +2; 17 end 18 i = i + 1; 19 end Code block 5.4: Sum and diff extracting Matlab code.

From the code presented above, the ratio file is used to calculate the deviation with the code in Code block 5.5. The code plots all the different ratio measurements. Calculates and plots the absolute value of the deviation from the ideal ratio to the different ratio measurements. The code also adapts to small errors in the datasets by finding the angle in the ideal dataset which is closest to the angle in the non-ideal dataset. Since the non-ideal dataset and the ideal dataset can deviate from each other for the same measurement. For instance, when measuring for 10° the ideal dataset might end up measuring for 9.997° and the non-ideal 10.002°. The code will pair them with each other even though there is a small deviation.

51 5. DATA MANAGEMENT

1 % Find the closest angle in the ideal dataset corresponding to the angle in ... the non-ideal dataset 2 % Non-ideal file must consist of only ratios at columns 2 and beyond 3 steer = 0; % Input the steer of your dataset here to formate the plot function. 4 ideal_file = DS; % Name of the ideal ratio dataset as file 5 non_ideal_file = DS_a_p_r; % Name of the non ideal ratio dataset as ... non_ideal_file 6 7 size_ideal_file = size(ideal_file); 8 size_non_ideal = size(non_ideal_file); 9 10 dev_file = zeros(size_non_ideal); 11 dev_file(:,1) = non_ideal_file(:,1); 12 dev_file_procent(:,1) = non_ideal_file(:,1); 13 i = 1; 14 while le(i,size_non_ideal(1)) 15 value_check = 0; 16 save_value = 0; 17 save_row = 1; 18 row = 1; 19 20 while le(row,size_ideal_file(1)) 21 value_check = abs(ideal_file(row,2) - non_ideal_file(i,2)); 22 if ge(row,2) 23 if le(value_check,save_value) 24 save_value = value_check; 25 save_row = row; 26 end 27 else 28 save_value = value_check; 29 end 30 row = row + 1; 31 end 32 33 row_angle = save_row; Code block 5.5: Processing Matlab code part 1.

The while loop in the code presented in Code block 5.5 loops through the ideal_ f ile and finds the row number of the angle in the ideal file which has the smallest difference from the angle in the non-ideal file as stated previously. This loop is used to perform the same task several times in the code and will not be presented again. The deviation is calculated as in (5.1), where the absolute value is taken of the difference between the ideal and non-ideal value.

deviation = ideal_value2 non_ideal_value2 (5.1) ´ a Then the percental deviation is calculated and plotted. It is calculated as in (5.2).

deviation percental_deviation = (5.2) ideal_ratio The code which implements this is shown in Code block 5.6.

52 5.2. Matlab file to graph

1 % Calculate the absolute value of the deviation from the ideal pattern as ... well as the percental deviation 2 io = 1; 3 4 while le(io,size_non_ideal(2)-1) 5 dev_file(i,1+io) = abs(ideal_file(row_angle,2)-non_ideal_file(i,1+io)); 6 dev_file_procent(i,1+io) = dev_file(i,1+io)/ideal_file(row_angle,2); 7 io = io + 1; 8 end 9 i = i + 1; 10 end 11 % Find the maximum value of the percental deviation for each measured point 12 dev_file_procent_max(:,1) = dev_file_procent(:,1); 13 size_procent = size(dev_file_procent); 14 mo = 1; 15 16 while le(mo,size_procent(1)) 17 dev_file_procent_max(mo,2) = max(dev_file_procent(mo,2:size_procent(2))); 18 mo = mo + 1; 19 end Code block 5.6: Processing Matlab code part 2.

Then the code in Code block 5.6 finds the maximum and minimum deviation in each mea- sured point by using a max() and min() functions, which are standard Matlab functions. The functions return the maximum and minimum value of an array, which are then applied to the ideal value as in (5.3) and yields the ratio with the maximum and minimum deviation in each measured point. This is implemented in Code block 5.7.

maximum_deviation_ratio = ideal_value (1 + max_procentual_deviation) (5.3) ¨

1 % Calculate maximum error ratio: ideal_ratio + (ideal_ratio * ... max_percental_deviation) 2 max_deviation_ratio(i,2) = ... ideal_file(ideal_row,2)+(ideal_file(ideal_row,2).*dev_file_procent_max(i,2)); 3 4 if le(max_error_ratio(i,1),steer) 5 max_iteration = row_steer; 6 else 7 max_iteration = size_ideal_file(1)-row_steer; 8 end Code block 5.7: Processing Matlab code part 3.

These values are then inputed to a look-up table which uses the ideal antenna pattern for the steer degree corresponding to the dataset to find the incident angle corresponding to the value of the ratio. The look-up table works similarly as the while loop presented above, but has more conditions as can be seen in Code block 5.8. Such as the ambiguity variable which makes sure that the look-up table is choosing the correct side of the steer angle to compare the values with.

53 5. DATA MANAGEMENT

1 %% Find the angle corresponding to the ratio with maximum error in the ideal ... pattern 2 y2 = 0; 3 s2 = 1; 4 s = 1; 5 while le(s,max_iteration) 6 if le(max_error_ratio(i,1),steer) 7 ambiguity = 0; 8 y1 = abs(ideal_file(s,2) - max_deviation_ratio(i,2)); 9 else 10 ambiguity = 1; 11 y1 = abs(ideal_file(row_steer+s,2) - max_deviation_ratio(i,2)); 12 end 13 if ge(s,2) 14 if le(y1,y2) 15 y2 = y1; 16 if ambiguity == 1 17 s2 = row_steer+s; 18 else 19 s2 = s; 20 end 21 end 22 else 23 y2 = y1; 24 end 25 s = s + 1; 26 end Code block 5.8: Processing Matlab code part 4.

The absolute value of the difference between the angle which correlates with the ratio from the max_deviation_ratio and the real angle from the ideal_ f ile is then saved in the angle_deviation_maximum. The code which performs this can be seen in Code block 5.9.

1 % Calculate the angular deviation 2 angle_deviation_maximum(i,1) = dev_file_procent_max(i,1); 3 angle_deviation_maximum(i,2) = abs(max_deviation_ratio(i,1)-ideal_file(s2,1)); 4 i = i + 1; 5 end Code block 5.9: Processing Matlab code part 5.

The values calculated from this code are then saved by the user and functions can be used to plot the data so that it is comparable in the same graph. These functions are also included in Appendix B.

54 Chapter Six

Simulation results and discussion

Simulation results and discussion explain the final model result. In graphical form, it is shown how the different components affect the signal. First the scenario is presented, then the model results are presented with graphs of how the signals look throughout the model. Then the measurements are presented for different steering angles. The result will be discussed as it is presented, with a comparison discussed in Section 6.15. This will be the basis for the conclusion in Chapter 7. Simulations will be made for different positions for the transmitter relative to the receiver position. These positions will give data with graphs for different steer- ing angles. With all this data, the angular deviation will be presented in this Chapter. For the result, the relevant data is around 20° of the steering angle. ˘ 6.1 Scenario

The scenario for the simulations have been briefly discussed in previous chapters. Here it will be summarized and explained to give an accurate representation of how the simulations were performed.

• The receiving antenna boresight is assumed parallel to the x-axis. It implies that the position of the antenna elements varies along the y-axis, as discussed in Section 3.2.1.

• 8 antenna elements are implemented.

λ • The distance between the antenna elements is set to 4 . • Isotropic antenna elements are used.

• Friis transmission equation is modelled and used. All other transmission related losses are neglected.

• Sinusoidal waves are used to represent the signals.

• Both aircrafts are stationary.

• The angular deviation will be analyzed for both the phase shifter and attenuator errors separate as well as together.

• Ten simulations are made for each of the three error cases: phase shifter, attenuator and both together.

• The simulations are made for the same distance between transmitter and receiver. This distance is D = 10 km. The model has been tested to make sure that it yields the same results for different distances.

• The attenuation is the same for all simulations A = 12 dB.

55 6. SIMULATION RESULTS AND DISCUSSION

6.2 System

The entire model of the system includes initial variables set by the user and also some vary- ing variables which are the moving objects around and parts of the system. The signal is modulated by a propagation block so the realistic signal could be processed by the Transmit Receive Unit (TRU). The TRU will produce eight signals which are connected to the couplers. These couplers will give the sum signal and the difference signal.

6.3 Input signals and parameters

The initial parameters are the position and velocity of the transmitting aircraft and the re- ceiving aircraft. The phase steering of the phase shifters and attenuation in the TRU can be varied as well, but the attenuation will be set to 12 dB for these measurements. It is important that the distance between the antenna elements are correct in all subsystems which are used as a variable, otherwise the shape of the radiation pattern can deviate greatly.

6.4 Signal modulation

The signal is processed by a signal box consisting of a propagation block, a phase shift calculator and a phase shifter. The output of the propagation block for one antenna element can be seen in Figure 6.1. The graph shows both the real part, the red line, and the imaginary part, the blue line, of the signal. All graphs later will not necessarily have the imaginary part. This signal can be compared with the later modified signal.

Figure 6.1: The received signal at one antenna element.

56 6.5. Transmit receive unit

6.5 Transmit receive unit

The TRU contains eight RF modules which in turn consist of a LNA, a phase shifter and an attenuator. The output signal for a phase shifter is shown in Figure 6.2, where it is compared with the input signal of the phase shifter. The red line is the real part of the signal before the phase shifter and the blue line is the real part of the signal after the phase shifter. In the graph it can be seen that the signal is shifted as expected.

Figure 6.2: The phase shifted signal.

The output of the attenuator is compared with the input signal in Figure 6.3. The blue line shows the real part of the input signal and the red line shows the attenuated signal. In the graph the signal is attenuated by 12 dB as it should.

57 6. SIMULATION RESULTS AND DISCUSSION

Figure 6.3: The attenuated signal.

6.6 Couplers

The WPD is used to combine two signals into one. The rat-race will then receive two signals and produce a sum and a difference signal. These signals are shown in Figure 6.4. The differ- ence signal, the blue line, varies much more than the sum signal, the red line, depending on the incoming angle of the transmitter, around boresight.

Figure 6.4: The sum and difference signal.

58 6.7. Model validation

6.7 Model validation

The antenna pattern produced by this model was compared with the antenna pattern of the system that Saab is developing. To make sure that the antenna pattern was similar in the case when e.g., the same distance between antenna elements and the same amount of antenna elements are used. Using scopes and display throughout the whole system the signals can be traced and evaluated. The model simulates results for an ideal system and a system with errors. The nominal result is compared with the simulated results for the interrogator to achieve reasonable values. The system with errors is then compared with the ideal system to see how the errors affect the signals.

To evaluate the system, different angles between the transmitter and receiver were simu- lated. To calculate these angles a Matlab function was created to calculate the desired angles between 0° and 180° for a set distance. It generates coordinates for the transmitter which corresponds to the angle. The values for the sum and difference signals, in dB, can now be plotted using a plot function in Matlab.

6.8 Ideal antenna pattern

The results from the simulation were sent into the selected Matlab folder in a file where the data is stored. All ideal datasets are simulated with a precision of 0.2°. The measured angles are 50° around the steering angle. The antenna pattern plots shows dB watt on the y-axis ˘ and incident angle in degrees on the x-axis. Figure 6.5 shows the plot for the ideal system with 0° steer. The blue line is the sum signal and the red line is the difference signal.

Figure 6.5: Antenna pattern of the ideal system.

59 6. SIMULATION RESULTS AND DISCUSSION

The ratio which is calculated from the data used in Figure 6.5 is displayed in Figure 6.6. In both these figures the critical point is around 15° where the sum and difference cross each ˘ other and where the ratio in Figure 6.6 becomes 1.

Figure 6.6: Sum diff ratio of ideal the system.

6.9 Steer 0°

Figure 6.7 shows the ten different antenna patterns with phase shifter error enabled and Figure 6.8 shows the ten different antenna patterns with the attenuator error at 0° steer. Most of the figures in Section 6.9 to Section 6.15 have been calculated or processed by the code presented in Section 5.1.

Unlike the radiation pattern for the ideal system, Figure 6.5, the curves do not have the same smooth lines. These small deviations will give a ratio different from the ideal system, and it is this ratio deviation that can be used to calculate the angular deviation.

When processing the data from the figures, it can be stated that the attenuator error graph does not deviate as much as the phase shifter error graph. This result shows that the phase shifter error will have a bigger impact on the angular accuracy than the attenuator. For the other steering angles only the antenna pattern and the ratio plot with both errors will be shown. Because the attenuator errors do not increase as the phase shifter errors does for larger steering angles, the attenuator antenna pattern will have a similar error interval for the different measured angles.

60 6.9. Steer 0°

Figure 6.7: Sum diff signals with phase shifter error enabled.

Figure 6.8: Sum diff signals with attenuation error enabled.

61 6. SIMULATION RESULTS AND DISCUSSION

When enabling both error sources a greater deviation is acquired. Figure 6.9 shows the antenna pattern with both phase shifter and the attenuator error at 0° steer. With these small deviations for the attenuator Figure 6.9 is similar to Figure 6.7.

Figure 6.9: Sum diff signals with attenuator and phase shifter error enabled.

Figure 6.10 shows the ratio for steer 0° with phase shifter and attenuator errors enabled. This graph shows how the ratio increase to values above 50 when the sum signal approaches zero. Since the most important data is where the ratio is lower than 1, the rest of the graphs containing the ratio will be presented without these peaks. Figure 6.11 to 6.13 shows cropped graphs of the ratio for the three different error cases for steer 0°. These different cases for the ratio will only be presented for steer 0°. For the other steer values, only the ratio deviation for the case when both errors are enabled will be shown.

For these graphs, the most important area is where the ratio is below 1 since the real system uses RSLS processing to get rid of the other signals. But it can be important to know how the angular accuracy varies for the case when the ratio is higher than 1. The deviation which occurs at boresight is mostly due to the amplitude offset between the ideal and non-ideal ratio. Since the ideal ratio approaches zero at boresight it generates a higher deviation.

Figure 6.14 shows the ratio deviation and the percental ratio deviation where the rele- vant angles are from 30° to 30°. The small peak between 5° and 5° is expected because the ´ ´ ideal difference signal is approaching zero at 0°. This however, is more visible in the second graph where the percental deviation peaks at a value much higher than 100 %. Which is expected since the deviation in the upper graph is around 0.01 0.03 at 0° and the ideal ratio ´ ´ at 0° has a magnitude around 10 4. The method of calculating the percental ratio deviation ˚ is explained in Chapter 5.

62 6.9. Steer 0°

Figure 6.10: Ratio with attenuator error for steer 0°.

Figure 6.11: Ratio with phase shifter error for steer 0°.

63 6. SIMULATION RESULTS AND DISCUSSION

Figure 6.12: Ratio with attenuator error for steer 0°.

Figure 6.13: Ratio with attenuator and phase shifter error for steer 0°.

64 6.9. Steer 0°

Figure 6.14: Ratio deviation for steer 0°.

Using the function described in Section 5.1, the maximum and minimum percental devi- ation from the data shown in Figure 6.14 can be calculated. This is applied to the ideal ratio from Figure 6.13 which can be used to calculate the angular deviation. Figure 6.15 shows the ideal ratio together with the plots for the maximum and minimum deviation applied to it.

The data from the maximum deviation ratio and minimum deviation ratio in Figure 6.15 is put through a look-up table as described in Chapter 5. The look-up table finds the angle corresponding to the value of the ratio. The real angle is subtracted from the angle found in the look-up table to calculate the angular deviation.

The maximum and minimum angular deviations for steer 0° are shown in Figure 6.16. The blue line is the maximum angular deviation and the red line is the minimum angular deviation. All look-up tables have a precision of 0.2°, this precision directly affects the preci- sion of the angular deviation. If the angular deviation is 0° it could be up to 0.1° because of this precision. The graph in Figure 6.16 shows that the angular deviation are at most 0.2° for both max and min.

65 6. SIMULATION RESULTS AND DISCUSSION

Figure 6.15: Maximum, minimum and ideal ratio for steer 0°.

Figure 6.16: Max and min angle deviation for steer 0°.

66 6.10. Steer 10°

6.10 Steer 10°

Figure 6.17 shows the sum and difference signals with 10° steering angle. The black lines show the ideal pattern for both the sum and difference signal. This line can easiest be spotted at 20° and 40°. Compared with Figure 6.9 the pattern differs. The sum for steer 0° has a ´ notch for 30°. For steer 10° the notch at the right side in the graph is more than +30° above ˘ the steer. This notch moves further and further away with the increase of steering angle.

Figure 6.17: Sum and difference with attenuator and phase shifter error enabled for steer 10°.

Figure 6.18 shows the ratio for the phase shifter and attenuator error case. Seen in these figures is that the ratio in the right side of the graph seems to gradually flatten out.

The maximum and minimum angular deviations for steer 10° are shown in Figure 6.19. The blue line is the max angular deviation and the red line is the min angular deviation. The graph shows that the angular deviation are at most 1° for both max and min. Compared with steering angle 0° the angular deviation has increased by around 0.6° around the steer angle. The pattern has no particular form but the minimum deviation has its maximum at the steering angle for both steering 0° and 10°, meaning that it will always be an an- gular deviation at the boresight. This is because of how the difference signal is changing around the steering angle. As can be seen in Figure 6.19, there are spikes with an interval of 5° for some intervals. These spikes are because of the interval of the measured incident angle, 5°.

67 6. SIMULATION RESULTS AND DISCUSSION

Figure 6.18: Ratio with attenuator and phase shifter error for steer 10°.

Figure 6.19: Max and min angular deviation with both errors enabled for steer 10°.

68 6.11. Steer 20°

6.11 Steer 20°

Figure 6.20 shows the sum and difference signals with 20° steering angle. The black lines show the ideal patterns for both the sum and difference signals. These lines can easiest be spotted at 10° and 55°. The signal at the higher incident angle becomes more and more ´ different for higher steering angle. This can be seen in Figure 6.21, which shows the ratio for the phase shifter and attenuator error case.

Figure 6.20: Sum and difference with attenuator and phase shifter error enabled for steer 20°.

Figure 6.21: Ratio with attenuator and phase shifter error for steer 20°.

69 6. SIMULATION RESULTS AND DISCUSSION

The maximum and minimum angular deviations for steer 20° are shown in Figure 6.22. The blue line is the maximum angular deviation and the red line is the minimum angular devi- ation. The graph shows that the angular deviation is at most 2° for maximum and 0.2° for minimum. Compared with steering angle 0° the angular deviation has increased by around 1.4° around the steer angle. The minimum value has a deviation, as usual, at the steering angle.

Figure 6.22: Max and min angular deviation with both errors enabled for steer 20°.

6.12 Steer 30°

Figure 6.23 shows the sum and difference signals with 30° steering angle. The black lines shows the ideal patterns for both the sum and difference signals. These lines can easiest be spotted at 0°. When applying this much steering, the pattern will differ more and more on the right hand side of the graph. Figure 6.24 shows the ratio for the phase shifter and attenuator error case. The notch in the sum plot which was visible in Figure 6.20 is not visible for steer 30° anymore. The notch would appear if the simulations had covered higher angles.

The maximum and minimum angular deviations for steer 30° are shown in Figure 6.25. The blue line is the max angular deviation and the red line is the min angular deviation. The graph shows that the angular deviation is at most 3° for maximum and 0.2° for minimum. Compared with steering angle 0° the angular deviation has increased by around 1.3° around the steer angle. The minimum value has no deviation at the steering angle. The deviation for the maximum case has the same form as for steer 20° but with a higher deviation.

70 6.12. Steer 30°

Figure 6.23: Sum and difference pattern with attenuator and phase shifter error for 30° steer.

Figure 6.24: Ratio with both attenuator and phase shifter error for 30° steer.

71 6. SIMULATION RESULTS AND DISCUSSION

Figure 6.25: Max and min angular deviation with both errors enabled for steer 30°.

6.13 Steer 40°

Figure 6.26 shows the sum and difference signals with 40° steering angle. The black lines shows the ideal patterns for both the sum and difference signals. These lines can easiest be spotted at 5°. For this high steer, the sum signal on the right hand side will not have a notch, similar to steer 30°. Figure 6.27 shows the ratio for the phase shifter and attenuator error case. Because the sum and difference pattern is different at high incident angles the ratio will not have a high value at those angles.

Figure 6.26: Sum difference pattern with attenuator and phase shifter error for 40° steer.

72 6.13. Steer 40°

Figure 6.27: Ratio with attenuator and phase shifter for 40° steer.

The maximum and minimum angular deviations for steer 40° are shown in Figure 6.28. The blue line is the maximum angular deviation and the red line is the minimum angular devi- ation. The graph shows that the angular deviation is at most 5° for maximum and 0.5° for minimum. Compared with steering angle 0° the angular deviation has increased by around 2° around the steer angle. The minimum plot deviates when the ratio is 1 and at the steering angle. The deviation angles are relatively high and increasing for higher incident angles.

Figure 6.28: Maximum and minimum angular deviation with both errors enabled for steer 40°.

73 6. SIMULATION RESULTS AND DISCUSSION

6.14 Steer 50°

Figure 6.29 shows the sum and difference signals with 50° steering angle. The black lines shows the ideal patterns for both the sum and difference signals which are in the middle of all the deviation plots. In the graph it can be seen that the difference signal is not crossing the sum signal for at the right hand side. Meaning that the ratio will not exceed 1 for the simulated incident angles. This result was not expected and will result in a flatter ratio curve as shown in Figure 6.30, where the ratio for the phase shifter and attenuator error case is shown.

Figure 6.29: Sum difference pattern with attenuator and phase shifter error for 50° steer.

Figure 6.30: Ratio with attenuator and phase shifter for 50° steer.

74 6.15. Comparison

The maximum and minimum angular deviations for steer 50° are shown in Figure 6.31. The blue line is the maximum angular deviation and the red line is the minimum angular deviation. The graph shows that the angular deviation is at most 11° for maximum and 0.5° for minimum. Compared with steering angle 0° the angular deviation has increased by 4.2° around the steer angle. The angular min value deviate at the steering angle.

Figure 6.31: Max and min angular deviation with both errors enabled for steer 50°.

6.15 Comparison

In this Section, a comparison between the angular deviations for different steer angles will be presented. In the following figures the deviation for attenuator error, phase shifter error and both errors are shown.

In Figure 6.32 the maximum angular deviation for different steer angles simulations is shown. In this figure it can be seen that the attenuator error does not affect the angular accuracy more than 0.5° for steer below 40°. For steer above 40°, the angular accuracy is more affected by the attenuator error. Giving us a deviation of up to 5°. However, it can also be seen that most of the angular deviation happens around the steer point except for steer 50° where the maximum deviation happens at 85°.

In Figure 6.33, the maximum angular deviation for the different steer angle simulations with phase shifter error enabled is shown. It can be seen by comparing Figure 6.33 and Figure 6.32 the phase shifter error has a bigger impact on the angular accuracy of the receiver than the attenuator error since it in almost all angles in the figure has a higher deviation. The excep- tion is around the steer point where the attenuator error yields similar deviation. Figure 6.33 also shows the same trend as for the attenuator error, that the angular accuracy gets worse with the increase of steering angle.

75 6. SIMULATION RESULTS AND DISCUSSION

Figure 6.32: Angular deviation for all the different steering angles with attenuator error en- abled.

Figure 6.33: Angular deviation for all the different steering angles with phase shifter error enabled.

It also seems that the highest deviation for steer 20° to steer 50° happens around 30° above the steering angle. This could largely be due to the fact that the ratio slope gets flatter at higher incident angles when the steering increases. This can be seen in Figure 6.34, where

76 6.15. Comparison the ideal ratios for the different steer angles are shown. Meaning that the percental deviation has a higher impact on the accuracy in these areas.

Figure 6.34: Ideal ratio for different steer.

Figure 6.35 shows the maximum angular deviation for the case when both errors are en- abled. As can be seen in Figure 6.35, this is the case when the maximum angular deviation is achieved. The maximum deviation seen in the figure is 11.2°.

Figure 6.35: Angular deviation for all the different steering angles with both errors enabled.

77

Chapter Seven

Conclusion and future work

In this Chapter, the project work is concluded. Also, considerations about future work are shortly presented.

7.1 Conclusion

The main task of this project was the realization of a model for a Monopulse Secondary Surveillance Radar in Matlab Simulink. The modeling has focused on blocks that generate and process signals that are specific for Monopulse SSRs. Monopulse SSR in this project assumes antenna array with sum Σ and difference ∆ patterns. The receiver gets a sequence of input signals as coming from the antenna array, calculate the Σ-signal, the ∆-signal and the ∆ ratio signal Σ . From the ratio signal and a look-up table (LUT), the AoA can be identified.

The receiver block model includes models for three main operations: amplification (LNA block), phase shifting and attenuation. After the model implementation in Matlab, simula- tions were performed and results were analyzed and interpreted. The model validation was done through comparison to known results provided by the company in form of a design file. The main expected result from simulations was the Angle-of-Arrival (AoA) as a function of several model parameters.

First, a nominal AoA was calculated for different steering angles. Then, non-ideal cases were modeled in the receiver by assuming random errors in the phase shifter and attenuator parameter values. Then, the difference between nominal and non-ideal calculated AoA was analyzed.

• It was shown that the accuracy of the calculated AoA was mostly dependent on the phase shifter error margins.

• Moreover, the deviation from the ideal case was higher than expected.

• The random deviation of the two component parameters result in higher deviation for higher steering angles.

• The ∆ Σ pattern was deformed when the steering angle increased that also con- ´ tributed to higher deviation.

• Also, the pattern lost its symmetry around the steering angle with increase steering angle.

There are some other aspects of the model that can be concluded. E.g., simulations were per- formed for a static scenario, i.e., both the transmitter and receiver were stationary. However, the model can be used also for the case when both the transmitter and receiver are in motion

79 7. CONCLUSIONANDFUTUREWORK as the Doppler effect is implemented in the Propagation_block.

As for the design aspects of the IFF monopulse receiver, it depends on the field of appli- cation. If the system is implemented with fewer antenna elements it results in a broader sum beam. This broader sum beam results in a ratio pattern which is more prone to bigger angular deviation. However, more antenna elements results in a higher cost for the system.

The choice of components greatly affects the precision of the system and if a high preci- sion system is required, the price of the components increase. However, knowing the angular deviation for the different steer angles you could implement this deviation into the look-up tables to reduce the angular deviation.

7.2 Future work

The measurements of the ideal patterns for the different steer angles could have better preci- sion. This would give a better precision for the angular deviation, higher than 0.2°. Smaller interval for the measurements of the non-ideal error data to get a smoother graph. More measurements per incident angle could be made to get a better and more accurate mathe- matical result, not just 10 measurements. All these aspects will give a more reliable result.

The attenuator value could be changed to see how much it would affects the result. The attenuator value could be implemented to be changed depending on the amount of steering.

An easy way to set the inputs could be implement, for example the position of the transmit- ter. The entire model could be compatible with an interface which contain both a command panel and results.

There are more components in the receiver chain that could be investigated for instance the WPD and the rat race.

More error sources could be implemented such as: white noise, thermal effects and non- ideal antennas could be used. Measurements could also be done for already implemented parameters such as how the angular accuracy is affected by the velocity of the transmitting and receiving aircrafts.

80 Bibliography

[2] Constantine A. Balanis. “Antenna Theory Analysis And Design Second Edition”. In: John Wiley and sons (1997). [3] Samuel M. Sherman. David K. Barton. “Monopulse Principles and Techniques”. In: Artech House (2011). [4] Marek Borejko. “Monopulse IFF interrogator antenna with optimised parameters, min- imising the possibility of generating false replies by transponder”. In: (). [6] Michael C.Stevens. “Secondary Surveillance Radar”. In: (1988). [9] G. Jacovitti. “Performance analysis of monopulse receivers for secondary surveillance radar”. In: (1983). [10] W Kołosowski. E S˛edek.M Borejko. A Jeziorski. “Monopulse of IFF antennas”. In: (). [12] International Civil Aviation Organization. “Agenda item 3: Overview of Primary and Secondary Surveillance Radars”. In: (2011). [13] David M. Pozar. “Microwave and RF design of systems”. In: John Wiley and sons (2001). [14] David M. Pozar. “Microwave engineering, Fourth edition”. In: John Wiley and sons (2011). [15] Cai Fei. Fan Hongqi. Song Zhiyong. Fu Qiang. “Difference beam aided target detection in monopulse radar”. In: (2015). [16] Bassem R.Mahafza. “Radar Systems Analysis And Design Using Matlab”. In: CRC Press (2013). [18] Shaun Quegan Simon Kingsley. “Understanding Radar Systems”. In: SciTech Publishing (1999). [21] Christian Wolff. “Internet: The Reply message”. In: (2018).

81

Webography

[1] Attenuator. AT-264. URL: https : / / www . rf - microwave . com / resources / products_attachments/5a4386c8af228.pdf. (accessed: 03.19.2018). [5] Cisco. Antenna patterns and their meaning. URL: https://www.cisco.com/c/en/ us/products/collateral/wireless/aironet- antennas- accessories/ prod_white_paper0900aecd806a1a3e.html. (accessed: 12.04.2018). [7] Peter M. Grant. CDMA Array Processing: Why use a receive array? URL: http://www. wirelesscommunication.nl/reference/chaptr05/cdma/cdmaarr1.htm. (accessed: 12.03.2018). [8] Illumin. Motion Sensors. URL: http : / / illumin . usc . edu / 165 / motion - sensors/. (accessed:01.09.2016). [11] Matlab. Blocklist. URL: https://se.mathworks.com/help/simulink/block- libraries.html. (accessed: 12.04.2018). [17] Phase shifter. Weinschel model 984-1. URL: http : / / weinschel . apitech . com / weinschel/pdfiles/wmod984.pdf. (accessed: 03.19.2018). [19] Wiki. Phased Array. URL: https://en.wikipedia.org/wiki/Phased_array. (accessed:04.12.2016). [20] Christian Wolff. Dynamic Range of a Receiver. URL: http://www.radartutorial. eu/09.receivers/rx52.en.html. (accessed: 12.03.2018).

83 Appendices

A Simulink blocks

The complete blocks used for the model in Simulink are listed here. Most of the descriptions are taken from Mathworks. [11]

dB gain. The dB Gain block multiplies the input by the decibel values specified in the Gain parameter.

Complex to Magnitude-Angle. The Complex to Magnitude-Angle block outputs the magnitude and/or phase angle of the input signal, depending on the setting of the Output parameter. The outputs are real values of the same data type as the block input. The input can be an array of complex signals, in which case the output signals are also arrays. The magnitude signal array contains the magnitudes of the corresponding complex input elements. The angle output similarly contains the angles of the input elements.

Max value. Saves the maximum value of the simulated data.

dB converter. The dB Conversion block converts a linearly scaled power or amplitude input to dB or dBm. The reference power is 1 Watt for conversions to dB and 1 mWatt for conversions to dBm.

Math Function block. The Math Function block performs numerous com- mon mathematical functions.

MATLAB Function. With a MATLAB Function block, you can write a MATLAB® function for use in a Simulink® model. The MATLAB function you create executes for simulation and generates code for a Simulink Coder™ target. Double-clicking the MATLAB Function block opens its editor, where you write the MATLAB function.

Random integer. The Random Integer Generator block generates uniformly distributed random integers in the range [0, M-1], where M is the Set size defined in the dialog box.

Data Store Memory. The Data Store Memory block defines and initializes a named shared data store, which is a memory region usable by Data Store Read and Data Store Write blocks that specify the same data store name. WEBOGRAPHY

Radian to degree, degree to radian. Converts radian value to degree value. In the block it can be set to convert degree value to radian value.

Toggle switch. The Toggle Switch block toggles the value of the connected block parameter between two values during simulation. For example, you can connect the Toggle Switch block to a Switch block in your model and change its state during simulation. Use the Toggle Switch block with other Dashboard blocks to create an interactive dashboard for your model.

Complex to Real-Imag. The Complex to Real-Imag block outputs the real and/or imaginary part of the input signal, depending on the setting of the Output parameter. The real outputs are of the same data type as the complex input. The input can be an array (vector or matrix) of complex signals, in which case the output signals are arrays of the same dimensions. The real array contains the real parts of the corresponding complex input elements. The imaginary output similarly contains the imaginary parts of the input elements.

Complex phase difference. The Complex Phase Difference block accepts two complex input signals that have the same size and frame status. The output is the phase difference from the second to the first, measured in radians. The elements of the output are between π and π. ´ To file. The To File block inputs a signal and writes the signal data into a MAT-file. Use the To File block to log signal data. B. Matlab code

B Matlab code

Read to mat-file

1 function to_file = to_matfile(ratio,sum,diff,theta) 2 3 to_file = [ratio sum diff theta]; 4 5 end

Data sorting function which writes data from the simulations into variables in the workspace.

1 row = 9; 2 3 load('Results.mat'); 4 load('Results2.mat'); 5 load('Results3.mat'); 6 load('Results4.mat'); 7 8 s_a = size(sim_results_attenuator); 9 s_p = size(sim_results_phase_shifter); 10 11 s_a_p = size(sim_results_attenuator_phaseshifter); 12 13 DS_a_p(row,1) = sim_results_attenuator_phaseshifter(2,s_a_p(2)); 14 DS_a_p(row,2:(s_a_p(1)-1)) = ... sim_results_attenuator_phaseshifter(3:s_a_p(1),s_a_p(2)); 15 DS_a(row,1) = sim_results_attenuator(2,s_a(2)); 16 DS_a(row,2:(s_a(1)-1)) = sim_results_attenuator(3:s_a(1),s_a(2)); 17 DS_p(row,1) = sim_results_phase_shifter(2,s_p(2)); 18 DS_p(row,2:(s_p(1)-1)) = sim_results_phase_shifter(3:s_p(1),s_p(2));

Position generator code. Generates the position of the transmitter for different angles with the same distance.

1 Pos_rec = [0 0 0]; 2 distance = 10000; 3 precision = 0.2; 4 angle1 = -50; 5 angle2 = 50; 6 7 x = angle1; 8 i = 1; 9 while le(x,angle2) 10 angle_steps(i) = x; 11 x = x + precision; 12 i = i+1; 13 end 14 if angle_steps(i-1) ‰ angle2 15 angle_steps(i) = angle2; 16 end 17 j = 1; 18 while le(j,length(angle_steps)) 19 yvarde = sin(deg2rad(angle_steps(j)))*distance; 20 xvarde = cos(deg2rad(angle_steps(j)))*distance; 21 Save(j,:) = [angle_steps(j) xvarde yvarde]; 22 j = j+1; 23 end WEBOGRAPHY

Ratio and sum/diff extractor

1 %% Ratio extractor 2 file = DS_ideal; % File name in the workspace here 3 file_size = size(file); 4 5 ratio_file(:,1) = file(:,1); 6 i = 1; 7 8 while le(i,file_size(1)+2) 9 u = 2; 10 p = 2; 11 while le(p,file_size(2)) 12 ratio_file(i,u) = file(i,p); 13 p = p + 3; 14 u = u +1; 15 end 16 i = i + 1; 17 end

Ratio plotter

1 % Ratio plotter 2 file = DS_ideal_r; 3 file_size = size(file); 4 steer = 50; % Change the steer 5 6 % put to = inf if you want all of the data showed in the plot 7 % limits the plot on the x-axis to this value on both positive and negative side. 8 limit_degree = 40; 9 limit_amplitude = 4; 10 11 if steer ‰ 0 12 lim_degree_min = steer - limit_degree; 13 lim_degree_max = steer + limit_degree; 14 else 15 lim_degree_min = -limit_degree; 16 lim_degree_max = limit_degree; 17 end 18 19 i = 2; 20 21 while le(i,file_size(1)-1) 22 hold on 23 plot(file(:,1),file(:,i)) 24 title('Ratio deviation') 25 xlabel('Incident angle[]') 26 ylabel('Ratio') 27 xlim([lim_degree_min lim_degree_max]) 28 ylim([0 limit_amplitude]) 29 i = i + 1; 30 end B. Matlab code

Sum diff extractor

1 %% SUM DIFF EXTRACTOR 2 file = DS_ideal; 3 file_size = size(file); 4 5 sum_diff_file(:,1) = file(:,1); 6 i = 1; 7 8 while le(i,file_size(1)+2) 9 u = 2; 10 p = 3; 11 while le(p,file_size(2)) 12 sum_diff_file(i,u) = file(i,p); 13 sum_diff_file(i,u+1) = file(i,p+1); 14 p = p + 3; 15 u = u +2; 16 end 17 i = i + 1; 18 end dB conversion

1 %% To dB 2 file = sum_diff_file; 3 file_size = size(file); 4 5 sum_diff_file2(:,1) = file(:,1); 6 i = 1; 7 8 while le(i,file_size(1)+2) 9 u = 2; 10 while le(u,file_size(2)) 11 sum_diff_file2(i,u) = mag2db(file(i,u)); 12 u = u +1; 13 end 14 i = i + 1; 15 end WEBOGRAPHY

Sum diff plot

1 %% sum diff plotter 2 file = sum_diff_file2; 3 file_size = size(file); 4 5 % put to = inf if you want all of the data showed in the plot 6 % limits the plot on the x-axis to this value on both positive and negative side. 7 limit_degree = 40; 8 limit_amplitude = inf; 9 10 if steer ‰ 0 11 lim_degree_min = steer - limit_degree; 12 lim_degree_max = steer + limit_degree; 13 else 14 lim_degree_min = -limit_degree; 15 lim_degree_max = limit_degree; 16 end 17 18 figure() 19 i = 2; 20 while le(i,file_size(1)) 21 hold on 22 plot(file(:,1),file(:,i)) 23 title('Sum diff deviation') 24 xlabel('Incident angle[]') % x-axis label 25 ylabel('Magnitude [dBW]') % y-axis label 26 xlim([lim_degree_min lim_degree_max]) 27 ylim([-190 limit_amplitude]) 28 i = i + 1; 29 end

Deviation calculations

1 % ideal file must have ratio at column 2. 2 % non ideal file must consist of only ratios at columns 2.. inf 3 steer = 50; 4 ideal_file = DS_ideal; 5 non_ideal_file = DS_a_p_r; 6 size_ideal = size(ideal_file); 7 size_non_ideal = size(non_ideal_file); 8 if steer == 20 9 ideal_file = ideal_file(12:202,1:2); 10 non_ideal_file = non_ideal_file(3:16,:); 11 elseif steer == 10 12 ideal_file = ideal_file(30:135,1:2); 13 non_ideal_file = non_ideal_file(3:15,:); 14 elseif steer == 0 15 ideal_file = ideal_file(16:204,:); 16 non_ideal_file = non_ideal_file(3:15,:); 17 elseif steer == 30 18 ideal_file = ideal_file(12:size_ideal(1),:); 19 non_ideal_file = non_ideal_file(3:size_non_ideal(1),:); 20 elseif steer == 40 21 ideal_file = ideal_file(12:size_ideal(1),1:2); 22 non_ideal_file = non_ideal_file(2:size_non_ideal(1),:); 23 elseif steer == 50 24 ideal_file = ideal_file(5:size_ideal(1),1:2); 25 non_ideal_file = non_ideal_file(2:size_non_ideal(1),:); 26 27 end B. Matlab code

1 size_ideal_file = size(ideal_file); 2 size_non_ideal = size(non_ideal_file); 3 4 xlim_max = non_ideal_file(size_non_ideal(1),1); 5 xlim_min = non_ideal_file(1,1); 6 7 plot(ideal_file(:,1),ideal_file(:,2)) 8 xlim([xlim_min xlim_max]) 9 ylim([0 5]) 10 title('Ideal ratio') 11 ylabel('Ratio') 12 xlabel('Incident angle[]') 13 14 dev_file = zeros(size_non_ideal); 15 dev_file(:,1) = non_ideal_file(:,1); 16 dev_file_procent(:,1) = non_ideal_file(:,1); 17 i = 1; 18 while le(i,size_non_ideal(1)) 19 value_check = 0; 20 save_value = 0; 21 save_row = 1; 22 row = 1; 23 while le(row,size_ideal_file(1)) 24 value_check = abs(ideal_file(row,1) - non_ideal_file(i,1)); 25 if ge(row,2) 26 if le(value_check,save_value) 27 save_value = value_check; 28 save_row = row; 29 end 30 else 31 save_value = value_check; 32 end 33 row = row + 1; 34 end 35 row_angle = save_row; 36 io = 1; 37 while le(io,size_non_ideal(2)-1) 38 dev_file(i,1+io) = abs(ideal_file(row_angle,2)-non_ideal_file(i,1+io)); 39 dev_file_procent(i,1+io) = dev_file(i,1+io)/ideal_file(row_angle,2); 40 io = io + 1; 41 end 42 i = i + 1; 43 end 44 45 dev_file_procent_max(:,1) = dev_file_procent(:,1); 46 size_procent = size(dev_file_procent); 47 mo = 1; 48 while le(mo,size_procent(1)) 49 dev_file_procent_max(mo,2) = max(dev_file_procent(mo,2:size_procent(2))); 50 mo = mo + 1; 51 end 52 53 dev_file_procent_min(:,1) = dev_file_procent(:,1); 54 size_procent = size(dev_file_procent); 55 mo = 1; 56 while le(mo,size_procent(1)) 57 dev_file_procent_min(mo,2) = min(dev_file_procent(mo,2:size_procent(2))); 58 mo = mo + 1; 59 end WEBOGRAPHY

Plot settings for ratio deviation

1 %% plotting 2 i = 1; 3 figure() 4 while le(i,size_non_ideal(2)-1) 5 hold on 6 subplot(2,1,1) 7 plot(dev_file(:,1),dev_file(:,i+1)) 8 ylim([-inf 0.5]) 9 xlim([xlim_min xlim_max]) 10 title('Ratio deviation') 11 ylabel('Ratio') 12 xlabel('Incident angle[]') 13 hold on 14 subplot(2,1,2) 15 plot(dev_file_procent(:,1),dev_file_procent(:,i+1)) 16 ylim([0 0.5]) 17 xlim([xlim_min xlim_max]) 18 title('Ratio deviation %') 19 ylabel('Deviation[]') 20 xlabel('Incident angle[]') 21 hold on 22 23 i = i+1; 24 end 25 figure() 26 subplot(2,1,1) 27 plot(dev_file_procent_max(:,1),dev_file_procent_max(:,2)) 28 ylim([0 1.5]) 29 xlim([xlim_min xlim_max]) 30 title('Ratio deviation procentual max') 31 ylabel('Deviation max []') 32 xlabel('Incident angle[]') 33 subplot(2,1,2) 34 plot(dev_file_procent_min(:,1),dev_file_procent_min(:,2)) 35 ylim([0 0.1]) 36 xlim([xlim_min xlim_max]) 37 ylabel('Deviation min[]') 38 xlabel('Incident angle[]') 39 title('Ratio deviation procentual min') B. Matlab code

Angle deviation calculation

1 %% Angle deviation calculation (MAX ERROR) 2 max_error_ratio(:,1) = dev_file_procent_max(:,1); 3 min_error_ratio(:,1) = dev_file_procent_max(:,1); 4 i = 1; 5 6 while le(i, size_non_ideal(1)) % create maximum error ratio dataset 7 value_check = 0; 8 save_value = 0; 9 ideal_row = 1; 10 row = 1; 11 while le(row,size_ideal_file(1)) 12 value_check = abs(ideal_file(row,1) - dev_file_procent_max(i,1)); 13 if ge(row,2) 14 if le(value_check,save_value) 15 save_value = value_check; 16 ideal_row = row; 17 end 18 else 19 save_value = value_check; 20 end 21 row = row + 1; 22 end 23 % Find steer row 24 value_check = 0; 25 save_value = 0; 26 row_steer = 1; 27 row = 1; 28 while le(row,size_ideal_file(1)) 29 value_check = abs(ideal_file(row,1) - steer); 30 if ge(row,2) 31 if le(value_check,save_value) 32 save_value = value_check; 33 row_steer = row; 34 end 35 else 36 save_value = value_check; 37 end 38 row = row + 1; 39 end 40 % Maximum/minimum error ideal ratio + (ideal ratio * max percentage deviation) 41 max_error_ratio(i,2) = ideal_file(ideal_row,2) + ... (ideal_file(ideal_row,2).*dev_file_procent_max(i,2)); 42 min_error_ratio(i,2) = ideal_file(ideal_row,2) + ... (ideal_file(ideal_row,2).*dev_file_procent_min(i,2)); 43 44 if le(max_error_ratio(i,1),steer) 45 max_iteration = row_steer; 46 else 47 max_iteration = size_ideal_file(1)-row_steer; 48 end WEBOGRAPHY

Continued...

1 % find the corresponding angle 2 y2 = 0; 3 s2 = 1; 4 s = 1; 5 while le(s,max_iteration) 6 if le(max_error_ratio(i,1),steer) 7 ambiguity = 0; 8 y1 = abs(ideal_file(s,2) - max_error_ratio(i,2)); 9 else 10 ambiguity = 1; 11 y1 = abs(ideal_file(row_steer+s,2) - max_error_ratio(i,2)); 12 end 13 if s == 1 14 y2 = y1; 15 end 16 if le(y1,y2) 17 y2 = y1; 18 if ambiguity == 1 19 s2 = row_steer + s; 20 else 21 s2 = s; 22 end 23 end 24 s = s + 1; 25 end 26 angle_deviation_maximum(i,1) = dev_file_procent_max(i,1); 27 angle_deviation_maximum(i,2) = abs(max_error_ratio(i,1)-ideal_file(s2,1)); 28 p2 = 0; 29 u2 = 1; 30 u = 1; 31 while le(u,max_iteration) 32 if le(min_error_ratio(i,1),steer) 33 ambiguity = 0; 34 y1 = abs(ideal_file(u,2) -min_error_ratio(i,2)); 35 else 36 ambiguity = 1; 37 y1 = abs(ideal_file(row_steer+u,2) - min_error_ratio(i,2)); 38 end 39 if u == 1 40 p2 = y1; 41 end 42 if le(y1,p2) 43 p2 = y1; 44 if ambiguity == 1 45 u2 = row_steer + u; 46 else 47 u2 = u; 48 end 49 end 50 u = u + 1; 51 end 52 angle_deviation_minimum(i,1) = dev_file_procent_min(i,1); 53 angle_deviation_minimum(i,2) = abs(min_error_ratio(i,1)-ideal_file(u2,1)); 54 if le(angle_deviation_minimum(i,2),0.19) 55 angle_deviation_minimum(i,2) = 0; 56 end 57 i = i + 1; 58 end B. Matlab code

Plot

1 %% plot 2 figure() 3 plot(max_error_ratio(:,1),max_error_ratio(:,2)) 4 ylim([0 5]) 5 xlim([xlim_min xlim_max]) 6 hold on 7 title('Ideal ratio*(1+max procentual deviation)') 8 ylabel('Ratio') 9 xlabel('Incident angle[]') 10 figure() 11 plot(angle_deviation_maximum(:,1),angle_deviation_maximum(:,2)) 12 ylim([0 inf]) 13 xlim([xlim_min xlim_max]) 14 hold on 15 title('Max deviation in angles') 16 ylabel('Degrees[]') 17 xlabel('Incident angle[]') 18 19 figure() 20 plot(min_error_ratio(:,1),min_error_ratio(:,2)) 21 ylim([0 5]) 22 xlim([xlim_min xlim_max]) 23 hold on 24 title('Ideal ratio*(1+min procentual deviation)') 25 ylabel('Ratio') 26 xlabel('Incident angle[]') 27 figure() 28 plot(angle_deviation_minimum(:,1),angle_deviation_minimum(:,2)) 29 ylim([0 inf]) 30 xlim([xlim_min xlim_max]) 31 hold on 32 ylabel('Degrees[]') 33 xlabel('Incident angle[]') 34 title('Min deviation in angles')