Random substitution for QAM symbols
이전 댓글 표시
Hi everyone, I want to do a random substitution for QAM symbols based on secret key or random vector.
For example, suppose 4-QAM modulation with the following substitution:
(00) is substituated to (10) ,
(01) is substituated to (00),
(10) is substituated to (11), and
(11) is substituated to (01).
Based on a secret key, the subsituation box is changed.
May you guide me how to do that in matlab with any M-ary QAM?
Thanks in advance.
답변 (2개)
Walter Roberson
2020년 11월 11일
편집: Walter Roberson
2020년 11월 11일
lookup = [1 0; 0 0; 1 1; 0 1]; %must be in numeric order
output = reshape(lookup([2 1] * reshape(VectorOfBits, 2, []) + 1, :).', 1, []);
The [2 1]* is converting from 2 bit binary into decimal. Then +1 to get a 1-based index, that is used to index into the lookup table of replacements. The rest has to do with arranging bits in the right order for processing.
There are other ways, such as
output = reshape(lookup(VectorOfBits(1:2:end)*2 + VectorOfBits(2:2:end) + 1,:).', 1, []);
and some of the work can be made easier if you make the lookup table column-oriented instead of row oriented.
댓글 수: 2
YAHYA AL-MOLIKI
2020년 11월 18일
편집: YAHYA AL-MOLIKI
2020년 11월 18일
Walter Roberson
2020년 11월 18일
I tested the code before I posted. Both versions work according to the requirements that were given.
카테고리
도움말 센터 및 File Exchange에서 QAM에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!