📄 mctc_dec.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Property of Freescale
% Freescale Confidential Proprietary
% Freescale Copyright (C) 2005 All rights reserved
% ----------------------------------------------------------------------------
% $RCSfile: mCTC_dec.m.rca $
% $Revision: 1.1 $
% $Date: Mon Jan 22 10:59:12 2007 $
% Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% CTC decoder (INT3e version: no HARQ, no feedback, no SPID)
% Input:
% In : input data (vector or matrix)
% BlockSize : data size
% nIter : number of iteration for CTC decoder
% Type : FEC info
%
% Output:
% Out : output data (vector or matrix)
% BlockSize : data size
function [Out,BlkSize] = mCTC_dec (In,BlockSize,nIter,Type)
%-- Parameters setting
switch Type
case 0 % QPSK rate 1/2
rate = 2 ;
case 1 % QPSK rate 3/4
rate = 4/3 ;
case 2 % 16QAM rate 1/2
rate = 2 ;
case 3 % 16QAM rate 3/4
rate = 4/3 ;
case 4 % 64QAM rate 1/2
%tbd
case 5 % 64QAM rate 2/3
%tbd
case 6 % 64QAM rate 3/4
%tbd
otherwise
error('Unknown FEC Type')
end
Nep = BlockSize./rate;
%loop over col of In
for i=1:size(In,2)
clear dec_y inputA inputB
%-- De-puncture
de_puncturing = [ In(1:BlockSize(i),i)' zeros(1, (Nep(i)*3 -BlockSize(i)))];
%-- Degrouping
de_group = mCTC_degrouping(de_puncturing); %to move
%-- Subblock deinterleaving
sub_deinter_y = mCTC_SubDIL(de_group);%to move
% Format change (easy for reading)
x_sysA = sub_deinter_y(1,:);
x_sysB = sub_deinter_y(2,:);
parity_y1 = sub_deinter_y(3,:);
parity_y2 = sub_deinter_y(4,:);
parity_w1 = sub_deinter_y(5,:);
parity_w2 = sub_deinter_y(6,:);
% Get the input data for both decoders
% 1st decoder: A, B, Y1, W1
% 2nd decoder: interleaved_A, interleaved_B, Y2, W2
dec_y(1,:) = reshape([x_sysA;x_sysB;parity_y1;parity_w1],1,Nep(i)*2);
% IL
[inputA,inputB] = mCTC_ILDIL(Nep(i),x_sysA,x_sysB) ;
dec_y(2,:) = reshape([inputA;inputB;parity_y2;parity_w2],1,Nep(i)*2);
% single Turbo decoder
Out(1:Nep(i),i) = mCTC_RSCDec(dec_y, Nep(i), nIter);
BlkSize(i)=Nep(i);
end
%data packing
Out = mBytePack(Out);
BlkSize=(BlkSize)/8;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -