⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 condecoder.m

📁 详细的OFDM设计过程
💻 M
字号:
function  dehard = condecoder(code)

% This is simulation for convolutioanl decoder.
% Based on the encoder of Matlab file "conencoder"

% - code: input of the decoder
% - desoft: decoded signal by soft decoding
% - dehard: decoded signal by hard decoding
% - n_encoderbits: rate 1/n_encoderbits

% ------- condecoder.m ------------------------------------
% Black team
% April-08-05
% ----------------------------------------------------------

% trellis = poly2trellis(constraintlength, codegenerator)

% Convert convolutional code polynomial to rellis description
% - CONSTRAINTLENGTH is a 1-by-k vector specifying the delay for each of the k input 
%     bit streams.
% - CODEGENERATOR is a k-by-n matrix of octal numbers specifying the n output 
%     connections for each of the k inputs.
% perform the binary-to-octal conversion in MATLAB by using code like 
%    str2num(dec2base(bin2dec('110'),8))

global encoder_order
n_encoderbits = encoder_order;

% DECODING 
    if n_encoderbits==2
        trellis = poly2trellis(3,[7 5]);
        tblen=1;
%         desoft = vitdec(code,trellis,tblen,'cont','soft',1);
        dehard = vitdec(code,trellis,tblen,'trunc','hard');
    end

    if n_encoderbits==3
        trellis3 = poly2trellis(3,[7 7 5]);
        tblen=1;
%         desoft = vitdec(code,trellis3,tblen,'cont','soft',1);
        dehard = vitdec(code,trellis3,tblen,'trunc','hard');
    end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -