Communication Technology

 

 

 

 

OFDM DeModulator

 

Creating OFDM DeModulator

 

    hMod = comm.OFDMModulator;

    hModInfo = info(hMod);

     

    rng(0);

    dataIn = complex(randn(hModInfo.DataInputSize),randn(hModInfo.DataInputSize));

    modData = step(hMod,dataIn);

     

    hDeMod = comm.OFDMDemodulator(hMod);

    hDeModInfo = info(hDeMod);

     

    hDeMod

      Properties:

                   FFTLength: 64   

        NumGuardBandCarriers: [6;5]

             RemoveDCCarrier: false

             PilotOutputPort: false

          CyclicPrefixLength: 16   

                  NumSymbols: 1    

          NumReceiveAntennas: 1

     

    hDeModInfo

             InputSize: [80 1]

        DataOutputSize: [53 1]

 

FFTLength = NumGuardBandCarriers(1) + DataInputSize +  NumGuardBandCarriers(2) = 6 + 53 + 5 = 64

OutputSize = FFTLength - (NumGuardBandCarriers(1)+NumGuardBandCarriers(2)) = 64 - (6+5) = 53

                = InputSize - CyclicPrefixLength - (NumGuardBandCarriers(1)+NumGuardBandCarriers(2))

                = 80 - 16 - (6 + 5) = 53

 

 

Generating Demodulated OFDM Data with Default Setting

 

    hMod = comm.OFDMModulator;

    hModInfo = info(hMod);

     

    rng(0);

    dataIn = complex(randn(hModInfo.DataInputSize),randn(hModInfo.DataInputSize));

    modData = step(hMod,dataIn);

     

    hDeMod = comm.OFDMDemodulator(hMod);

    hDeModInfo = info(hDeMod);

     

    deModData = step(hDeMod, modData);

     

    subplot(3,1,1);

    stem(abs(dataIn));xlim([1 length(dataIn)]);title('Input Data');

    subplot(3,1,2);

    stem(abs(modData));xlim([1 length(modData)]); title('Mod Data');

    subplot(3,1,3);

    stem(abs(deModData));xlim([1 length(deModData)]); title('Demod Data');

 

Generating Demod OFDM  Data with Internal Procedure

    hMod = comm.OFDMModulator;

    hModInfo = info(hMod);

     

    rng(0);

    dataIn = complex(randn(hModInfo.DataInputSize),randn(hModInfo.DataInputSize));

    modData = step(hMod,dataIn);

     

    modDataNoCP = modData(length(modData)-hMod.FFTLength+1:length(modData));

    modDataNoCPfft = fftshift(fft(modDataNoCP));

    modDataNoCPfftNpGB = modDataNoCPfft(hMod.NumGuardBandCarriers(1)+1 : ...

                                        length(modDataNoCPfft) - hMod.NumGuardBandCarriers(2));

     

    hDeMod = comm.OFDMDemodulator(hMod);

    hDeModInfo = info(hDeMod);

     

    deModData = step(hDeMod, modData);

     

    subplot(6,1,1);

    stem(abs(dataIn));xlim([1 length(dataIn)]);

    title('Input Data');

    set(gca,'xtick',[1 length(dataIn)]);

    subplot(6,1,2);

    stem(abs(modData));xlim([1 length(modData)]);

    title('Mod Data');

    set(gca,'xtick',[1 length(modData)]);

    subplot(6,1,3);

    stem(abs(modDataNoCP));xlim([1 length(modDataNoCP)]);

    title('Mod Data - CP Removed');

    set(gca,'xtick',[1 length(modDataNoCP)]);

    subplot(6,1,4);

    stem(abs(modDataNoCPfft));xlim([1 length(modDataNoCPfft)]);

    title('ShiftFft(FFT(Mod Data - CP Removed))');

    set(gca,'xtick',[1 length(modDataNoCPfft)]);

    subplot(6,1,5);

    stem(abs(modDataNoCPfftNpGB));xlim([1 length(modDataNoCPfftNpGB)]);

    title('ShiftFft(FFT(Mod Data - CP Removed)) - GuardBand Removed');

    set(gca,'xtick',[1 length(modDataNoCPfftNpGB)]);

    subplot(6,1,6);

    stem(abs(deModData));xlim([1 length(deModData)]);

    title('Demod Data');

    set(gca,'xtick',[1 length(deModData)]);