您现在的位置:首页 >> 技术文章 >> MATLAB技术 >> 内容

MATLAB代做|FPGA代做-Effect of CFO on OFDM system

时间:2021-2-11 11:32:00 点击:

  核心提示:MATLAB代做|FPGA代做-Effect of CFO on OFDM system...
% Effect of Carrier Frequency Offset on OFDM system simulation under AWGN
% Prepared by Hiren gami

clc 
clear all

nDSC = 256;     % Number of data sub-carriers
nCP = 16;       % Number of sub-carriers in cyclic prefix
nFFT = 256; 
nTot = nFFT+nCP;
EbN0dB = 0:2:10;
EsN0dB = EbN0dB + 10*log10(nDSC/nFFT) + 10*log10(nFFT/nTot); 
CFO = 0:0.05:0.2;           
BER = zeros(1,length(EbN0dB));
MC =5000;

for ii = 1:length(CFO)
    
    for n = 1:length(EbN0dB)
        snr = EbN0dB(n);
        berrors = 0;tic;
        for mc = 1:MC
            x = rand(1,nDSC)>0.5;
            xt = 2*x -1; 
            xt = (nFFT/sqrt(nDSC))*ifft(fftshift(xt),nFFT); 
            xtt = [xt(end-nCP+1:end) xt];
            % Gaussian noise of unit variance, 0 mean
            nt = 1/sqrt(2)*(randn(1,nTot) + 1i*randn(1,nTot));
            yr = sqrt(nTot/nFFT)*xtt + 10^(-EsN0dB(n)/20)*nt;
            % applying CFO
            yr =(exp(1i*2*pi*CFO(ii)*(0:length(yr)-1)/nFFT)).*yr;
            % Receiver processing
            yr = yr(nCP+1:end);
            yr = (nDSC/sqrt(nFFT))*fftshift(fft(yr,nFFT));
            yr = yr > 0; % hard demodulation
            berrors = berrors + length(find((yr-x)~=0));
        end
        toc;
       BER(ii,n) = berrors/(nFFT*MC);
    end
    
end

semilogy(EbN0dB,BER,'-.*','LineWidth',2); hold on; grid on; 
title('BER sensitivity Vs CFO under AWGN');
% theoratical calculations
dataenc = 'nondiff';
EbNo = EbN0dB;
M = 2;
ThBer = berawgn(EbNo,'psk',M,dataenc);
semilogy(EbNo, ThBer,'-*r','LineWidth',2); xlabel('Eb/N0');ylabel('BER');


联系:highspeedlogic

QQ :1224848052

微信:HuangL1121

邮箱:1224848052@qq.com

网站:http://www.mat7lab.com/

网站:http://www.hslogic.com/

微信扫一扫:

作者:CFO on OFDM system 来源:CFO on OFDM system
本站最新成功开发工程项目案例
相关文章
  • 没有相关文章
相关评论
发表我的评论
  • 大名:
  • 内容:
  • matlab代做|matlab专业代做|matlab淘宝代做|python人工智能代做|FPGA项目合作|C代做|C++代做(www.hslogic.com) © 2021 版权所有 All Rights Reserved.
  • Email:highspeed_logic@163.com 站长QQ: 1224848052

    专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科毕业设计、课题设计、论文,毕业论文,Coursework、Eassy、Assignment