フィルターのクリア

comm.ViterbiDecoder performing worse than vitdec

2 ビュー (過去 30 日間)
Marian Keller
Marian Keller 2023 年 2 月 13 日
コメント済み: Marian Keller 2023 年 3 月 6 日
I'm trying to get a simple "Hello World" example of convolutional coding and decoding to work. For some reason, the comm.ViterbiDecoder won't ever correctly decode the data, no matter which options I tried, while vitdec works just fine.
trellis = poly2trellis(7,[171 133]);
encoder1 = comm.ConvolutionalEncoder(trellis);
data = randi([0 1],70,1);
codedData = encoder1(data);
tbdepth = 34;
commDecoder = comm.ViterbiDecoder(trellis, 'TracebackDepth', tbdepth, 'InputFormat','Hard','TerminationMethod','Terminated');
decodedData1 = vitdec(codedData,trellis,tbdepth,'trunc','hard');
decodedData2 = commDecoder(codedData);
BER1 = biterr(data,decodedData1)
BER1 = 0
BER2 = biterr(data,decodedData2)
BER2 = 5

採用された回答

Nadia Shaik
Nadia Shaik 2023 年 3 月 6 日
Hi Marian,
I understand that "comm.ViterbiDecoder" is not decoding the data as compared to "vitdec". The different termination methods could explain why the bit error rate differs between the two decoders.
In your case, you are using the "Terminated" method for "comm.ViterbiDecoder", and "trunc" for "vitdec". Consider setting the termination method "Truncated" for "comm.ViterbiDecoder" instead.
Here is the updated code snippet:
trellis = poly2trellis(7,[171 133]);
encoder1 = comm.ConvolutionalEncoder(trellis);
data = randi([0 1],70,1);
codedData = encoder1(data);
tbdepth = 34;
commDecoder = comm.ViterbiDecoder(trellis, 'TracebackDepth', tbdepth, 'InputFormat','Hard','TerminationMethod','Truncated');
decodedData1 = vitdec(codedData,trellis,tbdepth,'trunc','hard');
decodedData2 = commDecoder(codedData);
BER1 = biterr(data,decodedData1)
BER1 = 0
BER2 = biterr(data,decodedData2)
BER2 = 0
I hope this helps!
  1 件のコメント
Marian Keller
Marian Keller 2023 年 3 月 6 日
Thank you very much. Could've sworn I also tried that, apparently not. The alternative solution my professor suggested was to append a few zeros to the data.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeError Detection and Correction についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by