首页 > 其他分享 >(22)以RS码为例说明信道编码AWGN信道的Eb/N0设置

(22)以RS码为例说明信道编码AWGN信道的Eb/N0设置

时间:2024-10-08 23:21:32浏览次数:3  
标签:仿真 编码 码为例 22 UncodedEbNo Eb 信道编码 N0 channel

文章目录


前言

本文说明了如何为采用信道编码的通信链路设置Eb/N0(比特能量与噪声功率谱密度比)。


一、编码Eb/N0与未编码Eb/N0及编码码率

在通信系统仿真中,如果采用了FEC编码,则在设置AWGN信道Eb/N0时,需要考虑FEC编码码率R=K/N的影响。其中K为码字中信息码元的个数;N为码字的编码码元个数,也即信息码元数加校验码元数。

当通信链路中采用了信道编码, 编码的Eb/N0设置方法为:

CodedEbNo = UncodedEbNo + 10*log10(codeRate)

下面给出MATLAB仿真代码。

二、仿真代码

下面的MATLAB代码建立了一个“(15,9)RS码+8PSK”编码调制通信系统,显示了如何为采用信道编码的通信链路设置Eb/N0。

仿真中,通过设置不同的Eb/N0,绘制了系统的性能曲线。

N = 15;          % R-S codeword length in symbols
K = 9;           % R-S message length in symbols
num = 1e3;       % R-S codeword number in symbols
M = 8;           % Modulation order

% Construct a (15,9) Reed-Solomon encoder and a 8-PSK modulator.
rsEncoder = comm.RSEncoder('CodewordLength',N,'MessageLength',K,'BitInput',true);
pskModulator = comm.PSKModulator('ModulationOrder',M,'BitInput',true);

% Create the corresponding Reed-Solomon decoder and 8-PSK demodulator objects.
rsDecoder = comm.RSDecoder('CodewordLength',N,'MessageLength',K,'BitInput',true);
pskDemodulator = comm.PSKDemodulator('ModulationOrder',M,'BitOutput',true);

% Calculate the Reed-Solomon code rate based on the ratio of message symbols to the codeword length.
codeRate = K/N;
bitsPerSymbol = log2(M);

% Specify the uncoded Eb/No in dB. Convert the uncoded Eb/No to the corresponding coded Eb/No using the code rate.
UncodedEbNo = 0:2:16;
CodedEbNo = UncodedEbNo + 10*log10(codeRate);

% Construct an AWGN channel taking into account the number of bits per symbol. Set the EbNo property of channel to the coded Eb/No.
channel = comm.AWGNChannel('BitsPerSymbol',bitsPerSymbol);
% channel.EbNo = CodedEbNo;

% Set the total number of errors and bits for the simulation.
% For accuracy, the simulation should run until a sufficient number of bit errors are encountered.
% The number of total bits is used to ensure that the simulation does not run too long.
totalErrors = 100;
totalBits = 1e6;

% Construct an error rate calculator System object and initialize the error rate vector.
errorRate = comm.ErrorRate;
ber = zeros(length(UncodedEbNo),1);

for R = 1:length(UncodedEbNo)
    reset(errorRate);
    errorVec = zeros(3,1);

    channel.EbNo = CodedEbNo(R);

    % Run the simulation to determine the BER. 
    while errorVec(2) < totalErrors && errorVec(3) < totalBits
        % Generate random bits
        dataIn = randi([0,1],num*K,1);
        % Use the RS (15,9) encoder to add error correction capability
        dataEnc = rsEncoder(dataIn);
        % Apply 8-PSK modulation
        txSig = pskModulator(dataIn);
        % Pass the modulated data through the AWGN channel
        rxSig = channel(txSig);
        % Demodulate the received signal
        demodData = pskDemodulator(rxSig);
        % Decode the demodulated data with the RS (15,9) decoder
        dataOut = rsDecoder(demodData);
        % Collect error statistics
        errorVec = errorRate(dataIn,demodData);
    end

    % Display the resultant bit error rate.
    ber(R) = errorVec(1);
end

figure()
semilogy(UncodedEbNo,ber,'ro-','LineWidth',1.5);
grid on;
xlabel('UncodedEbNo(dB)');
ylabel('BER');
title('8-PSK over AWGN Channels with RS Coding');

三、仿真结果

仿真结果如下:

在这里插入图片描述


标签:仿真,编码,码为例,22,UncodedEbNo,Eb,信道编码,N0,channel
From: https://blog.csdn.net/weixin_45333185/article/details/142771220

相关文章

  • 常见的公共 DNS 服务器地址有:谷歌 DNS:8.8.8.8 和 8.8.4.4阿里云 DNS:223.5.5.5 和 223.
    常见的公共DNS服务器地址有:谷歌DNS:8.8.8.8和8.8.4.4阿里云DNS:223.5.5.5和223.6.6.6腾讯DNS:119.29.29.29和182.254.116.116阿里公共DNS:IPv4:223.5.5.5、223.6.6.6IPv6:2400:3200::1、2400:3200:baba::1腾讯公共DNS(DNSPod):IPv4:119.29.29.29IPv6:2402:4e00::百......
  • 2018_10_22_02
    git~F.A.Q在git的一般使用中,如果发现错误的将不想提交的文件add进入index之后,想回退取消,则可以使用命令:gitresetHEAD<file>...,同时gitadd完毕之后,git也会做相应的提示,比如:引用#Changestobecommitted:#(use"gitresetHEAD<file>..."tounstage)##newfile:Test......
  • 2022 CCPC 绵阳AE
    2022CCPC绵阳A.BanorPick,What’stheTrick?题面描述:红蓝双方有一个大小为nnn的英雄池,每次操作一方可以选择一个英雄或者......
  • 20222325 2024-2025-1 《网络与系统攻防技术》实验一实验报告
    1.实验内容缓冲区溢出基本知识:堆栈、函数调用。shellcode技术以及其在各平台的运用与防御。BOF攻击防御技术。2.实验目标本次实践的对象是一个名为pwn1的linux可执行文件。该程序正常执行流程是:main调用foo函数,foo函数会简单回显任何用户输入的字符串。该程序同时包含另......
  • 20222310 2024-2025-1 《网络与系统攻防技术》实验一实验报告
    一、实验内容1.实验目标本次实验的对象是一个名为pwn1的linux可执行文件。该程序正常执行流程是:main调用foo函数,foo函数会简单回显任何用户输入的字符串。该程序同时包含另一个代码片段,getShell,会返回一个可用Shell。正常情况下这个代码是不会被运行的。我们实验的目标就是想......
  • leetcode 刷题day37动态规划Part06背包问题( 322. 零钱兑换、279.完全平方数、139.单词
    322.零钱兑换思路:每种硬币的数量是无限的,是典型的完全背包问题。但是题目要求等于目标值的最小硬币个数。所以这里需要对动规五部曲进行分析。动规五部曲:1、确定dp数组以及下标的含义dp[j]:凑足总额为j所需钱币的最少个数为dp[j]2、确定递推公式凑足总额为j-coins[i......
  • 考研日语 - 高频核心 2200 词(十二)
    前言单词均来自全国硕士研究生招生考试日语(科目代码:203)的词汇专项备考用书《考研日语蓝宝书词汇专项》,书中从7000个考研大纲单词中精挑了2236个高频核心单词。记录本文的目的就是没事儿时候拿出来看看,用做复习,共十五篇,本文有150个单词单词序号书写读音汉语词性......
  • 记一次升级系统补丁导致 VS2022 崩溃分析
    一:背景1.讲故事在最近一两年内VisualStudio2022会偶发的出现打开即崩溃的情况,本想着把VS卸载重装,但发现这东西想卸载干净还是蛮困难的,又加上我这个人比较懒,所以就直接重装系统了,最近的9月份因为它重装了一次系统,但过了一天又遇到了同样的问题,在这样一个背景下我决定认真的看......
  • 20222420 2024-2025-1 《网络与系统攻防技术》实验一实验报告
    1.实验内容1.1学习内容总结1.1.1初步了解缓冲区溢出漏洞首先学习了安全漏洞的相关概念,然后聚焦在其中的缓冲区溢出漏洞上。学习了缓冲区溢出漏洞相关的定义和发生的原因,并了解了缓冲区溢出发展历史上的经典攻击,如红色代码蠕虫、冲击波病毒、震荡波病毒、心脏出血、乌克兰断网......
  • JOISC 2022
    JOISC2022Day1T2京都观光在zr的时候花子讲过这个题,当时就觉得非常的震撼!!现在来看还是觉得这个题好牛啊。假设我们现在只有两条路走:第一条是↓→,第二条是→↓。贡献分别为:\(B_1\timesn+A_n\timesm\)以及\(A_1\timesm+B_m\timesn\)。移项后两侧分别为\((A_n-A_1)\t......