Main Content

ofdmEqualize

Equalize OFDM signals

Description

[eqsym,csi]= ofdmEqualize(rxsym,hest,nvar) returns equalized symbols eqsym and soft channel state information csi after performing minimum mean squared error (MMSE) equalization on input OFDM symbols rxsym. hest specifies the estimated channel information. nvar specifies the estimated noise variance.

[eqsym,csi]= ofdmEqualize(rxsym,hest) performs MMSE equalization with the estimated noise variance equal to 0.

example

[eqsym,csi]= ofdmEqualize(___,Name=Value) specifies options using one or more name-value arguments in addition to the input arguments in the previous syntaxes. For example, ofdmEqualize(rxsym,hest,Algorithm="zf") equalizes the input OFDM symbols using the zero-forcing algorithm.

Examples

collapse all

Equalize an OFDM signal filtered through a MIMO channel.

Define variables for a 2-by-4 MIMO system transmitting a 64-QAM signal that is OFDM modulated.

numTxAntenna = 2;
numRxAntenna = 4;
fftLen = 256;
cpLen = 16;        
k = 6;              % Bits per symbol for each OFDM data subcarrier
modOrder = 2^k;     % 64-QAM for k = 6
numOFDMSymbols = 8;
SNRdB = 40;

Specify null indices for guard bands and a DC subcarrier.

ofdmNullIdx = [1:9 (fftLen/2+1) (fftLen-8+1:fftLen)]';

Apply QAM and OFDM modulation to random bit data.

numDataSubcarriers = fftLen-length(ofdmNullIdx);
srcBits = randi([0,1], ...
    [numDataSubcarriers*log2(modOrder) numOFDMSymbols numTxAntenna]);
ofdmData = qammod(srcBits,modOrder, ...
    InputType="bit", ...
    UnitAveragePower=true);
txSignal = ofdmmod(ofdmData,fftLen,cpLen,ofdmNullIdx);

Filter the OFDM signal through a MIMO channel and add AWGN.

mimoChannel = comm.MIMOChannel( ...
    SampleRate=1e6, ...
    PathDelays=[3e-6 5e-6 8e-6], ...
    AveragePathGains=[1.2 0.5 0.1], ...
    MaximumDopplerShift=1, ...
    SpatialCorrelationSpecification="None", ...
    NumTransmitAntennas=numTxAntenna, ...
    NumReceiveAntennas=numRxAntenna, ...
    PathGainsOutputPort=true);
[channelOut,pathGains] = mimoChannel(txSignal);
rxSignal = awgn(channelOut,SNRdB,"measured");

Get a perfect channel estimate by using the channel filter coefficients and path gains from the comm.MIMOChannel System object™.

mimoChannelInfo = info(mimoChannel);
pathFilters = mimoChannelInfo.ChannelFilterCoefficients;
maxFilterLen = size(pathFilters,2);
numPaths = size(pathGains,2);
symLen = fftLen+cpLen;
pathGainsLink = permute( ...
    pathGains((cpLen+1) + ...
    (0:(numOFDMSymbols-1))*symLen,:,:,:), ...
    [2 4 3 1]);
h = zeros(maxFilterLen,numRxAntenna,numTxAntenna,numOFDMSymbols);
for np = 1:numPaths
    h = h + ...
        bsxfun(@times,pathFilters(np,:).',pathGainsLink(np,:,:,:));
end
impulseResponse = zeros( ...
    numOFDMSymbols*symLen,numRxAntenna,numTxAntenna);
for n = 1:numOFDMSymbols
    idx = cpLen + (n-1)*symLen + (1:maxFilterLen);
    impulseResponse(idx,:,:) = impulseResponse(idx,:,:) + h(:,:,:,n);
end
H = zeros( ...
    numDataSubcarriers,numOFDMSymbols,numTxAntenna,numRxAntenna);
for nt = 1:numTxAntenna
    H(:,:,nt,:) = ofdmdemod( ...
        impulseResponse(:,:,nt),fftLen,cpLen,cpLen,ofdmNullIdx);
end
hEst = reshape(H,[],numTxAntenna,numRxAntenna);

Demodulate and equalize the OFDM symbols.

rxSym = ofdmdemod(rxSignal,fftLen,cpLen,cpLen,ofdmNullIdx);
eqSym = ofdmEqualize(rxSym,hEst,Algorithm="zf");
refConst = qammod(0:modOrder-1,modOrder,UnitAveragePower=true);
constellationDiagram = comm.ConstellationDiagram( ...
    XLimits=[-2 2], ...
    YLimits=[-2 2], ...
    ReferenceConstellation=refConst);
constellationDiagram(eqSym(:));

Initialize variables for simulation of a MIMO system and a 120-resource-element subset of the OFDM subcarrier-symbol grid.

Nre = 120;
Nt = 4;
Nr = 8;
nvar = 0.1;

Create random signals for a 2-D symbol array and a channel estimate.

rxsym2d = complex(randn(Nre,Nr),randn(Nre,Nr));
Hest = complex(randn(Nre,Nt,Nr),randn(Nre,Nt,Nr));

Apply OFDM equalization to the 2-D signal contained in an 120-by-8 symbol array.

[eqsym2d,csi2d] = ofdmEqualize(rxsym2d,Hest,nvar,DataFormat="2-D");

Reshape the 2-D signal to a 30-by-4-by-8 symbol array. Apply OFDM equalization to the 3-D signal. Compare the results of OFDM equalization for the 30-by-4-by-8 symbol array with OFDM equalization for the 120-by-8 symbol array. As the isequal function result shows, the equalized symbols and soft channel state information returned for the 30-by-4-by-8 and 120-by-8 symbol arrays are equal.

rxsym3d = reshape(rxsym2d,30,4,Nr);
[eqsym3d,csi3d] = ofdmEqualize(rxsym3d,Hest,nvar,DataFormat="3-D");
isequal(eqsym3d,reshape(eqsym2d,30,4,Nt))
ans = logical
   1

isequal(csi3d,csi2d)
ans = logical
   1

Reshape the 2-D signal to a 60-by-2-by-8 symbol array. Apply OFDM equalization to the 3-D signal. Compare the results of OFDM equalization for the 60-by-2-by-8 symbol array with OFDM equalization for the 120-by-8 symbol array. As the isequal function result shows, the equalized symbols and soft channel state information returned for the 60-by-2-by-8 and 120-by-8 symbol arrays are equal.

rxsym3d2 = reshape(rxsym2d,60,2,Nr);
[eqsym3d2,csi3d2] = ofdmEqualize(rxsym3d2,Hest,nvar,DataFormat="3-D");
isequal(eqsym3d2,reshape(eqsym2d,60,2,Nt))
ans = logical
   1

isequal(csi3d2,csi2d)
ans = logical
   1

Input Arguments

collapse all

Received symbols, specified as a 3-D or 2-D array.

  • If DataFormat is set to "3-D", the function expects rxsym to be specified as an NSC-by-NSymbols-by-NR array. NSC represents the number of OFDM subcarriers, NSymbols represents the number of OFDM symbols, and NR represents the number of receive antennas.

  • If DataFormat is set to "2-D", the function expects rxsym to be specified as an NRE-by-NR array. NRE represents the number of resource elements in an irregular subset of the OFDM subcarrier symbol grid.

Data Types: double | single
Complex Number Support: Yes

Channel estimate, specified as a 3-D array.

  • If DataFormat is set to "3-D", the function expects hest to be an NSC-by-NT-by-NR or an (NSC×NSymbols)-by-NT-by-NR array.

    • If hest is an NSC-by-NT-by-NR array, all OFDM symbols in rxsym are equalized by the same channel estimate. NSC represents the number of OFDM subcarriers, NT represents the number of transmit antennas, and NR represents the number of receive antennas.

    • If hest is an (NSC×NSymbols)-by-NT-by-NR array, each OFDM symbol in rxsym is equalized by the corresponding entry in hest. NSymbols represents the number of OFDM symbols.

  • If DataFormat is set to "2-D", the function expects hest to be an NRE-by-NT-by-NR array. Each OFDM symbol in rxsym is equalized by the corresponding entry in hest. NRE represents the number of resource elements in an irregular subset of the OFDM subcarrier symbol grid.

Data Types: double | single
Complex Number Support: Yes

Noise variance estimate for MMSE equalization, specified as a nonnegative scalar.

Dependencies

The noise variance setting is used only when you set Algorithm to "mmse".

Data Types: double | single

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: ofdmEqualize(rxsym,hest,DataFormat="2-D") equalizes an NRE-by-NR input OFDM symbol array using the MMSE algorithm.

Equalization algorithm, specified as "mmse" or "zf".

  • When this argument is set to "mmse", the function equalizes using the MMSE algorithm.

  • When this argument is set to "zf", the function equalizes using the zero-forcing algorithm. When using the zero-forcing algorithm, the nvar argument value is ignored.

Format of the signals, specified as "3-D" or "2-D".

When this argument is set to "3-D", OFDM subcarriers and OFDM symbols use two separate dimensions in the representation of rxsym and eqsym.

  • The rxsym input must be an NSC-by-NSymbols-by-NR array.

  • The eqsym output is returned as an NSC-by-NSymbols-by-NT array.

When this argument is set to "2-D", OFDM subcarriers and OFDM symbols use one combined dimension in the representation of rxsym and eqsym.

  • The rxsym input must be an NRE-by-NR array.

  • The eqsym output is returned as an NRE-by-NT array.

NSC represents the number of OFDM subcarriers. NSymbols represents the number of symbols. NRE represents the number of resource elements in an irregular subset of the OFDM subcarrier symbol grid. NT represents the number of transmit antennas. NR represents the number of receive antennas.

Output Arguments

collapse all

Equalized symbols, returned as a 3-D or 2-D array.

  • If DataFormat is set to "3-D", the function returns an NSC-by-NSymbols-by-NT array. NSC represents the number of OFDM subcarriers, NSymbols represents the number of OFDM symbols, and NT represents the number of transmit antennas.

  • If DataFormat is set to "2-D", the function returns an NRE-by-NT array. NRE represents the number of resource elements in an irregular subset of the OFDM subcarrier symbol grid.

Soft channel state information, returned as a matrix with size(csi,1) = size(hest,1) and size(csi,2) = NT = size(hest,2). NT represents the number of transmit antennas.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2022b