# winner2.wim

Generate channel coefficients using WINNER II channel model

## Syntax

## Description

**Download Required:** To use winner2.wim, first
download the WINNER II Channel Model for Communications Toolbox add-on.

`[`

also
returns the path delays for all links.`chanCoef`

,`pathDelays`

]
= winner2.wim(`cfgWim`

,`cfgLayout`

)

`[`

also
returns the final condition of the system after generating the channel
coefficients.`chanCoef`

,`pathDelays`

,`finalCond`

]
= winner2.wim(`cfgWim`

,`cfgLayout`

)

`[`

generates
the channel coefficients by using the initial system conditions rather
than of performing random initialization. `chanCoef`

,`pathDelays`

,`finalCond`

]
= winner2.wim(`cfgWim`

,`cfgLayout`

,`initCond`

)`initCond`

is
of the same form as `finalCond`

and is typically
the `finalCond`

output from the prior call of this
function. Use this syntax to repeatedly generate channel coefficients
for continuous time samples.

## Examples

### Continuously Generate WINNER II Channel Coefficients

Continuously generate channel coefficients for each link in a two-link system layout.

Configure model parameters.

```
cfgWim = winner2.wimparset;
cfgWim.SampleDensity = 20;
cfgWim.RandomSeed = 10; % For repeatability
```

Configure layout parameters.

BSAA = winner2.AntennaArray('UCA',8,0.02); % UCA-8 array for BS MSAA1 = winner2.AntennaArray('ULA',2,0.01); % ULA-2 array for MS1 MSAA2 = winner2.AntennaArray('ULA',4,0.005); % ULA-4 array for MS2 MSIdx = [2,3]; BSIdx = {1}; NL = 2; rndSeed = 5; cfgLayout = winner2.layoutparset(MSIdx,BSIdx,NL,[BSAA,MSAA1,MSAA2],[],rndSeed);

Generate channel coefficients for the first time.

[H1,~,finalCond] = winner2.wim(cfgWim,cfgLayout);

Generate a second set of channel coefficients.

[H2,~,finalCond] = winner2.wim(cfgWim,cfgLayout,finalCond);

Concatenate H1 and H2 in time domain.

```
H = cellfun(@(x,y) cat(4,x,y),H1,H2,'UniformOutput',false);
```

Plot H for the first link, 1st Tx, 1st Rx, and 1st path. The plot shows the channel continuity over the two outputs from the `winner2.wim`

function.

figure; Ts = finalCond.delta_t(1); % Sample time for the 1st link plot(Ts*(0:2*cfgWim.NumTimeSamples-1)', ... abs(squeeze(H{1}(1,1,1,:)))); xlabel('Time (s)'); ylabel('Amplitude'); title('First Path Coefficient of 1st Link, 1st Tx, and 1st Rx');

## Input Arguments

`cfgWim`

— Configuration layout

structure

Configuration model, specified as a structure containing these
fields. `cfgWim`

is typically created using the `winner2.wimparset`

function.

`NumTimeSamples`

— Number of time samples

`100`

(default) | scalar

Number of time samples, specified as a scalar.

`FixedPdpUsed`

— Use predefined path delays and powers for specific scenarios

`'no'`

(default) | `'yes'`

Use predefined path delays and powers for specific scenarios,
specified as `'no'`

or `'yes'`

.

`FixedAnglesUsed`

— Use predefined path angles of departure (AoDs) and angles of arrival (AoAs) for specific scenarios

`'no'`

(default) | `'yes'`

Use predefined path angles of departure (AoDs) and angles of
arrival (AoAs) for specific scenarios, specified as `'yes'`

or `'no'`

.

`IntraClusterDsUsed`

— Divide each of the two strongest clusters into three subclusters per link

`'yes'`

(default) | `'no'`

Divide each of the two strongest clusters into three subclusters
per link, specified as `'yes'`

or `'no'`

.

`PolarisedArrays`

— Use dual-polarized arrays

`'yes'`

(default) | `'no'`

Use dual-polarized arrays, specified as `'yes'`

or `'no'`

.

`UseManualPropCondition`

— Use manually defined propagation conditions

`'yes'`

(default) | `'no'`

Use manually defined propagation conditions, specified as `'yes'`

or `'no'`

.
Set to `'yes'`

to enforce the use of manually defined
propagation conditions (LOS/NLOS) in the `PropagConditionVector`

structure
field returned by `winner2.layoutparset`

.
Set to `'no'`

to draw propagation conditions from
pre-defined LOS probabilities.

`CenterFrequency`

— Carrier frequency

`5.25e9`

(default) | scalar

Carrier frequency in Hz, specified as a scalar.

`UniformTimeSampling`

— Enforce uniform time sampling

`'no'`

(default) | `'yes'`

Enforce all links to be sampled at the same time instants, specified
as `'no'`

or `'yes'`

.

`SampleDensity`

— Number of time samples per half wavelength

`2e6`

(default) | scalar

Number of time samples per half wavelength, specified as a scalar.

`DelaySamplingInterval`

— Sampling interval

`5e-9`

(default) | scalar

Sampling interval, specified as an scalar indicating the input
signal sample time in seconds. `DelaySamplingInterval`

defines
the sampling grid to which the path delays are rounded. A value of `0`

seconds
indicates no rounding on path delays.

`ShadowingModelUsed`

— Use shadow fading

`'no'`

(default) | `'yes'`

Use shadow fading, specified as `'no'`

or `'yes'`

.

`PathLossModelUsed`

— Use path loss model

`'no'`

(default) | `'yes'`

Use path loss model, specified as `'no'`

or `'yes'`

.

`PathLossModel`

— Path loss model

`'pathloss'`

(default) | character vector

Path loss model, specified as a character vector representing
a valid function name. `PathLossModel`

applies
only when `PathLossModelUsed`

is set to `'yes'`

.

`PathLossOption`

— Wall material

`'CR_light'`

(default) | `'CR_heavy'`

| `'RR_light'`

| `'RR_heavy'`

Wall material, specified as `'CR_light'`

, `'CR_heavy'`

, `'RR_light'`

,
or `'RR_heavy'`

, indicating the wall material for
the *A1* scenario NLOS path loss calculation. `PathLossOption`

applies
only when `PathLossModelUsed`

is set to `'yes'`

.

`RandomSeed`

— Seed for random number generators

`[]`

(default) | scalar

Seed for random number generators, specified as a scalar or
empty brackets. Empty brackets, `[]`

, indicate that
the global random stream is used.

`cfgLayout`

— Configuration layout

structure

Configuration layout, specified as a structure containing these
fields, which represent the location and orientation parameters for
all simulated stations. `cfgLayout`

is typically
created using the `winner2.layoutparset`

function.

`Stations`

— Active stations

row vector of structures

Active stations, specified as a row vector of structures describing
the antenna arrays for active stations. `Stations`

is
created from the `arrays`

input of `winner2.layoutparset`

and adds an additional `Velocity`

field.
The row ordering specifies base station (BS) sectors first, followed
by the mobile stations (MS). The BS sector and MS positions are randomly
assigned. The BS sectors have no velocity. Each MS has a velocity
of about 1.42 m/s with a randomly assigned direction.

`NofSect`

— Number of sectors

vector

Number of sectors, specified as a vector indicating the number of sectors in each BS.

`Pairing`

— BS to MS pairing

matrix

BS to MS pairing, specified as a 2-by-*N*_{L} matrix,
where *N*_{L} specifies the number
of links to be modeled. See `Stations`

for BS
and MS row ordering.

`ScenarioVector`

— Spatial scenario

`1`

(default) | vector

Spatial scenario, specified as a 1-by-*N*_{L} vector
of scenario numbers. The default is `1`

, which specifies
scenario A1.

The scenarios numbers map as {`1`

=A1, `2`

=A2, `3`

=B1, `4`

=B2, `5`

=B3, `6`

=B4, `10`

=C1, `11`

=C2, `12`

=C3, `13`

=C4, `14`

=D1, `15`

=D2a}.

For more information, see WINNER II Channel Models [1], Section 2.3.

`PropagConditionVector`

— Propagation condition

`1`

(default) | vector

Propagation condition, specified as a 1-by-*N*_{L} vector
of propagation conditions (LOS = 1 and NLOS = 0) for each link.

`StreetWidth`

— Street width

`20`

(default) | vector

Street width, specified as a 1-by-*N*_{L} vector
of identical values that specify the average width (in meters) of
the streets. `StreetWidth`

is used for the path
loss model of the B1 and B2 scenarios. See `ScenarioVector`

for the
scenario number mapping. All elements must have the same value. `StreetWidth`

applies
only when `cfgWim`

.`PathLossModelUsed`

is
set to `'yes'`

.

`Dist1`

— Distances from BS to the last LOS point

`NaN`

(default) | vector

Distances from BS to the last LOS point, specified as a 1-by-*N*_{L} vector. `Dist1`

is
used for the path loss model of the B1 and B2 scenarios. The default
value of `NaN`

indicates that the distance is randomly
determined in path loss function. See `ScenarioVector`

for the
scenario number mapping. `Dist1`

applies only when `cfgWim`

.`PathLossModelUsed`

is
set to `'yes'`

.

For more information, see WINNER II Channel Models [1], Figure 4-3.

`NumFloors`

— Floor numbers

`1`

(default) | vector

Floor numbers, specified as a 1-by-*N*_{L} vector
indicating the floor number where the indoor BS or MS is located.
The default value is `1`

. The `NumFloors`

field
is used for the path loss model of the A2 and B4 scenarios only. See `ScenarioVector`

for the
scenario number mapping. `NumFloors`

applies only
when `cfgWim`

.`PathLossModelUsed`

is
set to `'yes'`

.

`NumPenetratedFloors`

— Number of floors penetrated

0 (default) | vector

Number of floors penetrated, specified as a 1-by-*N*_{L} vector
indicating the number of penetrated floors between BS and MS. The
default value is `0`

. The `NumPenetratedFloors`

is
used for the NLOS path loss model of the A1 scenario. See `ScenarioVector`

for the
scenario number mapping. `NumPenetratedFloors`

field
applies only when `cfgWim`

.`PathLossModelUsed`

is
set to `'yes'`

.

For more information, see WINNER II Channel Models [1], Table 4-4.

`initCond`

— Initial system condition

structure | optional

Initial system condition, specified as a structure. `initCond`

is
of the same form as `finalCond`

and is typically
the `finalCond`

output from the prior call of `winner2.wim`

.

**Data Types: **`struct`

## Output Arguments

`chanCoef`

— Channel coefficients

cell array containing 4-D arrays of complex values

Channel coefficients, returned as an *N*_{L}-by-1
cell array. *N*_{L} is the number
of links in the system. The *i*th element of `chanCoef`

is
an *N*_{R}(*i*)-by-*N*_{T}(*i*)-by-*N*_{P}(*i*)-by-*N*_{S} array. *N*_{R}, *N*_{T},
and *N*_{P} are link specific. *N*_{S} is
the same for all the links.

*N*_{R}(*i*) is the number of receive antenna elements at MS for the*i*th link.*N*_{T}(*i*) is the number of transmit antenna elements at BS for the*i*th link.*N*_{P}(*i*) is the number of paths for the*i*th link.*N*_{S}is the number of time samples given by`cfgWim`

.`NumTimeSamples`

.

For more information , see Channel Power.

**Data Types: **`cell`

`pathDelays`

— Path delays

matrix

Path delays, returned as an *N*_{L}-by-*maxN*_{P} matrix. *N*_{L} is
the number of links in the system and *maxN*_{P} is
the maximum number of paths among all links. Each row of the matrix
applies to each link. When a link has fewer than *maxN*_{P} paths,
the corresponding row in `pathDelays`

is `NaN`

padded.

**Data Types: **`double`

`finalCond`

— Final system condition

structure

Final system condition, returned as a structure. When generating
channel coefficients for continuous time samples, use `finalCond`

as
the `initCond`

input for the next call to `winner2.wim`

.

For more information, see WINNER II Channel Models [1], Section 5.2.

**Data Types: **`struct`

## More About

### Channel Power

When path loss and shadowing are off, path gains of the computed
WINNER channel are normalized. Specifically, path gains are normalized when the
`ShadowingModelUsed`

and `PathLossModelUsed`

parameters are set to
`'no'`

.

## References

[1] Kyosti,
Pekka, Juha Meinila, et al. *WINNER II Channel Models*.
D1.1.2 V1.2. IST-4-027756 WINNER II, September 2007.

## Version History

**Introduced in R2017a**

## See Also

### Objects

### Functions

## MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)