주요 콘텐츠

MIMO 시뮬레이션에 OFDM 적용하기

간단한 2x2 단일 사용자 MIMO 오류율 시뮬레이션에서 OFDM 변조기와 복조기를 사용합니다. OFDM 파라미터는 802.11n 표준에 따라 결정됩니다.

사용자가 지정한 파일럿 인덱스, 삽입된 DC null, 2개의 송신 안테나, 2개의 수신 안테나를 사용하여 OFDM 변조기와 복조기 쌍을 만듭니다. 안테나마다 다른 파일럿 인덱스를 지정합니다.

ofdmMod = comm.OFDMModulator(FFTLength=128, ...
    PilotInputPort=true, ...
    NumSymbols=3, ...
    PilotCarrierIndices= ...
    cat(3,[12; 40; 54; 76; 90; 118],[13; 39; 55; 75; 91; 117]), ...
    InsertDCNull=true, ...
    NumTransmitAntennas=2);
ofdmDemod = comm.OFDMDemodulator(ofdmMod);
ofdmDemod.NumReceiveAntennas = 2;

각 송신 안테나에 대한 파일럿 부반송파의 리소스 매핑을 표시합니다. 그림의 회색 선은 파일럿 신호 간섭을 최소화하기 위해 null 부반송파를 삽입한 것을 나타냅니다.

showResourceMapping(ofdmMod)

Figure OFDM Subcarrier Mapping for Tx Antenna 1 contains an axes object. The axes object with title OFDM Subcarrier Mapping for Tx Antenna 1, xlabel OFDM Symbols, ylabel Subcarrier Indices contains an object of type image.

Figure OFDM Subcarrier Mapping for Tx Antenna 2 contains an axes object. The axes object with title OFDM Subcarrier Mapping for Tx Antenna 2, xlabel OFDM Symbols, ylabel Subcarrier Indices contains an object of type image.

info 메서드를 사용하여 OFDM 변조기의 차원을 확인합니다.

ofdmModDim = info(ofdmMod);
numDataSc = ofdmModDim.DataInputSize(1); % Number of data subcarriers
numSym = ofdmModDim.DataInputSize(2);    % Number of OFDM symbols
numTxAnt = ofdmModDim.DataInputSize(3);  % Number of transmit antennas

QPSK 변조를 사용하여 100개의 OFDM 프레임을 생성하도록 파라미터를 설정합니다.

nframes = 100;
M = 4; % Modulation order to QPSK

오류율 카운터를 만듭니다.

errorRate = comm.ErrorRate;

평탄한 2x2 레일리 페이딩 채널을 가정하여 100개의 프레임에 대해 OFDM 시스템을 시뮬레이션합니다. 간단한 최소제곱해를 사용하여 다중 경로 페이딩의 영향을 제거하고 OFDM 파형과 QPSK 데이터를 복조합니다. 원래 데이터와 복조된 데이터를 비교하여 오류 통계량을 생성합니다.

for k = 1:nframes

    % Generate a frame of user data
    dataIn = randi([0 M-1],numDataSc*numSym*numTxAnt,1);

    % Split the user data into two different streams and map to QPSK
    % symbols
    streamDataOut = reshape(dataIn,numTxAnt,[]).';
    mapperOut = pskmod(streamDataOut,M,pi/4);

    % Generate random OFDM pilot symbols
    pilotData = complex(rand(ofdmModDim.PilotInputSize), ...
        rand(ofdmModDim.PilotInputSize));

    % Reshape the modulated data streams to match the OFDM modulator
    % requirements and modulate the symbols using OFDM
    ofdmModData = reshape(mapperOut,numDataSc,numSym,numTxAnt);
    dataOFDM = ofdmMod(ofdmModData,pilotData);

    % Create flat, i.i.d., Rayleigh fading channel 2-by-2 channel
    chGain = complex(randn(2,2),randn(2,2))/sqrt(2); 

    % Pass OFDM signal through Rayleigh and AWGN channels
    receivedSignal = awgn(dataOFDM*chGain,30);

    % Apply least squares solution to remove effects of fading channel
    rxSigMF = chGain.' \ receivedSignal.';

    % Demodulate OFDM data
    receivedOFDMData = ofdmDemod(rxSigMF.');

    % Form the received streams
    receivedOFDMStreams = reshape(receivedOFDMData,[],numTxAnt);

    % Demodulate QPSK data
    receivedStreams = pskdemod(receivedOFDMStreams,M,pi/4);

    % Demap the data from each rx stream back to the user data
    receivedData = reshape(receivedStreams.',[],1);

    % Compute error statistics
    errors = errorRate(dataIn,receivedData);
end

오류 통계량을 표시합니다.

fprintf('\nSymbol error rate = %d from %d errors in %d symbols\n',errors)
Symbol error rate = 8.996795e-02 from 5614 errors in 62400 symbols

참고 항목

함수

객체

도움말 항목