1、BPSK
目录
相位状态表
Data bit | Phase change |
---|---|
0 | 0 |
1 |
BPSK在AWGN信道中能够获得最好的误码率性能,频谱效率:1bps/Hz.
调制代码实现:
function [mod_symbol] = bpskmod(bit_in)
% bit_in = [0,1,0,0,1,1,1]; % only for test
len = length(bit_in);
table = exp(j*[0, pi]);
mod_symbol = table(bit_in+1); %complex number
%% method 2
% mod_symbol = 2*bit_in -1;
解调时直接判断实部数据正负即可。
2、QPSK
Data bits (a(t)-b(t)) | |
---|---|
0-0 | -3/4 |
0-1 | 3/4 |
1-0 | -/4 |
1-1 | /4 |
QPSK频带效率:2bps/Hz。横穿或接近原点的相位轨迹,会增加峰平比(PAR),引起频谱增生,即带外辐射。
调制代码:
function qpskSym = qpskmod(bit_in)
% bit_in = randi([0,1], 1 ,10); % test data
len = length(bit_in);
% mapping (11,01 ,00, 10)
% 1/4*pi , 3/4*pi ,-3/4*pi, -1/4*pi
table= exp(j*[-3/4*pi,3/4*pi , -1/4*pi, 1/4*pi ]); % 0,1,2,3
inMatrix = reshape(bit_in, len/2,2); %Rs = 1/2Rb
% inMatrix = [bit_in(1:2:end)', bit_in(2:2:end)']';% another way
inInt = inMatrix(:,1)*2 + inMatrix(:,2);
qpskSym = table(inInt+1);
解调实现:
% Function to perform QPSK demodulation
function [demodata]=qpskdemod(idata,qdata,para,nd,ml)
%****************** variables *************************
% idata :input Ich data
% qdata :input Qch data
% demodata: demodulated data (para-by-nd matrix)
% para : Number of paralell channels
% nd : Number of data
% ml : Number of modulation levels
% (QPSK ->2 16QAM -> 4)
% *****************************************************
demodata=zeros(para,ml*nd);
demodata((1:para),(1:ml:ml*nd-1))=idata((1:para),(1:nd))>=0;
demodata((1:para),(2:ml:ml*nd))=qdata((1:para),(1:nd))>=0;
%EOF
3、MPSK
MPSK调制阶数越高,ber性能越差,但频带利用率提高
实现方式采用: pskmod函数
4、QAM
QAM调制方式的发送信号相位、幅度都会变化。在AWGN信道中,16QAM的ber性能优于16PSK,大约好4个dB。
调制实现:
function qammod=qammod(qam_work,bits_in )
if qam_work == 1
full_len = length(bits_in);
m=1;
for k=-3:2:3
for l=-3:2:3
table(m) = (k+j*l)/sqrt(10); % power normalization
m=m+1;
end
end
table=table([0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10]+1); % Gray code mapping pattern for 8-PSK symbols
inp=reshape(bits_in,4,full_len/4);
qammod=table([8 4 2 1]*inp+1); % maps transmitted bits into 16QAM symbols
end
解调实现:
% qamdemod.m
% Function to decode 16QAM modulation
function [demodata]=qamdemod(idata,qdata,para,nd,ml)
%****************** variables *************************
% idata :input Ich data
% qdata :input Qch data
% demodata: demodulated data (para-by-nd matrix)
% para : Number of paralell channels
% nd : Number of data
% ml : Number of modulation levels
% (QPSK ->2 16QAM -> 4)
% *****************************************************
k=sqrt(10);
idata=idata.*k;
qdata=qdata.*k;
demodata=zeros(para,ml*nd);
m2=ml/2;
count2=0;
for ii = 1:nd
a=1;
b=1;
i_lngth=0;
q_lngth=0;
for jj= 1:m2
if jj ~= 1
if demodata((1:para),jj-1+count2)==1
a=-a;
end
if demodata((1:para),m2+jj-1+count2)==1
b=-b;
end
i_lngth=i_lngth+i_plrty.*2.^(m2-jj+1);
q_lngth=q_lngth+q_plrty.*2.^(m2-jj+1);
end
if idata((1:para),ii) >= i_lngth
demodata((1:para),jj+count2)=a>=0;
i_plrty=1;
else
demodata((1:para),jj+count2)=a<=0;
i_plrty=-1;
end
if qdata((1:para),ii) >= q_lngth
demodata((1:para),m2+jj+count2)=b>=0;
q_plrty=1;
else
demodata((1:para),m2+jj+count2)=b<=0;
q_plrty=-1;
end
end % for jj= 1:m2
count2=count2+ml;
end % for ii = 1:nd