main1.m ( File view )

  • By 26205131 2015-10-26
  • View(s):6
  • Download(s):11
  • Point(s): 1
			clear all;
clc;
Nt =4;
K = 2;
Nri = 2;
S = 2;
Tc = 200;
sigma2=1;
SNRdbs=-10:3:30;
sum_rate1=zeros(1,length(SNRdbs));
sum_rate2=zeros(1,length(SNRdbs));
sum_rate3=zeros(1,length(SNRdbs));
sum_rate4=zeros(1,length(SNRdbs));
sum_rate5=zeros(1,length(SNRdbs));
sum_rate6=zeros(1,length(SNRdbs));



BER1=zeros(1,length(SNRdbs));
BER2=zeros(1,length(SNRdbs));
BER3=zeros(1,length(SNRdbs));
BER4=zeros(1,length(SNRdbs));
BER5=zeros(1,length(SNRdbs));
BER6=zeros(1,length(SNRdbs));


for i_SNR=1:length(SNRdbs)
        SNR=10^(SNRdbs(1,i_SNR)/10);
        P=sigma2*SNR;
        count1=0;
        count2=0;
        count3=0;
        count4=0;
        count5=0;
        count6=0;
        capacity1=0;
        capacity2=0;
        capacity3=0;
        capacity4=0;
        capacity5=0;
        capacity6=0;
    
  loop_num=400;      
 for i_loop=1:loop_num
            q=randint(K*S,Tc);
            s=QPSK_mapper(q,Tc,S,K);
            H_real=randn(K*Nri,Nt);
            H_imag=randn(K*Nri,Nt);
            H=(1/sqrt(2))*complex(H_real,H_imag);

            n_real=sqrt(sigma2/2)*randn(K*Nri,Tc/2);
            n_imag=sqrt(sigma2/2)*randn(K*Nri,Tc/2);
            n=complex(n_real,n_imag);
 %svd
            [W1,M1]=svdprecoding(H,K,S,P);
            [U,D,V]=svd(H);
            p1 = ones(1,K*S);
            % p1 = waterfilling(D,SNR,Nt,K,S);
           [count_temp] = receiver(H,Nt,S,K,Tc,P,n,W1,M1,s,q);
            count1=count1+count_temp;
            G=M1*H*W1;
            capacity1=capacity1+log2(det(eye(K*S,K*S)+P/(sigma2*Nt)*G*G'));
       

            

           
         

            
  % BD
            [W2,D2 M2] = BD2(Nt,Nri,S,K,H,P);
            p2 = ones(1,K*S);
            [count_temp] = receiver(H,Nt,S,K,Tc,P,n,W2,M2,s,q);
            count2=count2+count_temp;
            capacity2=capacity2+sumrate(H,W2,M2,K,S,Nri,Nt,sigma2,P);
            
            
  %ZF
           [W3]=ZF(H,P,K,S);
           [count_temp] = receiver(H,Nt,S,K,Tc,P,n,W3,eye(K*Nri),s,q);
            count3=count3+count_temp;
            capacity3=capacity3+sumrate(H,W3,eye(K*Nri),K,S,Nri,Nt,sigma2,P);
           
          
            
        
            
%MF
          [W4]=MF(H,P,K,S);
          [count_temp] = receiver(H,Nt,S,K,Tc,P,n,W4,eye(K*Nri),s,q);
            count4=count4+count_temp;
           capacity4=capacity4+sumrate(H,W4,eye(K*Nri),K,S,Nri,Nt,sigma2,P);
           
           
%SLNR
       %[W5]  = SLNR(Nt,Nri,S,K,H,sigma2,P);
        [W5]=SLNR2(H,sigma2,P,K,Nri,S,Nt);
        [count_temp] = receiver(H,Nt,S,K,Tc,P,n,W5,eye(K*Nri),s,q);
            count5=count5+count_temp;
     
       capacity5=capacity5+sumrate(H,W5,eye(K*Nri),K,S,Nri,Nt,sigma2,P);
       
%MMSE
        [W6,M6]=MMSE(H,sigma2,P,K,Nri,S,Nt);
        [count_temp] = receiver(H,Nt,S,K,Tc,P,n,W6,M6,s,q);
            count6=count6+count_temp;
        
       capacity6=capacity6+sumrate(H,W6,M6,K,S,Nri,Nt,sigma2,P);
        
         

   
          
           
           
           
           
 end
    BER1(1,i_SNR)=count1/(loop_num*K*S*Tc);
    BER2(
...
...
(Please download the complete source code to view)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
BD.asv947.00 B12-03-14|15:04
BD.m958.00 B12-03-14|15:10
BD2.asv1.03 kB25-03-14|01:38
BD2.m996.00 B16-04-14|10:31
BD_BER_SNR.fig2.94 kB12-03-14|23:37
BER1.fig10.29 kB23-04-14|20:21
BER2.fig10.27 kB23-04-14|20:34
BER3.fig10.31 kB23-04-14|22:07
CIprecoding.asv54.00 B26-03-14|10:24
hs_err_pid4528.log17.54 kB21-03-14|10:01
main1.asv4.61 kB05-05-14|16:29
main1.m4.61 kB05-05-14|16:29
main2.asv3.62 kB27-04-14|16:33
main2.m4.45 kB27-04-14|20:53
MF.m82.00 B26-03-14|10:41
MFprecoding.asv71.00 B26-03-14|10:37
MMSE.asv758.00 B24-04-14|17:46
MMSE.m758.00 B27-04-14|20:32
QPSK_mapper.m476.00 B12-03-14|23:19
receiver.asv551.00 B23-04-14|16:14
receiver.m578.00 B23-04-14|22:03
SLNR.m528.00 B26-03-14|11:24
SLNR2.asv418.00 B20-04-14|21:59
SLNR2.m470.00 B20-04-14|22:03
SNR=5dB时4个2天线用户MIMO系统合速率随Nt变化.fig12.92 kB27-04-14|21:17
SNR=5dB时4个2天线用户MIMO系统误码率随Nt变化.fig10.79 kB27-04-14|21:17
sum-rate1.fig8.71 kB25-03-14|09:42
sum-rate10.fig10.35 kB23-04-14|14:57
sum-rate2.fig9.69 kB25-03-14|17:09
sum-rate3.fig8.77 kB26-03-14|11:16
sum-rate4.fig8.70 kB08-04-14|15:38
sum-rate5.fig9.98 kB16-04-14|09:55
sum-rate6.fig12.58 kB16-04-14|21:15
sum-rate7.fig11.58 kB20-04-14|09:48
sum-rate8.fig9.72 kB20-04-14|10:41
sum-rate9.fig10.58 kB20-04-14|22:34
sumrate.asv1.54 kB20-04-14|11:19
sumrate.m1.55 kB20-04-14|11:23
svdprecoding.asv88.00 B26-03-14|16:44
svdprecoding.m139.00 B26-03-14|11:11
SVD_BD_BER2.fig7.82 kB21-03-14|01:50
SVD_BD_BER3.fig7.77 kB21-03-14|01:56
SVD_BD_BER_SNR.fig7.82 kB25-03-14|02:56
SVD_BD_rate_SNR.fig7.65 kB21-03-14|01:27
waterfilling.asv322.00 B18-03-14|15:02
waterfilling.m323.00 B18-03-14|15:02
ZF.m94.00 B26-03-14|10:30
本科毕设0.00 B26-10-15|21:11
...
Sponsored links

main1.m (206.75 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D