hi! can you please guide me how to generate 7 bit binary comibations and assign all of them a unique value?
조회 수: 1 (최근 30일)
이전 댓글 표시
%4PAM SIGNAL GENERATOR
M=4;
for m=1:M
a(m)=2*m-1-M;
end
%BINARY INPUT SEQUENCE
x=randi([0 1],1,20);
%BITS TO LEVELS MAPPING
fsk4=[]; %empty variable
for j=1:2:length(x)-1
if x(j)==0 && x(j+1)==0
fsk=a(1);
elseif x(j)==0 && x(j+1)==1
fsk=a(2);
elseif x(j)==1 && x(j+1)==1
fsk=a(3);
else
fsk=a(4);
end
fsk4=[fsk4 fsk];
end
댓글 수: 0
답변 (1개)
Walter Roberson
2017년 9월 13일
M = 2^7;
idx = bin2dec( char(YourBinaryArray + '0') ); %binary combinations assumed across rows
fsk = 2 * idx - M/2 - 1;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 FSK에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!