OFDM with User-Specified Pilot Indices in MATLAB

www.spiroprojects.com



This example shows how to construct an orthogonal frequency division modulation (OFDM) modulator/demodulator pair and to specify their pilot indices. The OFDM modulator System object enables you to specify pilot subcarrier indices consistent with the constraints described in comm.OFDMModulator.info. In this example, for OFDM transmission over a 3x2 channel, pilot indices are created for each of the three transmit antennas. Additionally, the pilot indices differ between odd and even symbols.
Create an OFDM modulator object having five symbols, three transmit antennas, and length six windowing.

hMod = comm.OFDMModulator('FFTLength',256, ...
             'NumGuardBandCarriers',[12;11], ...
             'NumSymbols',5, ...
            'NumtransmitAntennas',3, ...
            'PilotInputPort',true, ...
            'Windowing',true, ...
            'WindowLength', 6);

Specify pilot indices for even and odd symbols for the first transmit antenna.

pilotIndOdd = [20; 58; 96; 145; 182; 210];
pilotIndEven = [35; 73; 111; 159; 197; 225];

pilotIndicesAntl = cat(2, pilotIndOdd, pilotIndEven, pilotIndOdd, ...
                             pilotIndEven, pilotIndOdd);

Generate pilot indices for the second and third antennas based on the indices specified for the first antenna. Concatenate the indices for the three antennas and assign them to the PilotCarrierIndices property.

pilotIndicesAnt2 = pilotIndicesAnt1 + 5;
pilotIndicesAnt3 = pilotIndicesAnt1 - 5;

hMod.PilotCarrierIndices = cat(3, pilotIndicesAnt1, pilotIndicesAnt2, pilotIndicesAnt3);

Create on OFDM demodulator with two receive antennas based on the existing OFDM modulator System object. Determine the data and pilot dimensions using the info method.

hDemod = comm.OFDMDemodulator(hMod);
hDemod.NumReceiveAntennas = 2;

modDim = info(hMod)

modDim = DataInputSize: [215 5 3]
                 PilotInputSize: [6 5 3]
                 OutputSize: [1360 3]


Generate data and pilot symbols for the OFDM modulator given the array sizes
specified  in  modDim .
dataIn = complex(randn(modDim.DataInputSize), randn(modDim.DataInputSize));
pilotIn = complex(randn(modDim.PilotInputSize), randn(modDim.PilotInputSize));

Apply OFDM modulation to the data and pilots.
modOut = step(hMod, dataIn, pilotIn);
 
Pass the modulated data through a 3x2 random channel.
chanGain = complex(randn(3,2), randn(3,2));
chanOut = modOut * chanGain;
Demodulate the received data using the OFDM demodulator object.
[dataOut, pilotOut] = step(hDemod, chanOut);
 
Show the resource mapping for the three transmit antennas. The gray lines in the figure show the placement of custom nulls to avoid interference among antennas.
showResourceMapping(hMod)



For the first transmit and first receive antenna pair, demonstrate that the input pilot signal matches the input pilot signal.
pilotCompare = abs(pilotIn(:,:,1)*chanGain(1,1)) - abs(pilotOut(:,:,1,1));
max(pilotCompare(:) <1e-10)
ans = 1


 
Previous
Next Post »