MIMO系统中ZF破零均衡仿真

%--------------------------------------------------------------------------
%Author: Le Phu Thanh                             lephuthanh@gmail.com
%--------------------------------------------------------------------------
%References:
%-- Jing Liu,Jian-Kang Zhang,and Kon Max Wong,On the Design of Minimum BER
%Linear Space-Time Block Codes for MIMO Systems Equipped With MMSE
%Receivers" IEEE TRANS. Sinal Processing, VOL.54, NO.8,AUGUST 2006

%--------------------------------------------------------------------------
%NOTE:

%--------------------------------------------------------------------------
clear all;
tic
mTx=2;                                         %Number of transmit antennas
nRx=2;                                         %Number of receive antennas
T=1;                                           %Number of time slots
N=500;                                         %Number of trials at a given noise level
L=mTx*T;
nsymb=L*N;                                     %Number of symbol stream
No_uncode = T*N;

%4QAM Modulation
Mary=4;
partition = [0];
xcodebook = [-1,1];
%Mary=16;
%partition=[ -2,0,2 ];
%xcodebook=[-3,-1,1,3 ];
ycodebook = xcodebook;
%Finish 4QAM modulation
Es = 2*sum(xcodebook * xcodebook')/size(xcodebook,2); % average symbol energy per antenna
snr=0:2:20;
for bi=1:length(snr)
  errZF=0;
  errZF_DFE=0;
  ro=10^(snr(bi)/10);
  for n=1:No_uncode
       S_out=[];                                 % Symbol stream output_estimate
       S_in = randsrc(mTx,1,xcodebook)+ i*(randsrc(mTx,1,ycodebook)); % Symbol stream input
       S_in1=S_in/sqrt(Es);
       noise=(randn(nRx,1)+i*randn(nRx,1))/sqrt(2);%Get noise
       %noise=(randn(nRx,1)+i*randn(nRx,1))*sqrt(Es/2); 
       uncode_H=(randn(nRx,mTx)+i*randn(nRx,mTx))/sqrt(2);%Get Rayleigh channel
             
       y=sqrt(ro/mTx)*uncode_H*S_in1 + noise; % At receiver
     
%Demodulate via ZF Equalizer
       G_ZF = sqrt(mTx/ro)*pinv(uncode_H);
       S_out=sqrt(Es)*G_ZF*y; % Symbol out of equalizer
      % Decoder
         for ii=1:mTx % detector 
            [o,a(ii)]=quantiz(real(S_out(ii)),partition,xcodebook);
            [o,b(ii)]=quantiz(imag(S_out(ii)),partition,ycodebook);
         end
        S_out_dec = a + i*b;
        err_real= sum (real(S_out_dec)~=real(S_in.'));
        err_imag= sum (imag(S_out_dec)~=imag(S_in.'));
        errZF=errZF+err_real+err_imag;
%End ZF only

%ZF-DFE or V-Blast ----------------------------------------------------------------
        H=uncode_H;
        r=sqrt(Es)*y;
        G=sqrt(mTx/ro)*pinv(H);
        for j=1:mTx %i loop
            for J=1:mTx
                n(J)=(norm(G(J,:)))^2;
            end
            for t=1:j-1
                n(k(t))= Inf;
            end
            [ Y,I]=min(n);
            k(j)=I;
            w=G(I,:);
            yy=w*r;
            [ o,n1]=quantiz(real(yy),partition,xcodebook);
            [ o,n2]=quantiz(imag(yy),partition,ycodebook);
            b(I)=n1+i*n2;
            r=r-sqrt(ro/mTx)*H(:,I)*b(I);
            H(:,I)=0;
          G=sqrt(mTx/ro)*pinv(H);

..............................

B-0063

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

fpga和matlab

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值