• 大小: 199KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-09
  • 语言: Matlab
  • 标签: Alamouti  QPSK  matlab  

资源简介

用matlab编写的Alamouti方案的空时编码仿真代码。使用QPSK符号,2发1收或2收2发。

资源截图

代码片段和文件信息

%===================================================================
%10/30/04 Sun Jie-ting ECUST
%===================================================================
% Alamouti.m
% ==========
% Description: This m-file simulates the SER performance of Alamouti
%              space-time shceme using maximum likelihood decoding
% Usage:  ser_ml=Alamouti(Nrmax_snrmax_err_symbolsymbol_per_frame)
% Inputs:
%         Nr: the number of receiving antennaeither 1 or 2
%         max_snr: simulation from 0 to max_snr
%         max_err_symbol: the simulation will stop when the number of
%                         received error symbols exceeds max_err_symbol
%         symbol_per_frame: the number of symbols to transmit in a data
%                            frame and we assume the channel fading
%                            coefficients will keep the same the data
%                            frame transmitting period.Becasue of 2 Tx
%                            antenna symbol_per_frame must be even
% Outputs:
%         ser_ml: symbol-error-ratio of each snr
% ======================================================================
function ser_ml=Alamouti(Nrmax_snrmax_err_symbolsymbol_per_frame);
%clc;
%发射天线数,固定为2
if mod(symbol_per_frame2) == 0
    Nt = 2;
    tot_frame_tx=zeros(1max_snr+1);
    tot_err_symbol =zeros(1max_snr+1);
    tot_frame_tx = zeros(1max_snr+1);
    for snr=0:max_snr
        while tot_err_symbol(snr+1)            tot_frame_tx(snr+1) = tot_frame_tx(snr+1)+1;
            %生成伪随机二进制待发送序列
            psudo_bit_sequence = rand(1symbol_per_frame * 2)>0.5;
            %二进制信道与QPSK信号的转换
            qpsk_sequence = QpskMapping(psudo_bit_sequence);
            %噪声能量(已归一化)
%           sig = sqrt(0.5/(10^(snr/10)));
            sig = sqrt(1/(10^(snr/10)));
            %生成加性高斯噪声
            addtional_gaussian_noise   =   sig * (randn(NrNtsymbol_per_frame) + j*randn(NrNtsymbol_per_frame));
            %生成具有瑞利分布特性的信道衰落系数
            H=RayleighCH(NrNt);
            for k=1:2:symbol_per_frame-1
                X=[qpsk_sequence(k) -conj(qpsk_sequence(k+1)); qpsk_sequence(k+1) conj(qpsk_sequence(k))];
                %接收信号
                R=H*X + addtional_gaussian_noise(::k);
                %接收信号的合成(利用发送矩阵的正交性对信道衰落矩阵进行正交化处理),由Alamoui码原理可知,信号合成方式因接收天线数目而异
                switch Nr
                    case 1
                        s0=conj(H(1))*R(1)+H(2)*conj(R(2));
                        s1=conj(H(2))*R(1)-H(1)*conj(R(2));
                    case 2
                        s0=conj(H(11))*R(11)+H(12)*conj(R(12))+conj(H(21))*R(21)+H(22)*conj(R(22));  
                        s1=conj(H(12))*R(11)-H(11)*conj(R(12))+conj(H(22))*R(21)-H(21)*conj(R(22));
                end
                S=[s0 s1];
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
                %          最大似然译码          %
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   

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

     目录          0  2005-06-19 13:19  Alamouti

     文件       1164  2005-06-19 13:43  Alamouti\程序说明.txt

     文件        754  2005-06-19 11:36  Alamouti\RayleighCH.m

     文件       1504  2005-06-19 12:49  Alamouti\QpskMapping.m

     文件       4099  2005-06-19 13:32  Alamouti\Alamouti.m

     文件     225238  2004-09-28 20:03  Alamouti\a simple transmit diversity technique for wireless communications.pdf

     文件       1463  2005-06-19 13:40  Alamouti\SimAlamouti.m

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

               234222                    7


评论

共有 条评论