# comm.MIMOChannel System object

Package: comm

Filter input signal through MIMO multipath fading channel

## Description

The MIMOChannel System object™ filters an input signal through a multiple-input multiple-output (MIMO) multipath fading channel. This object models both Rayleigh and Rician fading and employs the Kronecker model for modeling the spatial correlation between the links.

The fading processing per link is per the Methodology for Simulating Multipath Fading Channels section and assumes the same parameters for all NT × NR links of the MIMO channel. Each link comprises all multipaths for that link.

To filter an input signal using a MIMO multipath fading channel:

1. Define and set up your MIMO channel object. See Construction.

2. Call step to filter the input signal through a MIMO multipath fading channel according to the properties of comm.MIMOChannel. The behavior of step is specific to each object in the toolbox.

## Construction

H = comm.MIMOChannel creates a multiple-input multiple-output (MIMO) frequency selective or frequency flat fading channel System object, H. This object filters a real or complex input signal through the multipath MIMO channel to obtain the channel impaired signal.

H = comm.MIMOChannel(Name,Value) creates a MIMO channel object, H, with the specified property Name set to the specified Value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).

## Methods

 clone Create MIMOChannel object with same property values getNumInputs Number of expected inputs to step method getNumOutputs Number of outputs from step method info Characteristic information about MIMO Channel isLocked Locked status for input attributes and nontunable properties release Allow property value and input characteristics changes reset Reset states of the MIMOChannel object step Filter input signal through MIMO multipath fading channel

## Examples

collapse all

### Pass QPSK Data through a 4x2 MIMO Channel

This example shows how to create a 4x2 MIMO channel using the MIMO channel System object. Modulated and spatially encoded data is passed through the channel.

Create a QPSK modulator object and generate a stream of random integers. Invoke the step function to modulate the data.

hMod = comm.QPSKModulator;
data = randi([0 3],1000,1);
modData = step(hMod,data);

Create an orthogonal space-time block encoder to encode the modulated data into four spatially separated streams. Invoke the step function to encode the data.

hEnc = comm.OSTBCEncoder('NumTransmitAntennas',4,'SymbolRate',1/2);
txSig = step(hEnc,modData);

Create a MIMO channel object using name-value pairs to set the properties. The channel consists of two paths with a maximum Doppler shift of 5 Hz. Set the SpatialCorrelation property to false, which requires that you specify the number of transmit and receive antennas. Set the number of transmit antennas to 4 and the number of receive antennas to 2.

hChan = comm.MIMOChannel(...
'SampleRate',1000, ...
'PathDelays',[0 2e-3], ...
'AveragePathGains',[0 -5], ...
'MaximumDopplerShift',5, ...
'SpatialCorrelation',false, ...
'NumTransmitAntennas',4, ...

Pass the modulated and encoded data through the MIMO channel.

rxSig = step(hChan,txSig);

Create a time vector, t, to use for plotting the power of the received signal.

ts = 1/hChan.SampleRate;
t = (0:ts:(size(txSig,1)-1)*ts)';

Calculate and plot the power of the signal received by antenna 1.

pwrdB = 20*log10(abs(rxSig(:,1)));

plot(t,pwrdB)
xlabel('Time (sec)')
ylabel('Power (dBW)')

### Examine Spatial Correlation Characteristics of a 2-by-2 Rayleigh Fading Channel

Filter PSK modulated data through a 2-by-2 Rayleigh fading channel, and then examine the spatial correlation characteristics of the channel realization.

Create a PSK Modulator System object to modulate randomly generated data.

hMod = comm.PSKModulator;
modData = step(hMod, randi([0 hMod.ModulationOrder-1],1e5,1));

Split modulated data into two spatial streams.

channelInput = reshape(modData, [2, 5e4]).';

Create a 2-by-2 MIMOChannel System object with two discrete paths. Each path has different transmit and receive correlation matrices, specified by the TransmitCorrelationMatrix and ReceiveCorrelationMatrix properties.

hMIMOChan = comm.MIMOChannel(...
'SampleRate',                1000,...
'PathDelays',                [0 1e-3],...
'AveragePathGains',          [3 5],...
'NormalizePathGains',        false,...
'MaximumDopplerShift',       5,...
'TransmitCorrelationMatrix', cat(3, eye(2), [1 0.1;0.1 1]),...
'ReceiveCorrelationMatrix',  cat(3, [1 0.2;0.2 1], eye(2)),...
'RandomStream',              'mt19937ar with seed',...
'Seed',                      33,...
'PathGainsOutputPort',       true);

Filter the modulated data using hMIMOChan and use the step method to process data.

[~, pathGains] = step(hMIMOChan, channelInput);

The transmit spatial correlation for the first discrete path at the first receive antenna is specified as an identity matrix in the TransmitCorrelationMatrix property. Confirm that the channel output pathGains exhibits the same statistical characteristics using the corrcoef function.

disp('Tx spatial correlation, first path, first Rx:');
disp(corrcoef(squeeze(pathGains(:,1,:,1))));

The transmit spatial correlation for the second discrete path at the second receive antenna is specified as [1 0.1;0.1 1] in the TransmitCorrelationMatrix property. Confirm that the channel output pathGains exhibits the same statistical characteristics.

disp('Tx spatial correlation, second path, second Rx:');
disp(corrcoef(squeeze(pathGains(:,2,:,2))));

The receive spatial correlation for the first discrete path at the second transmit antenna is specified as [1 0.2;0.2 1] in the ReceiveCorrelationMatrix property. Confirm that the channel output pathGains exhibits the same statistical characteristics.

disp('Rx spatial correlation, first path, second Tx:');
disp(corrcoef(squeeze(pathGains(:,1,2,:))));

The receive spatial correlation for the second discrete path at the first transmit antenna is specified as an identity matrix in the ReceiveCorrelationMatrix property. Confirm that the channel output pathGains exhibits the same statistical characteristics.

disp('Rx spatial correlation, second path, first Tx:');
disp(corrcoef(squeeze(pathGains(:,2,1,:))));

Now enable transmit and receive antenna selection for the System object hMIMOChan. The input frame size is shortened to 100.

release(hMIMOChan);
hMIMOChan.AntennaSelection = 'Tx and Rx';
modData = step(hMod,randi([0 hMod.ModulationOrder-1],1e2,1));

Select the first transmit and second receive antennas.

[channelOutput, pathGains] = step(hMIMOChan, modData, [1 0], [0 1]);

Confirm that the path gains MATLAB® returns have NaN values for the unselected transmit-receive antenna pairs.

disp('Return 1 if the path gains for the second transmit antenna are NaN:');
disp(isequal(isnan(squeeze(pathGains(:,:,2,:))), ones(1e2, 2, 2)));
disp('Return 1 if the path gains for the first receive antenna are NaN:');
disp(isequal(isnan(squeeze(pathGains(:,:,:,1))), ones(1e2, 2, 2)));

### Display Impulse and Frequency Responses of a Frequency Selective Channel

This example shows how to create a frequency selective MIMO channel and display its impulse and frequency responses.

Set the sample rate to 10 MHz and specify path delays and gains using the extended vehicular A (EVA) channel parameters. Set the maximum Doppler shift to 70 Hz.

fs = 10e6;                                                  % Hz
pathDelays = [0 30 150 310 370 710 1090 1730 2510]*1e-9;    % sec
avgPathGains = [0 -1.5 -1.4 -3.6 -0.6 -9.1 -7 -12 -16.9];   % dB
fD = 70;                                                    % Hz

Create a 2x2 MIMO channel System object with the previously defined parameters and set the Visualization property to Impulse and frequency responses using name-value pairs. By default, the antenna pair corresponding to transmit antenna 1 and receive antenna 1 will be displayed.

h = comm.MIMOChannel('SampleRate',fs, ...
'PathDelays',pathDelays, ...
'AveragePathGains',avgPathGains, ...
'MaximumDopplerShift',fD, ...
'Visualization','Impulse and frequency responses');

Generate random binary data and pass it through the MIMO channel using the step function. The impulse response plot allows you to easily identify the individual paths and their corresponding filter coefficients. The frequency selective nature of the EVA channel is shown by the frequency response plot.

x = randi([0 1],1000,2);
y = step(h,x);

Release h and set the AntennaPairsToDisplay property to [2 1] to view the antenna pair corresponding to transmit antenna 2 and receive antenna 1. It is necessary to release the object as the property is non-tunable.

release(h)
h.AntennaPairsToDisplay = [2 1];
y = step(h,x);

### Display Doppler for a MIMO Channel

Create and visualize the Doppler spectra of a MIMO channel having two paths.

Construct a cell array of Doppler structures to be used in creating the channel. The Doppler spectrum of the first path is set to have a bell shape while the second path is set to be flat.

dp{1} = doppler('Bell');
dp{2} = doppler('Flat');

Create a default 2x2 MIMO channel with two paths and a 100 Hz maximum Doppler shift using name-value pairs. Set the Visualization property to Doppler spectrum and set PathsForDopplerDisplay to 1. The Doppler spectrum of the first path will be displayed.

h = comm.MIMOChannel('SampleRate',1000, ...
'PathDelays',[0 0.002],'AveragePathGains',[0 -3], ...
'MaximumDopplerShift',100, ...
'DopplerSpectrum',dp, ...
'Visualization','Doppler spectrum', ...
'PathsForDopplerDisplay',1);

Call the step function of the MIMO object to generate the Doppler spectrum of the first path. Since the Doppler spectrum plot only updates when its buffer is filled, the step function is invoked multiple times to improve the accuracy of the estimate. Observe that the spectrum has a bell shape and that its minimum and maximum frequencies fall within the limits set by MaximumDopplerShift.

for k = 1:25
x = randi([0 1],10000,2);
y = step(h,x);
end

Release h and set the PathsForDopplerDisplay property to 2. It is necessary to release the object as the property is non-tunable. Invoke the step function multiple times to display the Doppler spectrum of the second path. Observe that the spectrum is flat.

release(h)
h.PathsForDopplerDisplay = 2;
for k = 1:25
x = randi([0 1],10000,2);
y = step(h,x);
end

### Model MIMO Channel Using the Sum-of-Sinusoids Technique

The example shows how to create MIMO channel object and pass data through it using the sum-of-sinusoids technique. The example demonstrates how the channel state is maintained in cases in which data is discontinuously transmitted.

Define the overall simulation time and three time segments for which data will be transmitted. In this case, the channel is simulated for 1 s with a 1000 Hz sampling rate. One 1000-sample, continuous data sequence is transmitted at time 0. Three 100-sample, data packets are transmitted at time 0.1 s, 0.4 s, and 0.7 s.

t0 = 0:0.001:0.999;   % Transmission 0
t1 = 0.1:0.001:0.199; % Transmission 1
t2 = 0.4:0.001:0.499; % Transmission 2
t3 = 0.7:0.001:0.799; % Transmission 3

Generate random binary data corresponding to the previously defined time intervals.

d0 = randi([0 1],1000,2);  % 1000 samples
d1 = randi([0 1],100,2);   % 100 samples
d2 = randi([0 1],100,2);   % 100 samples
d3 = randi([0 1],100,2);   % 100 samples

Create a flat fading 2x2 MIMO channel System object with the Sum of sinusoids fading technique. So that results can be repeated, specify a seed using a name-value pair. As the InitialTime property is not specified, the fading channel will be simulated from time 0. Enable the path gains output port.

g = comm.MIMOChannel('SampleRate',1000, ...
'MaximumDopplerShift',5, ...
'RandomStream','mt19937ar with seed', ...
'Seed',17, ...
'PathGainsOutputPort',true);

Create a clone of the MIMO channel System object. Set the InitalTimeSource property to Input port so that the fading channel offset time can be specified as an input argument to the step function.

h = clone(g);
h.InitialTimeSource = 'Input port';

Pass random binary data through the first channel object, g. Data is transmitted over all 1000 time samples. For this example, only the complex path gain is needed.

[~,pg0] = step(g,d0);

Pass random data through the second channel object, h, where the initial time offsets are provided as arguments to the step function.

[~,pg1] = step(h,d1,0.1);
[~,pg2] = step(h,d2,0.4);
[~,pg3] = step(h,d3,0.7);

Compare the number of samples processed by the two channels using the info method. You can see that 1000 samples were processed by g while only 300 were processed by h.

G = info(g);
H = info(h);
[G.NumSamplesProcessed H.NumSamplesProcessed]
ans =

1000         300

Convert the path gains into decibels for the path corresponding to the first transmit and first receive antenna.

pathGain0 = 20*log10(abs(pg0(:,1,1,1)));
pathGain1 = 20*log10(abs(pg1(:,1,1,1)));
pathGain2 = 20*log10(abs(pg2(:,1,1,1)));
pathGain3 = 20*log10(abs(pg3(:,1,1,1)));

Plot the path gains for the continuous and discontinuous cases. Observe that the gains for the three segments perfectly match the gain for the continuous case. The alignment of the two highlights that the sum-of-sinusoids technique is ideally suited to the simulation of packetized data as the channel characteristics are maintained even when data is not transmitted.

plot(t0,pathGain0,'r--')
hold on
plot(t1,pathGain1,'b')
plot(t2,pathGain2,'b')
plot(t3,pathGain3,'b')
grid
xlabel('Time (sec)')
ylabel('Path Gain (dB)')
legend('Continuous','Discontinuous','location','nw')

### Calculate Execution Time Advantage Using Sum of Sinusoids

This example demonstrates the advantage of using the sum of sinusoids fading technique when simulating a channel with burst data.

Set the simulation parameters such that the sampling rate is 100 kHz, the total simulation time is 100 seconds, and the duty cycle for the burst data is 25%.

fs = 1e5;            % Hz
tsim = 100;          % seconds
dutyCycle = 0.25;

Create a flat fading 2x2 MIMO channel object using the default Filtered Gaussian noise technique.

hFGN = comm.MIMOChannel('SampleRate',fs);

Create a similar MIMO channel object using the Sum of sinusoids technique where the fading process start times are given as an input to the step function.

hSOS = comm.MIMOChannel('SampleRate',fs, ...
'NumSinusoids',48, ...
'InitialTimeSource','Input port');

Run a continuous sequence of random bits through the filtered Gaussian noise MIMO chanel object. Use the tic/toc stopwatch timer functions to measure the execution time of the function call.

tic
y = step(hFGN,randi([0 1],fs*tsim,2));
tFGN = toc;

To transmit a data burst each second, pass random bits through the sum of sinusoids MIMO channel object by calling the step function inside of a for loop. Use the tic/toc stopwatch timer to measure the execution time.

tic
for k = 1:tsim
z = step(hSOS,randi([0 1],fs*dutyCycle,2),0.5+(k-1));
end
tSOS = toc;

Compare the ratio of the sum of sinusoids execution time to the filtered Gaussian noise execution time. Observe that the ratio is roughly equal to the 25% duty cycle.

tSOS/tFGN
ans =

0.2949

## Algorithms

The fading processing per link is per the Methodology for Simulating Multipath Fading Channels section and assumes the same parameters for all NT· NR links of the MIMO channel. Each link comprises all multipaths for that link.

### The Kronecker Model

The Kronecker model assumes that the spatial correlations at the transmit and receive sides are separable. Equivalently, the direction of departure (DoD) and directions of arrival (DoA) spectra are assumed to be separable. The full correlation matrix can then be obtained as:

${R}_{H}=E\left[{R}_{t}\otimes {R}_{r}\right]$

where:

The ⊗ symbol represents the Kronecker product.

Rt represents the correlation matrix at the transmit side, i.e. ${R}_{t}=E\left[{H}^{H}H\right]$, of size Nt-by-Nt.

Rr represents the correlation matrix at the receive side, i.e. ${R}_{r}=E\left[H{H}^{H}\right]$, of size Nr-by-Nr.

You can obtain a realization of the MIMO channel matrix as:

$H={R}_{r}^{\frac{1}{2}}A{R}_{t}^{\frac{1}{2}}$

where: A is an Nr-by-Nt matrix of i.i.d. complex Gaussian variables with zero mean and unit variance.

### Cutoff Frequency Factor

The following information explains how this object determines the cutoff frequency factor, fc for different Doppler spectrum types:

• For any Doppler spectrum type, other than Gaussian and BiGaussian, fc equals 1.

• For a Gaussian Doppler spectrum type, fc equals the Doppler spectrum structure NormalizedStandardDeviations field value times sqrt(2∙log(2)).

• For a BiGaussian Doppler spectrum type:

• If the Doppler spectrum structure PowerGains field is [0,0], then fc equals the SigmaGaussian2 (SigmaGaussian1) property value times sqrt(2∙log(2)).

• If the CenterFreqGaussian1 and CenterFreqGaussian2 property values are both 0 and the SigmaGaussian1 and SigmaGaussian2 property values are the same, then fc is also equal to the SigmaGaussian2 property value times sqrt(2∙log(2)).

• In all other cases, fc equals 1.

### Antenna Selection

When the object is in antenna selection mode, it uses the following algorithms to process an input signal:

• The random path gains are always generated and keep evolving for each link, no matter whether the link is being selected or not. The path gain values for the non-selected links are marked as NaN in the path gain output.

• The spatial correlation only applies to the selected transmit and/or receive antennas, and the correlation coefficients are the corresponding entries in the transmit and/or receive correlation matrices. In other words, the spatial correlation matrix for the selected transmit/receive antennas is a submatrix of the TransmitCorrelationMatrix/ReceiveCorrelationMatrix property value.

• The input filtering through the path gains only happens to the selected links.

• Whenever a link associated with a specific transmitter transitions from a selected state to a non-selected state, its channel filter is reset. For example, if the AntennaSelection property is set to Tx and the selected transmit antenna is changed from 2 to 1, the channel filter corresponding to antenna 2 will be reset.

• Channel output normalization happens over the number of selected receive antennas.

## Selected Bibliography

[1] Oestges, C., and B. Clerckx. MIMO Wireless Communications: From Real-World Propagation to Space-Time Code Design, Academic Press, 2007.

[2] Correira, L. M. Mobile Broadband Multimedia Networks: Techniques, Models and Tools for 4G, Academic Press, 2006.

[3] Kermoal, J. P., L. Schumacher, K. I. Pedersen, P. E. Mogensen, and F. Frederiksen. "A stochastic MIMO radio channel model with experimental validation." IEEE Journal on Selected Areas of Communications. Vol. 20, Number 6, 2002, pp. 1211–1226.

[4] Jeruchim, M., P. Balaban, and K. S. Shanmugan. Simulation of Communication Systems, Second Edition, New York, Kluwer Academic/Plenum, 2000.

[5] Pätzold, Matthias, Cheng-Xiang Wang, and Bjorn Olav Hogstand. "Two New Sum-of-Sinusoids-Based Methods for the Efficient Generation of Multiple Uncorrelated Rayleigh Fading Waveforms." IEEE Transactions on Wireless Communications. Vol. 8, Number 6, 2009, pp. 3122–3131.