# step

System object: phased.ArrayGain
Package: phased

Calculate array gain of sensor array

## Syntax

```G = step(H,FREQ,ANG) G = step(H,FREQ,ANG,WEIGHTS) G = step(H,FREQ,ANG,STEERANGLE) G = step(H,FREQ,ANG,WEIGHTS,STEERANGLE) G = step(H,FREQ,ANG,WS) ```

## Description

Note

Starting in R2016b, instead of using the `step` method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, ```y = step(obj,x)``` and `y = obj(x)` perform equivalent operations.

`G = step(H,FREQ,ANG)` returns the array gain `G` of the array for the operating frequencies specified in `FREQ` and directions specified in `ANG`.

`G = step(H,FREQ,ANG,WEIGHTS)` applies weights `WEIGHTS` on the sensor array. This syntax is available when you set the `WeightsInputPort` property to `true`.

`G = step(H,FREQ,ANG,STEERANGLE)` uses `STEERANGLE` as the subarray steering angle. This syntax is available when you configure `H` so that `H.Sensor` is an array that contains subarrays, and `H.Sensor.SubarraySteering` is either `'Phase'` or `'Time'`.

`G = step(H,FREQ,ANG,WEIGHTS,STEERANGLE)` combines all input arguments. This syntax is available when you configure `H` so that `H.WeightsInputPort` is `true`, `H.Sensor` is an array that contains subarrays, and `H.Sensor.SubarraySteering` is either `'Phase'` or `'Time'`.

`G = step(H,FREQ,ANG,WS)` uses `WS` as weights applied to each element within each subarray. To use this syntax, set the `SensorArray` property to an array that supports subarrays and set the `SubarraySteering` property of the array to `'Custom'`.

Note

The object performs an initialization the first time the object is executed. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the System object issues an error. To change nontunable properties or inputs, you must first call the `release` method to unlock the object.

## Input Arguments

`H`

Array gain object.

`FREQ`

Operating frequencies of array in hertz. `FREQ` is a row vector of length L. Typical values are within the range specified by a property of the sensor element. The element is `H.SensorArray.Element`, `H.SensorArray.Array.Element`, or `H.SensorArray.Subarray.Element`, depending on the type of array. The frequency range property is named `FrequencyRange` or `FrequencyVector`, depending on the type of element in the array. The element has zero response at frequencies outside that range.

`ANG`

Directions in degrees. `ANG` can be either a 2-by-M matrix or a row vector of length M.

If `ANG` is a 2-by-M matrix, each column of the matrix specifies the direction in the form [azimuth; elevation]. The azimuth angle must be between –180 and 180 degrees, inclusive. The elevation angle must be between –90 and 90 degrees, inclusive.

If `ANG` is a row vector of length M, each element specifies a direction’s azimuth angle. In this case, the corresponding elevation angle is assumed to be 0.

`WEIGHTS`

Weights on the sensor array. `WEIGHTS` can be either an N-by-L matrix or a column vector of length N. N is the number of subarrays if `H.SensorArray` contains subarrays, or the number of elements otherwise. L is the number of frequencies specified in `FREQ`.

If `WEIGHTS` is a matrix, each column of the matrix represents the weights at the corresponding frequency in `FREQ`.

If `WEIGHTS` is a vector, the weights apply at all frequencies in `FREQ`.

`STEERANGLE`

Subarray steering angle in degrees. `STEERANGLE` can be a length-2 column vector or a scalar.

If `STEERANGLE` is a length-2 vector, it has the form [azimuth; elevation]. The azimuth angle must be between –180 and 180 degrees, and the elevation angle must be between –90 and 90 degrees.

If `STEERANGLE` is a scalar, it represents the azimuth angle. In this case, the elevation angle is assumed to be 0.

`WS`

Subarray element weights

Subarray element weights, specified as complex-valued NSE-by-N matrix or 1-by-N cell array where N is the number of subarrays. These weights are applied to the individual elements within a subarray.

Subarray element weights

Sensor ArraySubarray weights
`phased.ReplicatedSubarray`

All subarrays have the same dimensions and sizes. Then, the subarray weights form an NSE-by-N matrix. NSE is the number of elements in each subarray and N is the number of subarrays. Each column of `WS` specifies the weights for the corresponding subarray.

`phased.PartitionedArray`

Subarrays may not have the same dimensions and sizes. In this case, you can specify subarray weights as

• an NSE-by-N matrix, where NSE is now the number of elements in the largest subarray. The first Q entries in each column are the element weights for the subarray where Q is the number of elements in the subarray.

• a 1-by-N cell array. Each cell contains a column vector of weights for the corresponding subarray. The column vectors have lengths equal to the number of elements in the corresponding subarray.

#### Dependencies

To enable this argument, set the `SensorArray` property to an array that contains subarrays and set the `SubarraySteering` property of the array to `'Custom'`.

## Output Arguments

 `G` Gain of sensor array, in decibels. `G` is an M-by-L matrix. `G` contains the gain at the M angles specified in `ANG` and the L frequencies specified in `FREQ`.

## Examples

expand all

Construct a uniform linear array (ULA) having six elements and operating at 1 GHz. The array elements are spaced at one-half the operating wavelength. Find the array gain in dB in the direction 45° azimuth and 10° elevation.

Create the `phased.ArrayGain` System object™.

```fc = 1e9; lambda = physconst('LightSpeed')/fc; array = phased.ULA('NumElements',6,'ElementSpacing',lambda/2); gain = phased.ArrayGain('SensorArray',array);```

Determine array gain at the specified operating frequency and angle.

`arraygain = gain(fc,[45;10])`
```arraygain = -17.9275 ```