Main Content

경판정 및 연판정 비터비 디코딩의 BER 추정하기

AWGN에서 경판정 및 연판정 비터비 디코더의 비트 오류율(BER) 성능을 추정합니다. 이 성능을 코딩되지 않은 64-QAM 링크의 성능과 비교합니다.

시뮬레이션 파라미터를 설정합니다.

rng default
M = 64;                % Modulation order
k = log2(M);           % Bits per symbol
EbNoVec = (4:10)';     % Eb/No values (dB)
numSymPerFrame = 1000; % Number of QAM symbols per frame

BER 결과 벡터를 초기화합니다.

berEstSoft = zeros(size(EbNoVec)); 
berEstHard = zeros(size(EbNoVec));

비율 1/2, 제약 길이(constraint length) 7, 컨벌루션 코드로 트렐리스 구조체와 역추적 깊이를 설정합니다.

trellis = poly2trellis(7,[171 133]);
tbl = 32;
rate = 1/2;

주 처리 루프에서는 다음 단계를 수행합니다.

  • 이진 데이터를 생성합니다.

  • 데이터에 컨벌루션 인코딩을 수행합니다.

  • 데이터 심볼에 QAM 변조를 적용합니다. 송신된 신호의 단위 평균 전력을 지정합니다.

  • 변조된 신호를 AWGN 채널에 통과시킵니다.

  • 경판정과 근사 LLR 방법을 사용하여 수신된 신호를 복조합니다. 수신된 신호의 단위 평균 전력을 지정합니다.

  • 경판정과 비양자화 방법을 사용하여 신호에 비터비 디코딩을 수행합니다.

  • 비트 오류 개수를 계산합니다.

while 루프는 100개의 오류가 발생하거나 107비트가 송신될 때까지 데이터를 계속 처리합니다.

for n = 1:length(EbNoVec)
    % Convert Eb/No to SNR
    snrdB = EbNoVec(n) + 10*log10(k*rate);
    % Noise variance calculation for unity average signal power
    noiseVar = 10.^(-snrdB/10);
    % Reset the error and bit counters
    [numErrsSoft,numErrsHard,numBits] = deal(0);
    
    while numErrsSoft < 100 && numBits < 1e7
        % Generate binary data and convert to symbols
        dataIn = randi([0 1],numSymPerFrame*k,1);
        
        % Convolutionally encode the data
        dataEnc = convenc(dataIn,trellis);
        
        % QAM modulate
        txSig = qammod(dataEnc,M, ...
            InputType='bit', ...
            UnitAveragePower=true);
        
        % Pass through AWGN channel
        rxSig = awgn(txSig,snrdB,'measured');
        
        % Demodulate the noisy signal using hard decision (bit) and
        % soft decision (approximate LLR) approaches.
        rxDataHard = qamdemod(rxSig,M, ...
            OutputType='bit', ...
            UnitAveragePower=true);
        rxDataSoft = qamdemod(rxSig,M, ...
            OutputType='approxllr', ...
            UnitAveragePower=true, ...
            NoiseVariance=noiseVar);
        
        % Viterbi decode the demodulated data
        dataHard = vitdec(rxDataHard,trellis,tbl,'cont','hard');
        dataSoft = vitdec(rxDataSoft,trellis,tbl,'cont','unquant');
        
        % Calculate the number of bit errors in the frame. 
        % Adjust for the decoding delay, which is equal to 
        % the traceback depth.
        numErrsInFrameHard = ...
            biterr(dataIn(1:end-tbl),dataHard(tbl+1:end));
        numErrsInFrameSoft = ...
            biterr(dataIn(1:end-tbl),dataSoft(tbl+1:end));
        
        % Increment the error and bit counters
        numErrsHard = numErrsHard + numErrsInFrameHard;
        numErrsSoft = numErrsSoft + numErrsInFrameSoft;
        numBits = numBits + numSymPerFrame*k;

    end
    
    % Estimate the BER for both methods
    berEstSoft(n) = numErrsSoft/numBits;
    berEstHard(n) = numErrsHard/numBits;
end

추정된 하드 및 소프트 BER 데이터를 플로팅합니다. 코딩되지 않은 64-QAM 채널의 이론적 성능을 플로팅합니다.

semilogy(EbNoVec,[berEstSoft berEstHard],'-*')
hold on
semilogy(EbNoVec,berawgn(EbNoVec,'qam',M))
legend('Soft','Hard','Uncoded','location','best')
grid
xlabel('Eb/No (dB)')
ylabel('Bit Error Rate')

Figure contains an axes object. The axes object with xlabel Eb/No (dB), ylabel Bit Error Rate contains 3 objects of type line. These objects represent Soft, Hard, Uncoded.

예상대로 연판정 디코딩이 최상의 결과를 생성합니다.