# doa

Calculate direction of arrival of plane-wave excitation object

## Syntax

``[phiArrival,thetaArrival] = doa(planewaveobject,frequency)``

## Description

example

````[phiArrival,thetaArrival] = doa(planewaveobject,frequency)` calculates and plots the direction of arrival of a plane-wave excitation object.```

## Examples

collapse all

Calculate the direction of arrival of the plane-wave excitation object. The receiver element is a linear array of dipoles at 2.4 GHz. Set the azimith and elevation angles.

```azimuthRef =10; elevationRef = 30; f = 2.4e9; lambda = 3e8/f;```

Design a dipole antenna using the specified frequency.

```d = design(dipole,f); d.Tilt = 90;```

Create a linear array and view it.

```ant = linearArray('Element',d,'NumElements',10,'ElementSpacing',0.5*lambda); show(ant)``` Create a plane-wave excitation object using the dipole array.

```pw = planeWaveExcitation('Element', ant, 'Direction', ... [sind(elevationRef)*cosd(azimuthRef) sind(elevationRef)*sind(azimuthRef) -cosd(elevationRef)], ... 'Polarization', [cosd(elevationRef)*cosd(azimuthRef) cosd(elevationRef)*sind(azimuthRef) sind(elevationRef)]);```

Calculate the direction of arrival.

`[phiArrival, thetaArrival] = doa(pw,f)`
```phiArrival = 10 ```
```thetaArrival = 29.8904 ```

## Input Arguments

collapse all

Plane-wave excitation object, specified as a `planeWaveExcitation` object.

Frequency for calculating the direction of arrival, specified as a scalar or a vector.

## Algorithms

In order to estimate the direction of arrival, you need to make use of the of the fundamentals of RF propagation from the transmission of the signal to the reception of the signal. The phase of a far-field ER(r) received signal at an individual antenna is:

`${E}_{R}\left(r\right)\text{\hspace{0.17em}}\alpha \text{\hspace{0.17em}}{e}^{j\beta r}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left(1\right)$`

where β is the propagation constant of the received signal and r is the distance between the transmit and receive elements.

For a given transmit antenna, the position of the antenna element is:

`${x}_{tx}=\rho \mathrm{cos}\left(\phi \right)\mathrm{sin}\left(\theta \right)\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left(2\right)$`

`${y}_{tx}=\rho \mathrm{sin}\left(\phi \right)\mathrm{sin}\left(\theta \right)\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left(3\right)$`

`${z}_{tx}=\rho \mathrm{cos}\left(\theta \right)\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left(4\right)$`

where ρ is the distance between the transmit element and the geometrical midpoint of the receive antenna array. θ is the elevation angle or the angular position of the transmit element referenced from the Z-axis. φ is the azimuth angle that lies in the X-Y plane.

Assume that the receiving array satisfies the following criteria:

1. The receiving array is a homogenous linear or rectangular array with identical elements.

2. The receiving array is a uniform array where the separation between two adjacent elements of the array is uniform. Specify the position of the elements in a receive array using `ElementSpacing` (dspace) for a linear array; and `RowSpacing` (drow) and `ColumnSpacing` (dcol) for a rectangular array.

3. The receiving array has equal number of elements along each axis number of elements along each axis of the array is even. Specify the number of elements in the receive array can using `NumElements` (Nelem) for a linear array and size ([Nrow Ncol]) for a rectangular array.

For a Uniform Linear Array (ULA) where the receive array elements lie along the x-axis, the position of the elements is:

`${x}_{po{s}_{n}}=\frac{{d}_{space}}{2}\left({N}_{elem}+1-2n\right)\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left(5\right)$`

where Nelem is the number of elements in the ULA and n is the receive array element number.

For the Uniform Rectangular Array (URA), which lies in the xy-plane, the position of the receive array elements along the x and y axis is:

`${x}_{po{s}_{n}}=\frac{{d}_{col}}{2}\left({N}_{elem}+1-2n\right)\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left(6\right)$`

`${y}_{po{s}_{n}}=\frac{{d}_{row}}{2}\left({M}_{elem}+1-2m\right)\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left(7\right)$`

where Nelem is the number of elements in the URA along the x-axis, n denotes a particular receive array element along the x-axis, Melem is the number of elements for the URA along the y-axis, m denotes a particular receive array element along the y-axis.

Consider a single-antenna transmitter located at (xtx, ytx, ztx). You can determine the far-field separation of r between the receiving array element and the transmitter by:

`${r}_{n}=\sqrt{{\left({x}_{tx}-{x}_{po{s}_{n}}\right)}^{2}+{\left({y}_{tx}\right)}^{2}+{\left({z}_{tx}\right)}^{2}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{(ULA)}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left(8\right)$`

`${r}_{m,n}=\sqrt{{\left({x}_{tx}-{x}_{po{s}_{n}}\right)}^{2}+{\left({y}_{tx}-{y}_{po{s}_{n}}\right)}^{2}+{\left({z}_{tx}\right)}^{2}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{(URA)}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left(9\right)$`

Based on these equations you can determine the doa for elevation and azimuth angles using the phase of the electric field, which is computed through full-wave electromagnetic simulation.

## Version History

Introduced in R2022a