# jsdmrfweights

Create RF precoding weights

Since R2023a

## Syntax

``wprf = jsdmrfweights(hcov,ns)``
``wprf = jsdmrfweights(hcov,ns,ntrf)``

## Description

example

````wprf = jsdmrfweights(hcov,ns)` returns the RF precoding weights, `wprf`, for the channel covariance matrix, `hcov`, to achieve orthogonality among users by Joint Spatial Division Multiplexing (JSDM). JSDM uses RF precoding weights to divide users into groups by their location information. The RF precoding weights, `wprf`, beamform the transmitted signal into each group.```
````wprf = jsdmrfweights(hcov,ns,ntrf)` also specifies the desired number of RF chains `ntrf`.```

## Examples

collapse all

Find RF precoding weights for a JSDM beamformer based on a base station with a 64-element linear antenna array. Assume there are two user groups. The first group has two users and the second group has three users. Array elements are 1/2 wavelength apart.

Set the number of array elements to 64.

`Nt = 64;`

Find the array steering weights in the direction of the first user group. The user group is centered at $+{10}^{\circ }$ azimuth.

```v1 = steervec((0:Nt-1)*0.5,[9 11]); rc1 = v1*v1'; ```

Find the array steering weights in the direction of the second user group. The user group is centered ${-5}^{\circ }$ azimuth.

```v2 = steervec((0:Nt-1)*0.5,[-4 -5 -6]); rc2 = v2*v2';```

Then, compute the RF weights from the channel covariance matrix.

```hcov = {rc1,rc2}; wprf = jsdmrfweights(hcov,[2 3]);```

Verify the orthogonality between the two user groups.

`snr1 = pow2db(real(trace(wprf{1}*rc1*wprf{1}'))/real(trace(wprf{1}*rc2*wprf{1}')))`
```snr1 = 26.1255 ```
`snr2 = pow2db(real(trace(wprf{2}*rc2*wprf{2}'))/real(trace(wprf{2}*rc1*wprf{2}')))`
```snr2 = 26.1632 ```

## Input Arguments

collapse all

Channel covariance matrix, specified as 1-by-G cell array where G is the number of groups. Each cell in `hcov` an Nt-by-Nt matrix representing the covariance of the channel between the base station and the corresponding group of the users. Nt is the number of elements in the base station array. Assume that `hcov` is the same for all users in the corresponding group across all subcarriers.

`hcov` for the gth user group is defined as the expected value of H*H', where H is an Nt-by-Nr(g) matrix representing the instantaneous channel for that user group. Nr(g) is the number of receiving elements in thegth group.

Data Types: `double`
Complex Number Support: Yes

Number of data streams, specified as a G-element row vector or a 1-by-G cell array.

• If `ns` is a vector, each element specifies the total number of data streams in the corresponding user group.

• If `ns` is a cell array, each element in the cell array is a Kg-element row vector where Kg is the number of users in the gth group. The elements in Kg-element row vector specify the number of receiving data streams for each user in that group.

This function assumes that the number of receiving elements in the gth user group, Nr(g), matches the total number of data streams for that group.

Data Types: `double`

Desired number of RF chains for each group, specified as a 1-by-G integer vector. Note that if `nrtf` is specified, then the dimension of `wprf`(g) becomes `nrtf`(g)-by-Nt.

Data Types: `double`

## Output Arguments

collapse all

RF precoding weights for the channel covariance matrix, returned as a 1-by-G cell array.

• When `ns` is a vector, each cell in `wprf` is an `ns`(g)-by-Nt matrix that maps the `ns`(g) RF chain to Nt antennas in the base station.

• When `ns` is a cell array, each cell in `wprf` is a sum(NS{g})-by-Nt matrix that maps the total number of RF chains in the gth group to Nt antennas in the base station.

 Adhikary A., J. Nam, J-Y Ahn, and G. Caire. "Joint Spatial Division and Multiplexing - The Large-Scale Array Regime." IEEE Transactions on Information Theory, Vol. 59, No. 10, October 2013, pp. 6441-6463.