實現信道估計算法的matlab仿真_第1頁
實現信道估計算法的matlab仿真_第2頁
實現信道估計算法的matlab仿真_第3頁
實現信道估計算法的matlab仿真_第4頁
實現信道估計算法的matlab仿真_第5頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、實現信道估計算法的matlab仿真clear all;%close all;i=sqrt(-1);Rayleigh=1;AWGN=0;                             % for AWGN channel MMSE=0;                  

2、           % estimation techniqueNsc=64;                             % Number of subcarriersNg=16;              

3、60;               % Cyclic prefix lengthSNR_dB=0 5 10 15 20 25 30 35 40;  % Signal to noise ratioMt=2;                               % Numbe

4、r of Tx antennasMr=2;                               % Number of Rx antennaspilots=1:Nsc/Ng:Nsc;              % pilot subcarriers DS=5;   

5、60;                          % Delay spread of channeliteration_max=200;% Channel impulse response %if (Rayleigh)    N=50;    fm=100;    B=20e3;    fd=(rand(1,N)-0.5)*2*fm;

6、60;   theta=randn(1,N)*2*pi;    c=randn(1,N);    c=c/sum(c.2);    t=0:fm/B:10000*fm/B;    Tc=zeros(size(t);        Ts=zeros(size(t);    for k=1:N       Tc=c(k)*cos(2*pi*fd(k)*t+theta(k)+Tc;   

7、60;   Ts=c(k)*sin(2*pi*fd(k)*t+theta(k)+Ts;    end    r=ones(Mt*Mr,1)*(Tc.2+Ts.2).0.5;    index=floor(rand(Mt*Mr,DS)*5000+1);endMEE1=zeros(1,length(SNR_dB);MEE2=zeros(1,length(SNR_dB);for snrl=1:length(SNR_dB)    snrl    estimation_error1=zeros(

8、Mt*Mr,Nsc);    estimation_error2=zeros(Mt*Mr,Nsc);    R1=besselj(0,2*pi*fm*(Nsc+Ng)/B);    sigma2=10(-SNR_dB(snrl)/10);    aa=(1-R12)/(1-R12+sigma2);    bb=sigma2*R1/(1-R12+sigma2);    for iteration=1:iteration_max      

9、  %iteration            if AWGN=1            h=ones(Mt*Mr,1);        else            phi=rand*2*pi;         &#

10、160;  h=r(index+iteration)*exp(j*phi);            %h=rand(Mt*Mr,DS);            h=h.*(ones(Mt*Mr,1)*(exp(-0.5).1:)S);            h=h./(sqrt(sum(abs(h).2,2)*ones(1,DS);  &

11、#160;     end        CL=size(h,2);                                               % channel

12、 length        data_time=zeros(Mt,Nsc+Ng);        data_qam=zeros(Mt,Nsc);        data_out=zeros(Mr,Nsc);        output=zeros(Mr,Nsc);        for tx=1:

13、Mt            data_b=0*round(rand(4,Nsc);                                  % data            data_qam(tx,:) =j

14、*(2*(mod(data_b(1, :)+data_b(2, :),2)+2*data_b(1, :)-3)+.            2*(mod(data_b(3, :)+data_b(4,:),2)+2*data_b(3,:)-3;            for loop=1:Mt                 data_qam

15、(tx,pilots+loop-1)=(1+j)*(loop=tx);              % pilots            end            data_time_temp=ifft(data_qam(tx,:);            

16、;data_time(tx,:)=data_time_temp(end-Ng+1:end) data_time_temp;        end            for rx=1:Mr            for tx=1:Mt                output

17、_temp=conv(data_time(tx,:),h(rx-1)*Mt+tx,:);                output(rx,:)=output_temp(Ng+1:Ng+Nsc)+output(rx,:);            end            np=(sum(abs(output(rx,:).2)/leng

18、th(output(rx,:)*sigma2;            noise=(randn(size(output(rx,:)+i*randn(size(output(rx,:)*sqrt(np);            output(rx,:)=output(rx,:)+noise;            data_out(rx,:)=fft(outp

19、ut(rx,:);        end% Channel estimation %            H_act=zeros(Mt*Mr,Nsc);        H_est1=zeros(Mt*Mr,Nsc);        H_est2=zeros(Mt*Mr,Nsc);      

20、60; i=1;        for tx=1:Mt            for rx=1:Mr                H_est_temp=data_out(rx,pilots+tx-1)./data_qam(tx,pilots+tx-1);           &

21、#160;    %H_est_temp2=aa*abs(H_est_temp1)+bb*abs(H_est2(rx-1)*Mt+tx,:);                h_time=ifft(H_est_temp);                h_time=h_time zeros(1,Nsc-length(h_time);     &#

22、160;          H_est1(rx-1)*Mt+tx,:)=fft(h_time);                H_est2(rx-1)*Mt+tx,:)=(aa*abs(H_est1(rx-1)*Mt+tx,:)+bb*abs(H_est2(rx-1)*Mt+tx,:).                 

23、60;  .*H_est1(rx-1)*Mt+tx,:)./abs(H_est1(rx-1)*Mt+tx,:);                if (tx>1)                    H_est1(rx-1)*Mt+tx,:)=H_est1(rx-1)*Mt+tx,Nsc-tx+2:Nsc) H_est1(rx-1

24、)*Mt+tx,1:Nsc-tx+1);                    H_est2(rx-1)*Mt+tx,:)=H_est2(rx-1)*Mt+tx,Nsc-tx+2:Nsc) H_est2(rx-1)*Mt+tx,1:Nsc-tx+1);                    end     &

25、#160;          H_act(rx-1)*Mt+tx,:)=fft(h(rx-1)*Mt+tx,:) zeros(1,Nsc-CL);                error1=(abs(H_act(rx-1)*Mt+tx,:)-H_est1(rx-1)*Mt+tx,:).2);                error2=

26、(abs(H_act(rx-1)*Mt+tx,:)-H_est2(rx-1)*Mt+tx,:).2);                %error=(abs(H_act(rx-1)*Mt+tx,:)-H_est(rx-1)*Mt+tx,:).2)./(abs(H_act(rx-1)*Mt+tx,:).2);                estimation_error1(rx-1)*Mt+tx,

27、:)=estimation_error1(rx-1)*Mt+tx,:)+error1;                                 estimation_error2(rx-1)*Mt+tx,:)=estimation_error2(rx-1)*Mt+tx,:)+error2;          &

28、#160;      %subplot(Mt*Mr,3,i),plot(0:Nsc-1,abs(H_act(rx-1)*Mt+tx,:); i=i+1;                %subplot(Mt*Mr,3,i),plot(0:Nsc-1,abs(H_est(rx-1)*Mt+tx,:); i=i+1;                %subplot(Mt*

29、Mr,3,i),plot(0:Nsc-1,abs(error); i=i+1;            end        end      end    estimation_error1=estimation_error1/iteration_max;    estimation_error2=estimation_error2/iteration_max;    %estimation_error=min(estimation_error,10*iteration_

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論