Convert binary integers to quaternary integers

Is it possible to convert binary integers generated using a randi() to quaternary integers (0-3) by taking two bits from the source and combining them?

 채택된 답변

M
M 2012년 5월 17일

0 개 추천

Solved it myself. It can be done easily by converting back to decimal from Galois Field, reshaping into n x 2 matrix and adding the columns.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 5월 17일

0 개 추천

Yes. B1*2 + B2

댓글 수: 2

M
M 2012년 5월 17일
Thanks. I forgot to mention that I am converting the binary integers to Galois Field with m=1 for BCH coding. Now I want to convert the numbers to quaternary format for QPSK modulation.
If you need to, put the 4 possible results into a vector, and index the vector at B1*2 + B2 + 1

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

질문:

M
M
2012년 5월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by