MAPPING OF MPSK AND QAM FROM BINARY TO GRAY

버전 1.0.0.0 (1.12 KB) 작성자: raghav khandelwal
MAPPING OF MPSK AND QAM FROM BINARY TO GRAY
다운로드 수: 168
업데이트 날짜: 2015/5/14

라이선스 보기

clc;
clear all;
close all;
N = randint(1,1000); % generating symbols

% mode type
m_type=input('Enter the modulation type[ BPSK,2 QPSK,3 8PSK,4 16QAM]: ');

factor=[1;1;1;1];

b=[1;2;3;4]; % number of bits per subcarrier, 1:BPSK,2:QPSK,4:16QAM

input_sequence = N;

k=factor(m_type);

m=b(m_type);
% Selecting constellation as per modulation
switch m
case 1
b=k*[1 -1];
case 2
b=k*[1+1i -1+1i 1-1i -1-1i];

case 3
b=k*[(cos(0)+1i*sin(0)) (cos(pi/4)+1i*sin(pi/4)) (cos(pi/2)+1i*sin(pi/2)) (cos(3*pi/4)+1i*sin(3*pi/4)) (cos(pi)+1i*sin(pi)) (cos(5*pi/4)+1i*sin(5*pi/4)) (cos(6*pi/4)+1i*sin(6*pi/4)) (cos(7*pi/4)+1i*sin(7*pi/4))];
case 4
b=k*[1+1i 1+3i 1-1i 1-3i 3+1i 3+3i 3-1i 3-3i -1+1i -1+3i -1-1i -1-3i -3+1i -3+3i -3-1i -3-3i];


end

c1=1;
c2=1;

for i=1:(ceil(length(input_sequence)/m))
temp=0;
for j=1:m
temp=bitor(temp,bitshift(input_sequence(c1),(j-1)));
c1=c1+1;
if(c1>length(input_sequence))
break;
end
end
map_out(c2)=b(temp+1);
c2=c2+1;
end

% plot
figure;
plot(real(map_out),imag(map_out),'k.');
axis ([-5 5 -5 5]);
title('CONSTELLATION');

인용 양식

raghav khandelwal (2024). MAPPING OF MPSK AND QAM FROM BINARY TO GRAY (https://www.mathworks.com/matlabcentral/fileexchange/50851-mapping-of-mpsk-and-qam-from-binary-to-gray), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0