classdef TurboDecoder < matlab.system.System %#ok<*EMCLS>
%TurboDecoder Decode input using a turbo decoder.
% H = comm.TurboDecoder creates a turbo decoder System object, H. This
% object uses the a-posteriori probability (APP) constituent decoder to
% iteratively decode the parallel-concatenated convolutionally encoded
% input data.
%
% H = comm.TurboDecoder(Name, Value) creates a turbo decoder object, H,
% with the specified property Name set to the specified Value. You can
% specify additional name-value pair arguments in any order as
% (Name1, Value1, ... , NameN, ValueN).
%
% H = comm.TurboDecoder(TRELLIS, INTERLVRINDICES, NUMITER) creates a
% turbo decoder object, H, with the TrellisStructure property set to
% TRELLIS, the InterleaverIndices property set to INTERLVRINDICES and
% the NumIterations property set to NUMITER.
%
% Step method syntax:
%
% Y = step(H, X) decodes the input data, X, using the parallel
% concatenated convolutional coding scheme that you specify using the
% TrellisStructure and InterleaverIndices properties. It returns the
% binary decoded data, Y. Both X and Y are column vectors of double or
% single precision data type. When the constituent convolutional code
% represents a rate 1/N code, the step method sets the length of the
% output vector, Y, to (M-2*numTails)/(2*N-1), where M is the input
% vector length and numTails is given by
% log2(TrellisStructure.numStates)*N. The output length, L, is the same
% as the length of the interleaver indices.
%
% Y = step(H, X, INTERLVRINDICES) uses the INTERLVRINDICES specified as
% an input. INTERLVRINDICES is a column vector containing integer values
% from 1 to L with no repeated values. The lengths of the INTERLVRINDICES
% input and the Y output are the same.
%
% TurboDecoder methods:
%
% step - Perform turbo decoding (see above)
% release - Allow property value and input characteristics changes
% clone - Create turbo decoder object with same property values
% isLocked - Locked status (logical)
%
% TurboDecoder properties:
%
% TrellisStructure - Trellis structure of constituent
% convolutional code
% InterleaverIndicesSource - Source of interleaving indices
% InterleaverIndices - Interleaving indices
% Algorithm - Decoding algorithm
% NumScalingBits - Number of scaling bits
% NumIterations - Number of decoding iterations
%
% % Example:
% % Transmit turbo-encoded blocks of data over a BPSK-modulated AWGN
% % channel, decode using an iterative turbo decoder and display errors
%
% noiseVar = 4; frmLen = 256;
% s = RandStream('mt19937ar', 'Seed', 11);
% intrlvrIndices = randperm(s, frmLen);
%
% hTEnc = comm.TurboEncoder('TrellisStructure', poly2trellis(4, ...
% [13 15 17], 13), 'InterleaverIndices', intrlvrIndices);
% hMod = comm.BPSKModulator;
% hChan = comm.AWGNChannel('NoiseMethod', 'Variance', 'Variance', noiseVar);
% hTDec = comm.TurboDecoder('TrellisStructure', poly2trellis(4, ...
% [13 15 17], 13), 'InterleaverIndices', intrlvrIndices, ...
% 'NumIterations', 4);
% hError = comm.ErrorRate;
%
% for frmIdx = 1:8
% data = randi(s, [0 1], frmLen, 1);
% encodedData = step(hTEnc, data);
% modSignal = step(hMod, encodedData);
% receivedSignal = step(hChan, modSignal);
%
% % Convert received signal to log-likelihood ratios for decoding
% receivedBits = step(hTDec, (-2/(noiseVar/2))*real(receivedSignal));
%
% errorStats = step(hError, data, receivedBits);
% end
% fprintf('Error rate = %f\nNumber of errors = %d\nTotal bits = %d\n', ...
% errorStats(1), errorStats(2), errorStats(3))
%
% See also comm.TurboEncoder, comm.APPDecoder.
% Notice: Supply of this software does not convey a license nor imply any
% right to use any Turbo codes patents owned by France Telecom,
% Telediffusion de France and/or Groupe des Ecoles des Telecommunications
% except in connection with use of the software for the purposes of design,
% simulation and analysis. Code generated from Turbo codes technology in
% this software is not intended and/or suitable for implementation or
% incorporation in any commercial products.
%
% Please contact France Telecom for information about Turbo Codes Licensing
% program at the following address: France Telecom R&D - PIV/TurboCodes
% 38-40, rue du General Leclerc 92794 Issy-les-Moulineaux Cedex 9, France.
% Copyright 2011 The MathWorks, Inc.
%#codegen
properties (Nontunable)
%TrellisStructure Trellis structure of constituent convolutional code
% Specify the trellis as a MATLAB structure that contains the trellis
% description of the constituent convolutional code. Use the istrellis
% function to check if a structure is a valid trellis structure. The
% default is the result of poly2trellis(4, [13 15], 13).
%
% See also istrellis, poly2trellis.
TrellisStructure = poly2trellis(4, [13 15], 13);
%InterleaverIndicesSource Source of interleaver indices
% Specify the source of the interleaver indices as one of 'Property' |
% 'Input port'. The default is 'Property'. When you set this property
% to 'Input port' the object uses the interleaver indices specified as
% an input to the step method. When you set this property to
% 'Property', the object uses the interleaver indices that you specify
% in the InterleaverIndices property.
InterleaverIndicesSource = 'Property';
%InterleaverIndices Interleaver indices
% Specify the mapping used to permute the input bits at the encoder as
% a column vector of integers. The default is (64:-1:1).'. This mapping
% is a vector with the number of elements equal to length, L,
% of the output of the step method. Each element must be an integer
% between 1 and L, with no repeated values.
InterleaverIndices = (64:-1:1).';
%Algorithm Decoding algorithm
% Specify the decoding algorithm that the object uses for decoding as
% one of 'True APP' | 'Max*' | 'Max'. The default is 'TrueAPP'. When
% you set this property to 'True APP', the object implements true a
% posteriori probability decoding. When you set this property to any
% other value, the object uses approximations to increase the speed of
% the computations.
Algorithm = 'True APP';
%NumScalingBits Number of scaling bits
% Specify the number of bits the constituent decoders use to scale the
% input data to avoid losing precision during computations. The
% constituent decoders multiply the input by 2^NumScalingBits and
% divide the pre-output by the same factor. NumScalingBits must be a
% scalar integer between 0 and 8. This property applies when you set
% the Algorithm property to 'Max*'. The default is 3.
NumScalingBits = 3;
%NumIterations Number of decoding iterations
% Specify the number of decoding iterations used for each call to the
% step method. The default is 6. The object will iterate and provide
% updates to the log-likelihood ratios (LLR) of the uncoded output
% bits. The output of the step method is the hard-decision output of
% the final LLR update.
NumIterations = 6;
end
properties (Constant, Hidden)
InterleaverIndicesSourceSet = comm.CommonSets.getSet('SpecifyInputs');
AlgorithmSet = comm.CommonSets.getSet('Algorithm');
end
properties(Access = private, Nontunable)
% Constituent components
cAPPDec1; % decoder1
cAPPDec2; % decoder2
% Commonly used attributes
pK; % number of uncoded bits
pN; % number of coded bits
pMLen; % memory length of a constituent encoder
pNumTails; % number of tail bits per constituent encoder
end
methods
% CONSTRUCTOR
function obj = TurboDecoder(varargin)
setProperties(obj, nargin, varargin{:}, 'TrellisS
没有合适的资源?快使用搜索试试~ 我知道了~
turbo.rar_turbo_turbo code_turbo codes
共3个文件
m:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 172 浏览量
2022-07-14
21:43:20
上传
评论
收藏 9KB RAR 举报
温馨提示
Parallel Concatenated Convolutional Coding: Turbo Codes
资源详情
资源评论
资源推荐
收起资源包目录
turbo.rar (3个子文件)
turbo
TurboEncoder.m 10KB
TurboDecoder.m 14KB
commTurboCoding.m 3KB
共 3 条
- 1
刘良运
- 粉丝: 66
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0