资源简介

用MATLAB编写的 16QAM的 调制解调,压缩包包含16QAM的调制子函数,16QAM的解调子函数,及main函数

资源截图

代码片段和文件信息

clc 
clear all
close all

a=rand(1400)>0.5;


Modulated_Data=shiliuQam_modulation(a);
x=Modulated_Data;
I_real=real(x);  %将信号分成I Q两路
Q_imag=imag(x);


%%%%%%%%%%%%%%%%%I路%%%%%%%%%%%%%%
I_0=find(I_real>2);
I_real(I_0)=ones(size(I_0))*2;    %%转换成四电平的形式

I_1=find(I_real>0&I_real<2);
I_real(I_1)=ones(size(I_1))*3;

I_2=find(I_real>-2&I_real<0);
I_real(I_2)=ones(size(I_2))*1;
 
I_3=find(I_real<-2);
I_real(I_3)=zeros(size(I_3));

%%%%%%%%%%%%%  将四电平转换成二电平%%%%%%%%

Si=[0 0;0 1;1 0;1 1]‘;
N_I=length(I_real);
Bit_I=zeros(2length(I_real));
for i=1:N_I
switch I_real(i)
    case 0
        Bit_I(1:2i)=Si(1:21);
    case 1
        Bit_I(1:2i)=Si(1:22);
    case 2
        Bit_I(1:2i)=Si(1:23);
    case 3
        Bit_I(1:2i)=Si(1:24);
end
end
%%%%%%%%%  end  %%%%%%%%


%%%%%%% Q路  %%%%%%%%%%%%%%%%
Q_0=find(Q_imag>2);
Q_imag(Q_0)=ones(size(Q_0))*2;

Q_1=find(Q_imag>0&Q_imag<2);
Q_imag(Q_1)=ones(size(Q_1))*3;

Q_2=find(Q_imag>-2&Q_imag<0);
Q_imag(Q_2)=ones(size(Q_2))*1;
 
Q_3=find(Q_imag<-2);
Q_imag(Q_3)=zeros(size(Q_3));

%%%%%%%%%%%%%  将四电平转换成二电平%%%%%%%%

Si=[0 0;0 1;1 0;1 1]‘;
N_Q=length(Q_imag);
Bit_Q=zeros(2length(Q_imag));
for i=1:N_Q
switch Q_imag(i)
    case 0
        Bit_Q(1:2i)=Si(1:21);
    case 1
        Bit_Q(1:2i)=Si(1:22);
    case 2
        Bit_Q(1:2i)=Si(1:23);
    case 3
        Bit_Q(1:2i)=Si(1:24);
end
end
%%%%%%%%%%%%  end  %%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%将 I Q  两路信号比特合成一路信号%%%%%%%%%%%%%%%%%%%
Demodulated_Data=[Bit_I ; Bit_Q];

Demodulated_Data=reshape(Demodulated_Data1length(x)*4);

m=sum(Demodulated_Data~=a);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1704  2011-11-09 14:32  16Qam调制解调\main.m

     文件       1615  2012-02-22 14:52  16Qam调制解调\Qam16_demodulation.m

     文件        739  2012-02-22 14:54  16Qam调制解调\Qam16_modulation.m

     目录          0  2012-02-22 14:52  16Qam调制解调

----------- ---------  ---------- -----  ----

                 4058                    4


评论

共有 条评论