• 大小: 5KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-18
  • 语言: Matlab
  • 标签: mimo  sm  ml  

资源简介

空间调制技术的学习,matlab程序编程,最大似然检测技术

资源截图

代码片段和文件信息

clc;
clear;
tic

frame_Length=160;  %The length of each frame
frame_number=40;    %The number of frames
Meantimes=20;      %The times of mean
Testnum=15;        %The times of test  
error1=zeros(MeantimesTestnum); 
error2=zeros(MeantimesTestnum);

H=[0.5 0.25;
    0.125 0.5;
    0.25 0.125];
[NB]=size(H);
h1=H(1:);
h2=H(2:);
h3=H(3:);
for times=1:Meantimes
    snr_in_db=0;
    for testcount=1:Testnum
        snr_in_db=2*(testcount-1); 
        SNR=10^(snr_in_db/10);
        for frame_count=1:frame_number
         %*************************************************************************************%
         % 产生高斯噪声                                                                         %
         %*************************************************************************************%     
           L=frame_Length;
           noise1=randn(1 L/2)/(sqrt(2*SNR)); 
           noise2=randn(1 L/2)/(sqrt(2*SNR));
           noise3=randn(1 L/2)/(sqrt(2*SNR)); 
        %*************************************************************************************%
        % 编码算法                                                              %
        %*************************************************************************************%
           input_bits=randint(1L); 
            
           % BPSK调制
           BPSK = [-1 1];    % refer to Table82 on page21 of IEEE802.11a
           input_bits1 = BPSK(input_bits+1);
            
           send=reshape(input_bits1BL/B);

         %接收信号   
            R1=h1*send+noise1;
            R2=h2*send+noise2;
            R3=h3*send+noise3;
            
%             R1=h1*send;
%             R2=h2*send;
       %*************************************************************************************%
       % 接收端解码算法                                                              %
       %*************************************************************************************%         
            % ML译码
            output_bits1=decode_ML23_BPSK(HL/BR1R2R3); 
            
            % ZF译码
            output_bits2=decode_ZF23_BPSK(HL/BR1R2R3);     
           
       %*************************************************************************************%
       % 误码率统计                                                                          %
       %*************************************************************************************%    
            errornumber1=output_bits1-input_bits;
            for q=1:frame_Length
                if errornumber1(1q)~=0
                    error1(timestestcount)=error1(timestestcount)+1;
                end
            end
            
            errornumber2=output_bits2-input_bits;
            for q=1:frame_Length
                if errornumber2(1q)~=0
                    error2(timestestcount)=error2(timestestcount)+1;
                end
            end
            
        end
   

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

     文件       3380  2008-12-16 20:44  23-ML-ZF\BER_23_ML_ZF_BPSK.asv

     文件       3383  2008-12-16 20:45  23-ML-ZF\BER_23_ML_ZF_BPSK.m

     文件       2980  2008-12-16 20:26  23-ML-ZF\BER_ML23_BPSK.m

     文件       2993  2008-12-16 20:39  23-ML-ZF\BER_ZF23_BPSK.m

     文件        552  2008-12-16 20:26  23-ML-ZF\decode_ML23_BPSK.m

     文件        526  2008-12-16 20:38  23-ML-ZF\decode_ZF23_BPSK.m

     文件        513  2008-12-16 20:17  23-ML-ZF\ML23_BPSK.m

     文件        616  2008-12-16 20:33  23-ML-ZF\ZF23_BPSK.m

     目录          0  2008-12-16 20:44  23-ML-ZF

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

                14943                    9


评论

共有 条评论