16QAM.zip

  • PUDN用户
    了解作者
  • matlab
    开发工具
  • 1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 5
    下载次数
  • 2020-03-24 16:31
    上传日期
产生任意位随机信号,再采用16QAM调制和解调
16QAM.zip
  • M16QAM_modulate.m
    1.9KB
  • M16QAM_demodulate.m
    4.4KB
内容介绍
function [demodata]=M16QAM_demodulate(receiver) N=length(receiver); A=[0 1 0 1;-1 0 0 1;-1 0 -1 0;0 1 -1 0; 1 inf 0 1;0 1 1 inf;-1 0 1 inf;inf -1 0 1; -inf -1 -1 0 ;-1 0 -inf -1;0 1 -inf -1;1 inf -1 0; 1 inf 1 inf;-inf -1 1 inf;-inf -1 -inf -1;1 inf -inf -1]; for k=1:N if(real(receiver(k))>=A(1,1))&&(real(receiver(k))<a(1,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(1,3))&&(imag(receiver(k))<a(1,4)) demodata(k*4-3)=0; demodata(k*4-2)=0; demodata(k*4-1)=0; demodata(k*4)=0; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(2,1))&&(real(receiver(k))<a(2,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(2,3))&&(imag(receiver(k))<a(2,4)) demodata(k*4-3)=1; demodata(k*4-2)=0; demodata(k*4-1)=0; demodata(k*4)=0; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(3,1))&&(real(receiver(k))<a(3,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(3,3))&&(imag(receiver(k))<a(3,4)) demodata(k*4-3)=1; demodata(k*4-2)=0; demodata(k*4-1)=1; demodata(k*4)=0; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(4,1))&&(real(receiver(k))<a(4,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(4,3))&&(imag(receiver(k))<a(4,4)) demodata(k*4-3)=0; demodata(k*4-2)=0; demodata(k*4-1)=1; demodata(k*4)=0; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(5,1))&&(real(receiver(k))<a(5,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(5,3))&&(imag(receiver(k))<a(5,4)) demodata(k*4-3)=0; demodata(k*4-2)=1; demodata(k*4-1)=0; demodata(k*4)=0; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(6,1))&&(real(receiver(k))<a(6,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(6,3))&&(imag(receiver(k))<a(6,4)) demodata(k*4-3)=0; demodata(k*4-2)=0; demodata(k*4-1)=0; demodata(k*4)=1; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(7,1))&&(real(receiver(k))<a(7,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(7,3))&&(imag(receiver(k))<a(7,4)) demodata(k*4-3)=1; demodata(k*4-2)=0; demodata(k*4-1)=0; demodata(k*4)=1; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(8,1))&&(real(receiver(k))<a(8,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(8,3))&&(imag(receiver(k))<a(8,4)) demodata(k*4-3)=1; demodata(k*4-2)=1; demodata(k*4-1)=0; demodata(k*4)=0; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(9,1))&&(real(receiver(k))<a(9,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(9,3))&&(imag(receiver(k))<a(9,4)) demodata(k*4-3)=1; demodata(k*4-2)=1; demodata(k*4-1)=1; demodata(k*4)=0; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(10,1))&&(real(receiver(k))<a(10,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(10,3))&&(imag(receiver(k))<a(10,4)) demodata(k*4-3)=1; demodata(k*4-2)=0; demodata(k*4-1)=1; demodata(k*4)=1; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(11,1))&&(real(receiver(k))<a(11,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(11,3))&&(imag(receiver(k))<a(11,4)) demodata(k*4-3)=0; demodata(k*4-2)=0; demodata(k*4-1)=1; demodata(k*4)=1; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(12,1))&&(real(receiver(k))<a(12,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(12,3))&&(imag(receiver(k))<a(12,4)) demodata(k*4-3)=0; demodata(k*4-2)=1; demodata(k*4-1)=1; demodata(k*4)=0; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(13,1))&&(real(receiver(k))<a(13,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(13,3))&&(imag(receiver(k))<a(13,4)) demodata(k*4-3)=0; demodata(k*4-2)=1; demodata(k*4-1)=0; demodata(k*4)=1; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(14,1))&&(real(receiver(k))<a(14,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(14,3))&&(imag(receiver(k))<a(14,4)) demodata(k*4-3)=1; demodata(k*4-2)=1; demodata(k*4-1)=0; demodata(k*4)=1; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(15,1))&&(real(receiver(k))<a(15,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(15,3))&&(imag(receiver(k))<a(15,4)) demodata(k*4-3)=1; demodata(k*4-2)=1; demodata(k*4-1)=1; demodata(k*4)=1; elseif(real(receiver(k)) rel='nofollow' onclick='return false;'>=A(16,1))&&(real(receiver(k))<a(16,2))&&... (imag(receiver(k)) rel='nofollow' onclick='return false;'>=A(16,3))&&(imag(receiver(k))<A(16,4)) demodata(k*4-3)=0; demodata(k*4-2)=1; demodata(k*4-1)=1; demodata(k*4)=1; end end end
评论
    相关推荐