OFDM Modulator
Creating OFDM Modulator
hMod = comm.OFDMModulator;
hModInfo = info(hMod);
|
hMod |
|
Properties: FFTLength: 64 NumGuardBandCarriers: [6;5] InsertDCNull: false PilotInputPort: false CyclicPrefixLength: 16 Windowing: false NumSymbols: 1 NumTransmitAntennas: 1 |
|
hModInfo |
|
DataInputSize: [53 1] OutputSize: [80 1] |
FFTLength = NumGuardBandCarriers(1) + DataInputSize + NumGuardBandCarriers(2) = 6 + 53 + 5 = 64
OutputSize = FFTLength + CyclicPrefixLength = 64 + 16 = 80
Generating OFDM Symbol Data with Default Setting
hMod = comm.OFDMModulator;
hModInfo = info(hMod);
rng(0);
dataIn = complex(randn(hModInfo.DataInputSize),randn(hModInfo.DataInputSize));
modData = step(hMod,dataIn);
subplot(2,1,1);
stem(abs(dataIn));xlim([1 length(dataIn)]);title('Input Data');
subplot(2,1,2);
stem(abs(modData));xlim([1 length(modData)]); title('Output Data');

Generating OFDM Symbol Data with Internal Procedure
hMod = comm.OFDMModulator;
hModInfo = info(hMod);
rng(0);
dataIn = complex(randn(hModInfo.DataInputSize),randn(hModInfo.DataInputSize));
dataInGuardBand = [zeros(hMod.NumGuardBandCarriers(1),1); ...
dataIn; ...
zeros(hMod.NumGuardBandCarriers(2),1)];
dataInGuardBandIfft = ifft(dataInGuardBand);
CP = dataInGuardBandIfft(length(dataInGuardBandIfft)-(hMod.CyclicPrefixLength)+1: ...
length(dataInGuardBandIfft));
dataInGuardBandIfftCP = [CP ; dataInGuardBandIfft];
modData = step(hMod,dataIn);
subplot(5,1,1);
stem(abs(dataIn));xlim([1 length(dataIn)]);title('Input Data');
subplot(5,1,2);
stem(abs(dataInGuardBand));xlim([1 length(dataInGuardBand)]);title('Input Data + GuardBand');
subplot(5,1,3);
stem(abs(dataInGuardBandIfft ));xlim([1 length(dataInGuardBandIfft)]);title('IFFT(Input Data + GuardBand)');
subplot(5,1,4);
stem(abs(dataInGuardBandIfftCP ));xlim([1 length(dataInGuardBandIfftCP)]);title('CP + IFFT(Input Data + GuardBand)');
subplot(5,1,5);
stem(abs(modData));xlim([1 length(modData)]); title('Output Data');
