Hi all,
I am trying to recreate an LTE compliant waveform ('A2-1') but I am running into some trouble. the current command: lteTurboEncode.m only supports R=1/3 turbo coding which i believe is leading me to biterrors when i go to undo all of the rate match, demodulation, etc.
Bottom line: Is there a way to implement 2/3 encoding? I've tried used the comms toolboox too, but with no luck.
Code is posted below. I highlighted in bold where I believe the issue is. You'll notice some is underlined too. that was my attempt at using the comms tool box to fix the problem, which is separate from the lte toolbox attempt (not underlined, but still in bold).
Thank you!
frc=lteRMCUL('A2-1');
frc.TotSubframes=1;
txdata=randi([0 1], frc.PUSCH.TrBlkSizes(1)*frc.TotSubframes, 1);
TrBLKcrc = lteCRCEncode(txdata,'24A');
%% PROBLEM HERE. %2/3 Rate Turbo encoding the bits.
trellis = poly2trellis([5 4],[23 35 0; 0 5 13]);
convEncoder = comm.ConvolutionalEncoder('TrellisStructure',trellis);
TRBOcodeBLK = convEncoder(TrBLKcrc);
TRBOcodeBLK = lteTurboEncode(TrBLKcrc);
%% END
TxTrBLKcrc = lteRateMatchTurbo(TRBOcodeBLK,frc.PUSCH.CodedTrBlkSizes(1),0,frc.PUSCH);
QAMsyms = lteSymbolModulate(TxTrBLKcrc,'16QAM');
[antseq,info,layerseq] = ltePUSCHDRS(frc,frc.PUSCH);
DRSind = ltePUSCHDRSIndices(frc,frc.PUSCH);
PUSCHind = ltePUSCHIndices(frc,frc.PUSCH);
TxSYMS(DRSind)=antseq;
TxSYMS(PUSCHind)=QAMsyms;
dims = lteULResourceGridSize(frc);
TxGrid = reshape(TxSYMS,[72 14]);
txWaveform = lteSCFDMAModulate(frc,TxGrid);
RxGrid = lteSCFDMADemodulate(frc,txWaveform);
RxSYMS = reshape(RxGrid,[prod(dims) 1]);
Rxbits = lteSymbolDemodulate(RxSYMS(PUSCHind),'16QAM','Hard');
undoRatematch = lteRateRecoverTurbo(Rxbits,frc.PUSCH.TrBlkSizes(1),0,frc.PUSCH);
%% This is where the problem lies!!!%%
traceBack = 16;
vitDecoder = comm.ViterbiDecoder('TrellisStructure',trellis,'InputFormat','Hard','TracebackDepth',traceBack);
RxTrBLKcrc = vitDecoder(cell2mat(undoRatematch));
RxTrBLKcrc = lteTurboDecode(undoRatematch);
[blk,err] = lteCRCDecode(RxTrBLKcrc,'24A'); %err should 0 if no problems.
Best Answer