mat7labs的个人空间 https://blog.eetop.cn/1631436 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

基于QPSK调制解调的误码率分析

已有 2874 次阅读| 2020-3-6 17:31 |系统分类:其他

%% QPSK simulation over Rayleigh Fading wireless channel 
%% and its comparison with QPSK transmission over Wireline channel
close all;clear all;clc;
SNRdB=1:1:12;               %SNR in dB
SNR=10.^(SNRdB/10);         %SNR in linear Scale
bl=10^6;                    %No. of bits transmitted
ber=zeros(1,length(SNRdB)); %Simulated BER
x1=(2*floor(2*rand(1,bl)))-1; 
x2=(2*floor(2*rand(1,bl)))-1;
x=x1+1i*x2;                 %Transmitted Symbols
%% QPSK Transmission over AWGN Wireline channel
parfor k=1:length(SNR);
    y=(sqrt(SNR(k))*x1)+randn(1,bl)+1i*((sqrt(SNR(k))*x2)+randn(1,bl));
    ber(k)=length(find((real(y).*x1)<0))+length(find((imag(y).*x2)<0));
end
ber=ber/bl;
semilogy(SNRdB,ber,'k-<', 'linewidth' ,2.0);        %Simulated BER 
hold on
p=qfunc(sqrt(SNR));
semilogy(SNRdB,2*p-p.^2,'m-','linewidth',2.0);      %Theoritical BER

%% QPSK over Rayleigh Fading Wireless Channel
parfor k=1:length(SNR)
    y=raylrnd(1/sqrt(2),1,bl).*(sqrt(SNR(k))*x1)+randn(1,bl)+1i*(raylrnd(1/sqrt(2),1,bl).*(sqrt(SNR(k))*x2)+randn(1,bl));
    ber(k)=length(find((real(y).*x1)<0))+length(find((imag(y).*x2)<0));
end
ber=ber/bl;
semilogy(SNRdB,ber,'k-<', 'linewidth' ,2.0);       %Simulated BER 
hold on
p=0.5*(1-(sqrt(SNR./(2+SNR))));
semilogy(SNRdB,2*p-p.^2,'r-','linewidth',2.0);     %Theoritical BER
title('QPSK over Wireline & Rayleigh Fading Wireless channel');xlabel('SNR(dB)');ylabel('BER');
axis tight
grid 


点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 2

    粉丝
  • 0

    好友
  • 3

    获赞
  • 2

    评论
  • 访问数
关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-20 09:24 , Processed in 0.017073 second(s), 11 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部