# phased.gpu.ConstantGammaClutter System object

Package: phased.gpu

Constant gamma clutter simulation on GPU

## Description

The `phased.gpu.ConstantGammaClutter` object simulates clutter, performing the computations on a GPU.

 Note:   To use this object, you must install a Parallel Computing Toolbox™ license and have access to an appropriate GPU. For more about GPUs, see GPU Computing in the Parallel Computing Toolbox documentation.

To compute the clutter return:

1. Define and set up your clutter simulator. See Construction.

2. Call `step` to simulate the clutter return for your system according to the properties of `phased.gpu.ConstantGammaClutter`. The behavior of `step` is specific to each object in the toolbox.

The clutter simulation that `ConstantGammaClutter` provides is based on these assumptions:

• The radar system is monostatic.

• The propagation is in free space.

• The terrain is homogeneous.

• The clutter patch is stationary during the coherence time. Coherence time indicates how frequently the software changes the set of random numbers in the clutter simulation.

• The signal is narrowband. Thus, the spatial response can be approximated by a phase shift. Similarly, the Doppler shift can be approximated by a phase shift.

• The radar system maintains a constant height during simulation.

• The radar system maintains a constant speed during simulation.

## Construction

`H = phased.gpu.ConstantGammaClutter` creates a constant gamma clutter simulation System object™, `H`. This object simulates the clutter return of a monostatic radar system using the constant gamma model.

`H = phased.gpu.ConstantGammaClutter(Name,Value)` creates a constant gamma clutter simulation object, `H`, with additional options specified by one or more `Name,Value` pair arguments. `Name` is a property name, and `Value` is the corresponding value. `Name` must appear inside single quotes (`''`). You can specify several name-value pair arguments in any order as `Name1,Value1,…,NameN,ValueN`.

## Properties

`Sensor`

Handle of sensor

Specify the sensor as an antenna element object or as an array object whose `Element` property value is an antenna element object. If the sensor is an array, it can contain subarrays.

Default: `phased.ULA` with default property values

`PropagationSpeed`

Signal propagation speed

Specify the propagation speed of the signal, in meters per second, as a positive scalar.

Default: Speed of light

`OperatingFrequency`

System operating frequency

Specify the operating frequency of the system in hertz as a positive scalar. The default value corresponds to 300 MHz.

Default: `3e8`

`SampleRate`

Sample rate

Specify the sample rate, in hertz, as a positive scalar. The default value corresponds to 1 MHz.

Default: `1e6`

`PRF`

Pulse repetition frequency

Specify the pulse repetition frequency in hertz as a positive scalar or a row vector. The default value of this property corresponds to 10 kHz. When `PRF` is a vector, it represents a staggered PRF. In this case, the output pulses use elements in the vector as their PRFs, one after another, in a cycle.

Default: `1e4`

`Gamma`

Terrain gamma value

Specify the $\gamma$ value used in the constant $\gamma$ clutter model, as a scalar in decibels. The $\gamma$ value depends on both terrain type and the operating frequency.

Default: `0`

`EarthModel`

Earth model

Specify the earth model used in clutter simulation as one of | `'Flat'` | `'Curved'` |. When you set this property to `'Flat'`, the earth is assumed to be a flat plane. When you set this property to `'Curved'`, the earth is assumed to be a sphere.

Default: `'Flat'`

`PlatformHeight`

Specify the radar platform height (in meters) measured upward from the surface as a nonnegative scalar.

Default: `300`

`PlatformSpeed`

Specify the radar platform's speed as a nonnegative scalar in meters per second.

Default: `300`

`PlatformDirection`

Specify the direction of radar platform motion as a 2-by-1 vector in the form [AzimuthAngle; ElevationAngle] in degrees. The default value of this property indicates that the platform moves perpendicular to the radar antenna array's broadside.

Both azimuth and elevation angle are measured in the local coordinate system of the radar antenna or antenna array. Azimuth angle must be between –180 and 180 degrees. Elevation angle must be between –90 and 90 degrees.

Default: `[90;0]`

`BroadsideDepressionAngle`

Specify the depression angle in degrees of the broadside of the radar antenna array. This value is a scalar. The broadside is defined as zero degrees azimuth and zero degrees elevation. The depression angle is measured downward from horizontal.

Default: `0`

`MaximumRange`

Maximum range for clutter simulation

Specify the maximum range in meters for the clutter simulation as a positive scalar. The maximum range must be greater than the value specified in the `PlatformHeight` property.

Default: `5000`

`AzimuthCoverage`

Azimuth coverage for clutter simulation

Specify the azimuth coverage in degrees as a positive scalar. The clutter simulation covers a region having the specified azimuth span, symmetric to 0 degrees azimuth. Typically, all clutter patches have their azimuth centers within the region, but the `PatchAzimuthWidth` value can cause some patches to extend beyond the region.

Default: `60`

`PatchAzimuthWidth`

Azimuth span of each clutter patch

Specify the azimuth span of each clutter patch in degrees as a positive scalar.

Default: `1`

`TransmitSignalInputPort`

Add input to specify transmit signal

Set this property to `true` to add input to specify the transmit signal in the `step` syntax. Set this property to `false` omit the transmit signal in the `step` syntax. The `false` option is less computationally expensive; to use this option, you must also specify the `TransmitERP` property.

Default: `false`

`TransmitERP`

Effective transmitted power

Specify the transmitted effective radiated power (ERP) of the radar system in watts as a positive scalar. This property applies only when you set the `TransmitSignalInputPort` property to `false`.

Default: `5000`

`CoherenceTime`

Clutter coherence time

Specify the coherence time in seconds for the clutter simulation as a positive scalar. After the coherence time elapses, the `step` method updates the random numbers it uses for the clutter simulation at the next pulse. A value of `inf` means the random numbers are never updated.

Default: `inf`

`OutputFormat`

Output signal format

Specify the format of the output signal as one of | `'Pulses'` | `'Samples'` |. When you set the `OutputFormat` property to `'Pulses'`, the output of the `step` method is in the form of multiple pulses. In this case, the number of pulses is the value of the `NumPulses` property.

When you set the `OutputFormat` property to `'Samples'`, the output of the `step` method is in the form of multiple samples. In this case, the number of samples is the value of the `NumSamples` property. In staggered PRF applications, you might find the `'Samples'` option more convenient because the `step` output always has the same matrix size.

Default: `'Pulses'`

`NumPulses`

Number of pulses in output

Specify the number of pulses in the output of the `step` method as a positive integer. This property applies only when you set the `OutputFormat` property to `'Pulses'`.

Default: `1`

`NumSamples`

Number of samples in output

Specify the number of samples in the output of the `step` method as a positive integer. Typically, you use the number of samples in one pulse. This property applies only when you set the `OutputFormat` property to `'Samples'`.

Default: `100`

`SeedSource`

Source of seed for random number generator

Specify how the object generates random numbers. Values of this property are:

 `'Auto'` Random numbers come from the global GPU random number stream.`'Auto'` is appropriate in a variety of situations. In particular, if you want to use a generator algorithm other than `mrg32k3a`, set `SeedSource` to `'Auto'`. Then, configure the global GPU random number stream to use the generator of your choice. You can configure the global GPU random number stream using `parallel.gpu.RandStream` and `parallel.gpu.RandStream.setGlobalStream`. `'Property'` Random numbers come from a private stream of random numbers. The stream uses the `mrg32k3a` generator algorithm, with a seed specified in the `Seed` property of this object.If you do not want clutter computations to affect the global GPU random number stream, set `SeedSource` to `'Property'`.

Default: `'Auto'`

`Seed`

Seed for random number generator

Specify the seed for the random number generator as a scalar integer between 0 and 232–1. This property applies when you set the `SeedSource` property to `'Property'`.

Default: `0`

## Methods

 clone Create GPU constant gamma clutter simulation object with same property values getNumInputs Number of expected inputs to step method getNumOutputs Number of outputs from step method isLocked Locked status for input attributes and nontunable properties release Allow property value and input characteristics changes reset Reset random numbers and time count for clutter simulation step Simulate clutter using constant gamma model

## Examples

expand all

### Clutter Simulation of System with Known Power

Simulate the clutter return from terrain with a gamma value of 0 dB. The effective transmitted power of the radar system is 5 kw.

Set up the characteristics of the radar system. This system has a 4-element uniform linear array (ULA). The sample rate is 1 MHz, and the PRF is 10 kHz. The propagation speed is 300,000 km/s, and the operating frequency is 300 MHz. The radar platform is flying 1 km above the ground with a path parallel to the ground along the array axis. The platform speed is 2000 m/s. The mainlobe has a depression angle of 30 degrees.

```Nele = 4; c = 3e8; fc = 3e8; lambda = c/fc; ha = phased.ULA('NumElements',Nele,'ElementSpacing',lambda/2); fs = 1e6; prf = 10e3; height = 1000; direction = [90; 0]; speed = 2000; depang = 30;```

Create the GPU clutter simulation object. The configuration assumes the earth is flat. The maximum clutter range of interest is 5 km, and the maximum azimuth coverage is +/– 60 degrees.

```Rmax = 5000; Azcov = 120; tergamma = 0; tpower = 5000; hclutter = phased.gpu.ConstantGammaClutter('Sensor',ha,... 'PropagationSpeed',c,'OperatingFrequency',fc,'PRF',prf,... 'SampleRate',fs,'Gamma',tergamma,'EarthModel','Flat',... 'TransmitERP',tpower,'PlatformHeight',height,... 'PlatformSpeed',speed,'PlatformDirection',direction,... 'BroadsideDepressionAngle',depang,'MaximumRange',Rmax,... 'AzimuthCoverage',Azcov);```

Simulate the clutter return for 10 pulses.

```Nsamp = fs/prf; Npulse = 10; csig = zeros(Nsamp,Nele,Npulse); for m = 1:Npulse csig(:,:,m) = step(hclutter); end```

Plot the angle-Doppler response of the clutter at the 20th range bin.

```hresp = phased.AngleDopplerResponse('SensorArray',ha,... 'OperatingFrequency',fc,'PropagationSpeed',c,'PRF',prf); plotResponse(hresp,shiftdim(csig(20,:,:)),... 'NormalizeDoppler',true);```

The results do not exactly match those achieved by using `phased.ConstantGammaClutter` instead of `phased.gpu.ConstantGammaClutter`. This discrepancy occurs because of differences between CPU and GPU computations.

### Clutter Simulation Using Known Transmit Signal

Simulate the clutter return from terrain with a gamma value of 0 dB. The `step` syntax includes the transmit signal of the radar system as an input argument. In this case, you do not record the effective transmitted power of the signal in a property.

Set up the characteristics of the radar system. This system has a 4-element uniform linear array (ULA). The sample rate is 1 MHz, and the PRF is 10 kHz. The propagation speed is 300,000 km/s, and the operating frequency is 300 MHz. The radar platform is flying 1 km above the ground with a path parallel to the ground along the array axis. The platform speed is 2000 m/s. The mainlobe has a depression angle of 30 degrees.

```Nele = 4; c = 3e8; fc = 3e8; lambda = c/fc; ha = phased.ULA('NumElements',Nele,'ElementSpacing',lambda/2); fs = 1e6; prf = 10e3; height = 1000; direction = [90; 0]; speed = 2000; depang = 30;```

Create the GPU clutter simulation object and configure it to take a transmit signal as an input argument to `step`. The configuration assumes the earth is flat. The maximum clutter range of interest is 5 km, and the maximum azimuth coverage is +/– 60 degrees.

```Rmax = 5000; Azcov = 120; tergamma = 0; hclutter = phased.gpu.ConstantGammaClutter('Sensor',ha,... 'PropagationSpeed',c,'OperatingFrequency',fc,'PRF',prf,... 'SampleRate',fs,'Gamma',tergamma,'EarthModel','Flat',... 'TransmitSignalInputPort',true,'PlatformHeight',height,... 'PlatformSpeed',speed,'PlatformDirection',direction,... 'BroadsideDepressionAngle',depang,'MaximumRange',Rmax,... 'AzimuthCoverage',Azcov);```

Simulate the clutter return for 10 pulses. At each step, pass the transmit signal as an input argument. The software automatically computes the effective transmitted power of the signal. The transmit signal is a rectangular waveform with a pulse width of 2 µs.

```tpower = 5000; pw = 2e-6; X = tpower*ones(floor(pw*fs),1); Nsamp = fs/prf; Npulse = 10; csig = zeros(Nsamp,Nele,Npulse); for m = 1:Npulse csig(:,:,m) = step(hclutter,X); end```

Plot the angle-Doppler response of the clutter at the 20th range bin.

```hresp = phased.AngleDopplerResponse('SensorArray',ha,... 'OperatingFrequency',fc,'PropagationSpeed',c,'PRF',prf); plotResponse(hresp,shiftdim(csig(20,:,:)),... 'NormalizeDoppler',true);```

The results do not exactly match those achieved by using `phased.ConstantGammaClutter` instead of `phased.gpu.ConstantGammaClutter`. This discrepancy occurs because of differences between CPU and GPU computations.

### Random Number Comparison Between GPU and CPU

In most cases, it does not matter that the GPU and CPU use different random numbers. Sometimes, you may need to reproduce the same stream on both GPU and CPU. In such cases, you can set up the two global streams so they produce identical random numbers. Both GPU and CPU support the combined multiple recursive generator (`mrg32k3a`) with the `NormalTransform` parameter set to `'Inversion'`.

Define a seed value to use for the GPU stream and the CPU stream.

`seed = 7151;`

Create a CPU random number stream that uses the combined multiple recursive generator and the chosen seed value. Then, use this stream as the global stream for random number generation on the CPU.

```stream_cpu = RandStream('CombRecursive','Seed',seed,... 'NormalTransform','Inversion'); RandStream.setGlobalStream(stream_cpu);```

Create a GPU random number stream that uses the combined multiple recursive generator and the same seed value. Then, use this stream as the global stream for random number generation on the GPU.

```stream_gpu = parallel.gpu.RandStream('CombRecursive','Seed',seed); parallel.gpu.RandStream.setGlobalStream(stream_gpu);```

Generate clutter on both the CPU and the GPU, using the global stream on each platform.

```h_cpu = phased.ConstantGammaClutter('SeedSource','Auto'); h_gpu = phased.gpu.ConstantGammaClutter('SeedSource','Auto'); y_cpu = step(h_cpu); y_gpu = step(h_gpu);```

Check that the element-wise differences between the CPU and GPU results are negligible.

```maxdiff = max(max(abs(y_cpu - y_gpu))) eps```
```maxdiff = 2.9092e-18 ans = 2.2204e-16```

## References

[1] Barton, David. "Land Clutter Models for Radar Design and Analysis," Proceedings of the IEEE. Vol. 73, Number 2, February, 1985, pp. 198–204.

[2] Long, Maurice W. Radar Reflectivity of Land and Sea, 3rd Ed. Boston: Artech House, 2001.

[3] Nathanson, Fred E., J. Patrick Reilly, and Marvin N. Cohen. Radar Design Principles, 2nd Ed. Mendham, NJ: SciTech Publishing, 1999.

[4] Ward, J. "Space-Time Adaptive Processing for Airborne Radar Data Systems," Technical Report 1015, MIT Lincoln Laboratory, December, 1994.