5G PDSCH物理层处理与MATLAB仿真分析
1. 5G DLSCH解码流程
DLSCH解码过程包含多个子过程,旨在恢复接收端的传输块,具体子过程如下:
-
速率恢复
:该过程包含码块解连接、比特解交织和反向比特选择。
-
码块解连接
:将接收到的码块 $G_a$ 拆分为多个速率匹配段 $F_x^a$。接收器根据传输块大小和gNodeB传达的PDSCH目标码率确定要生成的段数,然后使用公式计算每段的长度。
-
比特解交织
:在每个段中执行比特解交织,将比特重新排序到原始位置,步骤如下:
1. 将码字 $F_x^a$ 重塑为矩阵:
[
M_{f_{x}^{a}}=\left(\begin{array}{cccc}
f_{x}^{a}(0) & f_{x}^{a}(1) & \cdots & f_{x}^{a}(Q_{m}-1) \
f_{x}^{a}(Q_{m}) & f_{x}^{a}(Q_{m}+1) & \cdots & f_{x}^{a}(2Q_{m}-1) \
\vdots & \vdots & \ddots & \vdots \
f_{x}^{a}((N_{Q}-1)Q_{m}) & f_{x}^{a}((N_{Q}-1)Q_{m}+1) & \cdots & f_{x}^{a}(N_{Q}Q_{m}-1)
\end{array}\right)
]
2. 对矩阵进行转置:
[
M_{f_{x}^{a}}^{T}=\left(\begin{array}{cccc}
f_{x}^{a}(0) & f_{x}^{a}(Q_{m}) & \cdots & f_{x}^{a}((N_{Q}-1)Q_{m}) \
f_{x}^{a}(1) & f_{x}^{a}(Q_{m}+1) & \cdots & f_{x}^{a}((N_{Q}-1)Q_{m}+1) \
\vdots & \vdots & \ddots & \vdots \
f_{x}^{a}(Q_{m}-1) & f_{x}^{a}(2Q_{m}-1) & \cdots & f_{x}^{a}(N_{Q}Q_{m}-1)
\end{array}\right)
]
3. 按列顺序排列转置矩阵的元素以获得 $E_x^a$:
[
E_{x}^{a}=\left[f_{x}^{a}(0), f_{x}^{a}(Q_{m}), \cdots, f_{x}^{a}((N_{Q}-1)Q_{m}), f_{x}^{a}(1), f_{x}^{a}(Q_{m}+1), \cdots\right]^T
]
-
反向比特选择
:对段 $E_x^a$ 执行反向比特选择过程以获得段 $D_x^a$。在此过程中,将填充比特(值为0)添加回输入码块段,以便进行LDPC解码。此外,根据传输的冗余版本,将比特放置在适当的索引处。
可以使用MATLAB的5G Toolbox中的
nrRateRecoverLDPC
函数执行速率恢复,语法如下:
Raterecovered = nrRateRecoverLDPC(rxSoftBits,trblklen,R,rv,mod,nLayers,numCB,Nref)
输入参数说明:
| 参数 | 说明 |
| ---- | ---- |
| rxSoftBits | 接收到的解扰软比特 |
| trblklen | 传输块长度 |
| r | 目标码率 |
| rv | 冗余版本 |
| mod | 调制方案 |
| nLayers | 传输层数 |
| numCB | 调度的码块段数 |
| Nref | 有限缓冲区速率匹配 |
该函数以矩阵
raterecovered
的形式返回速率恢复后的码块段。
-
LDPC解码
:在5G NR DLSCH中,使用诸如置信传播算法(BPA)等算法对每个段 $D_x^a$ 进行LDPC解码,以获得LDPC解码段 $C_x^a$。
-
置信传播算法步骤
:
-
计算比特的对数似然比(LLR):
[
LLR(\theta|w)=\log\frac{P(w|\theta = 0)}{P(w|\theta = 1)}
]
对于加性高斯白噪声(AWGN)信道,接收噪声向量 $y$ 的LLR近似为:
[
LLR(y)=-\frac{2y}{\sigma^2}
]
其中,$\sigma^2$ 是噪声向量的方差。 - 初始化与 $H$ 大小相同的矩阵 $M$,使其在 $H$ 中为1的所有位置包含所有LLR值。从矩阵 $H$ 中获得矩阵 $A$ 和 $B$,其中 $A$ 存储每个校验节点连接的每个变量节点的位置,$B$ 存储每个变量节点连接的每个校验节点的位置。
-
计算包含外部消息的矩阵 $E$:
[
E_{j,i}=\tanh\left(\frac{1}{2}\prod_{i’\in B(i)\setminus j}\tanh\left(\frac{M_{j,i’}}{2}\right)\right)
] -
计算第 $i$ 个比特的总LLR $L_i$:
[
L_i = r_i+\sum_{j\in A(i)}E_{j,i}
] - 使用每个比特的总LLR的符号进行硬判决来解码码字。总LLR为正的比特解码为0,总LLR为负的比特解码为1。
-
计算综合征以检查是否满足所有奇偶校验约束:
[
s = Hz^T
]
其中,$z$ 是解码后的LDPC码字。如果综合征为零,则意味着所有奇偶校验约束都得到满足,解码过程结束;否则,更新矩阵 $M$ 并继续下一次迭代。
-
计算比特的对数似然比(LLR):
-
置信传播算法步骤
:
可以使用MATLAB的5G Toolbox中的
nrLDPCDecode
函数执行LDPC解码,语法如下:
[decoded,actNumIter,finalParityChecks] = nrLDPCDecode(raterecoveredD,bgn,maxNumIter,Name,Value)
输入参数说明:
| 参数 | 说明 |
| ---- | ---- |
| raterecoveredD | 速率恢复后的双精度数值类型软比特 |
| bgn | 基础图编号 |
| maxNumIter | 最大解码迭代次数 |
| Name-Value对 | 允许用户指定输出格式、决策类型、算法、缩放因子、偏移量和终止条件等 |
该函数返回解码后的LDPC码字、实际迭代次数(可选输出)和最终奇偶校验结果(可选输出)。
- 码块解分段 :将段 $C_x^a$ 组合回包含信息比特和CRC比特的码字 $B_a$,并提取和检查在分段过程中包含在每个段中的CRC比特。
可以使用MATLAB的5G Toolbox中的
nrCodeblockDesegmentLDPC
函数执行码块解分段,语法如下:
[desegmented,err] = nrCodeblockDesegmentLDPC(decoded,bgn,blklen)
输入参数说明:
| 参数 | 说明 |
| ---- | ---- |
| decoded | 码块段 |
| bgn | 基础图编号 |
| blklen | 输出块长度 |
该函数返回连接的数据块和段中的CRC错误。
- CRC解码 :使用码字 $B_a$ 中的CRC比特检查是否已无错误解码,并输出DLSCH码字 $out_a$。如果重新计算的CRC比特与通过传输获得的CRC比特不匹配,则意味着接收到的码字存在错误。
可以使用MATLAB的5G Toolbox中的
nrCRCDecode
函数执行CRC解码,语法如下:
[blk,err] = nrCRCDecode(desegmented,poly)
输入参数说明:
| 参数 | 说明 |
| ---- | ---- |
| desegmented | CRC编码数据 |
| poly | CRC多项式 |
该函数返回CRC解码后的数据和CRC错误数据。
下面是DLSCH解码流程的mermaid流程图:
graph TD;
A[速率恢复] --> B[LDPC解码];
B --> C[码块解分段];
C --> D[CRC解码];
2. 5G PDSCH处理链的MATLAB仿真
可以使用Mathworks MATLAB对5G PDSCH处理链进行建模,仿真模型基于MATLAB的5G Toolbox(版本1.1)构建。以下是仿真的主要步骤:
- 定义仿真参数 :
clear all
rng(200); % Set Random Number Generator state for repeatability
simParameters=[]; % Clear simParameters structure array
simParameters.NFrames=1000; % Set number of 10ms frames to simulate
EbN0=[-5:15];
TargetCodeRate=40/1024; % PDSCH code rate
bps=2; % bits per symbol, 1 for BPSK, 2 for QPSK
EsNo=EbN0 + 10*log10(bps);
snrdB=EsNo + 10*log10(R); % SNR in dB
simParameters.SNRIn=snrdB; % Set SNR range
maxThroughput=zeros(length(simParameters.SNRIn),1);
simThroughput=zeros(length(simParameters.SNRIn),1);
numerrcombined=zeros(length(simParameters.SNRIn),1);
numblkerr=zeros(length(simParameters.SNRIn),1);
- 定义波形参数 :
simParameters.NRB=24; % Number of resource blocks as per selected bandwidth
simParameters.SubcarrierSpacing=30; % Set subcarrier spacing (kHz)
simParameters.CyclicPrefix='Normal'; % Specify cyclic prefix type
- 定义DL - SCH/PDSCH参数 :
simParameters.PDSCH.PRBSet=0:simParameters.NRB-1; % PDSCH PRB allocation
simParameters.PDSCH.SymbolSet=0:11; % PDSCH symbol allocation in each slot
simParameters.PDSCH.EnableHARQ=true; % Enable/disable HARQ
simParameters.PDSCH.NLayers=2; % Set number of PDSCH layers
simParameters.NTxAnts=2; % Set number of PDSCH transmission antennas
ModOrder= 'QPSK'; % Set modulation order: 'QPSK', '16QAM', '64QAM' or '256QAM'
if simParameters.PDSCH.NLayers > 4
simParameters.NumCW=2; % Number of code-words
simParameters.PDSCH.TargetCodeRate=[TargetCodeRate TargetCodeRate]; % Set PDSCH code rate for each code-word
simParameters.PDSCH.Modulation={ ModOrder, ModOrder }; % Set modulation order for each code-word
simParameters.NRxAnts=8; % Number of UE receive antennas
else
simParameters.NumCW=1; % Number of code-words
simParameters.PDSCH.TargetCodeRate=TargetCodeRate; % Set PDSCH code rate
simParameters.PDSCH.Modulation=ModOrder; % Set modulation order: 'QPSK', '16QAM', '64QAM', '256QAM'
simParameters.NRxAnts=2; % Number of UE receive antennas
end
- 定义DM - RS参数 :
simParameters.PDSCH.PortSet=0:simParameters.PDSCH.NLayers-1; % DM-RS ports to use for the layers
simParameters.PDSCH.PDSCHMappingType='A'; % Set DM-RS mapping type ('A'(slot-wise),'B'(non slot-wise))
simParameters.PDSCH.DMRSTypeAPosition=2; % For mapping type A only, set first DM-RS symbol position (2,3)
simParameters.PDSCH.DMRSLength=1; % Set number of front-loaded DM-RS symbols (1(single symbol),2(double symbol))
simParameters.PDSCH.DMRSAdditionalPosition=0; % Set additional DM-RS symbol positions (max range 0...3)
simParameters.PDSCH.DMRSConfigurationType=2; % Set DM-RS configuration type (1,2)
simParameters.PDSCH.NIDNSCID=1; % Set DM-RS scrambling identity (0...65535)
simParameters.PDSCH.NSCID=0; % DM-RS Scrambling initialization (0,1)
- 定义保留PRB模式 :
simParameters.PDSCH.Reserved.Symbols=[]; % Define no Reserved PDSCH symbols
simParameters.PDSCH.Reserved.PRB=[]; % Define no Reserved PDSCH PRBs
simParameters.PDSCH.Reserved.Period=[]; % Periodicity of reserved resources set to null
pdsch=simParameters.PDSCH;
- 定义信道模型 :
simParameters.ChannelType='CDL'; % Specify channel model: 'CDL' or 'TDL'
nTxAnts=simParameters.NTxAnts;
nRxAnts=simParameters.NRxAnts;
if strcmpi(simParameters.ChannelType,'CDL')
channel=nrCDLChannel; % Create CDL channel object
channel.DelayProfile='CDL-C'; % Specify CDL delay profile: 'CDL-A', 'CDL-B', 'CDL-C', 'CDL-D' or 'CDL-E'
channel.DelaySpread=300e-9; % Set Delay Spread in seconds
[channel.TransmitAntennaArray.Size, channel.ReceiveAntennaArray.Size]=...
hArrayGeometry(nTxAnts,nRxAnts);
elseif strcmpi(simParameters.ChannelType,'TDL')
channel=nrTDLChannel; % Create TDL channel object
channel.DelayProfile='TDL-C'; % Specify TDL delay profile: 'TDL-A', 'TDL-B', 'TDL-C', 'TDL-D' or 'TDL-E'
channel.DelaySpread=300e-9; % Set Delay Spread in seconds
channel.NumTransmitAntennas=nTxAnts;
channel.NumReceiveAntennas=nRxAnts;
end
- 定义SS突发参数 :
simParameters.SSBurst.BlockPattern='Case B'; % Specify SSB block pattern
simParameters.SSBurst.SSBTransmitted=[0 1 0 1]; % Specify SSB bitmap
simParameters.SSBurst.SSBPeriodicity=20; % SSB periodicity in ms (5, 10, 20, 40, 80, 160)
- 设置信道模型的采样率 :
gnb=simParameters;
waveformInfo=hOFDMInfo(gnb); % Generate OFDM waveform information
channel.SampleRate=waveformInfo.SamplingRate; % Include sampling rate information in channel system object
- 初始化HARQ :
if pdsch.EnableHARQ
rvSeq=[0 2 3 1]; % Set up Redundancy Version (RV) sequence
else
rvSeq=0;
end
NHARQProcesses=16; % Specify the number of HARQ processes
harqSequence=1:NHARQProcesses; % Specify the sequence in which the HARQ processes are used
- 创建DLSCH编码器和解码器系统对象 :
encodeDLSCH=nrDLSCH; % Create DLSCH encoder system object
encodeDLSCH.MultipleHARQProcesses=true; % Enable multiple HARQ processes
encodeDLSCH.TargetCodeRate=pdsch.TargetCodeRate;
decodeDLSCH=nrDLSCHDecoder; % Create DLSCH decoder system object
decodeDLSCH.MultipleHARQProcesses=true; % Enable multiple HARQ processes
decodeDLSCH.TargetCodeRate=pdsch.TargetCodeRate;
- 处理循环 :
for snrIdx=1:numel(simParameters.SNRIn)
rng('default'); % Set the random number generator settings to default values
reset(decodeDLSCH); % Reset object's properties to default values
SNRdB=simParameters.SNRIn(snrIdx); % Pick SNR value from range to be simulated
% Initialize counters to be used in the simulation
bitTput=[]; % Number of successfully received bits per transmission
txedBlkNum=0; % Number of transmitted blocks
txedTrBlkSizes=[]; % Number of transmitted info bits per transmission
txedAlpBlkSizes=[]; % Number of transmitted alphabets per transmission
% Initialize the state of all HARQ processes
harqProcesses=hNewHARQProcesses(NHARQProcesses,rvSeq,gnb.NumCW);
harqProcCntr=0; % HARQ process counter
% Reset the channel so that each SNR point will experience the same channel realization
reset(channel);
% Calculate total number of OFDM symbols in the simulation period
NSymbols=gnb.NFrames * 10 * waveformInfo.SymbolsPerSubframe;
% Initialize OFDM symbol pointer at the start of each PDSCH transmission
gnb.NSymbol=0;
% Initialize slot pointer
pdsch.NSlot=0;
% Initialize index to the start of the current set of SS burst samples to be transmitted
ssbSampleIndex=1;
% Obtain a precoding matrix (wtx) to be used in the transmission of the
% first transport block
estChannelGrid=getInitialChannelEstimate(gnb,nTxAnts,channel);
newWtx=getPrecodingMatrix(pdsch.PRBSet,pdsch.NLayers,estChannelGrid);
while gnb.NSymbol < NSymbols % Move to next slot, gnb.NSymbol increased in steps of one slot
% Generate a new SS burst when necessary
if (ssbSampleIndex==1)
nSubframe=gnb.NSymbol / waveformInfo.SymbolsPerSubframe; % Calculate number of subframes
ssburst.NFrame=floor(nSubframe / 10); % Calculate number of frames
ssburst.NHalfFrame=mod(nSubframe / 5,2); % Calculate number of half-frames
[ssbWaveform,~,ssbInfo]=hSSBurst(ssburst); % Create SSB waveform
end
% Get HARQ process index for the current PDSCH transmission from HARQ index table
harqProcIdx=harqSequence(mod(harqProcCntr,length(harqSequence))+1);
% Update current HARQ process information based on CRC results
% in the previous transmission for this HARQ process
harqProcesses(harqProcIdx)=hUpdateHARQProcess(harqProcesses(harqProcIdx),gnb.NumCW);
% Calculate the transport block sizes for the code-words in the slot
[pdschIndices,dmrsIndices,dmrsSymbols,pdschIndicesInfo]=hPDSCHResources(gnb,pdsch); % Find RE indices of PDSCH and DMRS data
trBlkSizes=hPDSCHTBS(pdsch,pdschIndicesInfo.NREPerPRB);
% HARQ: check CRC from previous transmission per code-word
for cwIdx=1:gnb.NumCW
if harqProcesses(harqProcIdx).blkerr(cwIdx) % If CRC failed
if (harqProcesses(harqProcIdx).RVIdx(cwIdx)==1) % If end of rvSeq
resetSoftBuffer(decodeDLSCH,cwIdx-1,harqProcIdx-1); % Reset HARQ soft buffer
end
else % If no error
trBlk{cwIdx}=randi([0 1],trBlkSizes(cwIdx),1); %Generate new transport block
setTransportBlock(encodeDLSCH,trBlk{cwIdx},cwIdx-1,harqProcIdx-1); % Load transport block on DLSCH
end
end
% DLSCH Encoding
codedTrBlock=encodeDLSCH(pdsch.Modulation,pdsch.NLayers,pdschIndicesInfo.G,harqProcesses(harqProcIdx).RV,harqProcIdx-1);
% PDSCH Encoding
pdsch.RNTI=1; % Set RNTI
pdschSymbols=nrPDSCH(codedTrBlock,pdsch.Modulation,pdsch.NLayers,gnb.NCellID,pdsch.RNTI);
% Precoding
wtx=newWtx; % Get wtx (precoding matrix) calculated in previous slot
pdschSymbols=pdschSymbols*wtx; % Apply precoding matrix to PDSCH symbols
% Resource Grid Mapping
pdschGrid=zeros(waveformInfo.NSubcarriers,waveformInfo.SymbolsPerSlot,nTxAnts); % Create resource grid
[~,pdschAntIndices]=nrExtractResources(pdschIndices,pdschGrid); % Find PDSCH symbol indices on all transmit antennas
pdschGrid(pdschAntIndices)=pdschSymbols; % Map PDSCH symbols on resource grid on all transmit antennas
% PDSCH DM-RS precoding and mapping
for p=1:size(dmrsSymbols,2)
[~,dmrsAntIndices]=nrExtractResources(dmrsIndices(:,p),pdschGrid); % Find DMRS symbols' indices
pdschGrid(dmrsAntIndices)=pdschGrid(dmrsAntIndices) + dmrsSymbols(:,p)*wtx(p,:); % Map DMRS symbols on resource grid
end
% CP-OFDM Modulation
txWaveform=hOFDMModulate(gnb, pdschGrid); %Perform OFDM Modulation
% Add SS-burst waveform to transmitted waveform
Nt=size(txWaveform,1);
txWaveform=txWaveform + ssbWaveform(ssbSampleIndex + (0:Nt-1),:); % Add SSB to transmitted waveform
ssbSampleIndex=mod(ssbSampleIndex + Nt,size(ssbWaveform,1)); % Set next SSB sample index
% Pass through Channel Model
txWaveform=[txWaveform; zeros(maxChDelay, size(txWaveform,2))];
[rxWaveform,pathGains,sampleTimes]=channel(txWaveform);
% For AWGN, normalize noise power to take account of sampling rate, which is
% a function of the IFFT size used in OFDM modulation. The SNR
% is defined per RE for each receive antenna (TS 38.101-4).
SNR=10^(SNRdB/20); % Calculate linear noise gain
N0=1/(sqrt(2.0*nRxAnts*double(waveformInfo.Nfft))*SNR);
noise=N0*complex(randn(size(rxWaveform)),randn(size(rxWaveform)));
rxWaveform=rxWaveform + noise; % Add AWGN to the received time domain waveform
% Perfect Synchronization
pathFilters=getPathFilters(channel); % Get path filters for perfect channel estimation
[offset,mag]=nrPerfectTimingEstimate(pathGains,pathFilters); % Perform perfect timing estimate
rxWaveform=rxWaveform(1+offset:end, :); % Synchronized signal
% CP-OFDM Demodulation
rxGrid=hOFDMDemodulate(gnb, rxWaveform);
% Channel Estimation
estChannelGrid=nrPerfectChannelEstimate(pathGains,pathFilters,gnb.NRB,gnb.SubcarrierSpacing,pdsch.NSlot,offset,sampleTimes,gnb.CyclicPrefix);
% Get perfect noise estimate (from the noise realization)
noiseGrid=hOFDMDemodulate(gnb,noise(1+offset:end ,:));
noiseEst=var(noiseGrid(:));
% PDSCH Decoding
newWtx=getPrecodingMatrix(pdsch.PRBSet,pdsch.NLayers,estChannelGrid);
K=size(estChannelGrid,1);
estChannelGrid=reshape(estChannelGrid,K*waveformInfo.SymbolsPerSlot*nRxAnts,nTxAnts);
estChannelGrid=estChannelGrid*wtx.';
estChannelGrid=reshape(estChannelGrid,K,waveformInfo.SymbolsPerSlot,nRxAnts,pdsch.NLayers);
[pdschRx,pdschHest]=nrExtractResources(pdschIndices,rxGrid,estChannelGrid);
[pdschEq,csi]=nrEqualizeMMSE(pdschRx,pdschHest,noiseEst);
[dlschLLRs,rxSymbols]=nrPDSCHDecode(pdschEq,pdsch.Modulation,gnb.NCellID,pdsch.RNTI,noiseEst);
% DLSCH Decoding
csi=nrLayerDemap(csi); % CSI layer demapping
for cwIdx=1:gnb.NumCW
Qm=length(dlschLLRs{cwIdx})/length(rxSymbols{cwIdx}); % Calculate number of bits per symbol
csi{cwIdx}=repmat(csi{cwIdx}.',Qm,1); % Expand by each bit per symbol
dlschLLRs{cwIdx}=dlschLLRs{cwIdx} .* csi{cwIdx}(:); % Scale LLRs
end
decodeDLSCH.TransportBlockLength=trBlkSizes; % Input transport block size information to DLSCH decoder system object
[decbits,harqProcesses(harqProcIdx).blkerr]=decodeDLSCH(dlschLLRs,pdsch.Modulation,pdsch.NLayers,harqProcesses(harqProcIdx).RV,harqProcIdx-1);
% Store Values for throughput, BER and BLER calculations
if(any(trBlkSizes) ~= 0)
bitTput=[bitTput trBlkSizes.*(1-harqProcesses(harqProcIdx).blkerr)];
txedTrBlkSizes=[txedTrBlkSizes trBlkSizes];
txedBlkNum=txedBlkNum+gnb.NumCW;
for cwIdx=1:gnb.NumCW %Store values for all PDSCH code-words
if gnb.NumCW==1
numerr=numel(find(double(decbits)~=trBlk{1}));
else
numerr(cwIdx)= numel(find(double(decbits{cwIdx})~=trBlk{cwIdx}));
end
numerrcombined(snrIdx)=numerrcombined(snrIdx)+sum(numerr);
numblkerr(snrIdx)=numblkerr(snrIdx)+sum(harqProcesses(harqProcIdx).blkerr);
end
end
% Preparation for next PDSCH transmission
gnb.NSymbol=gnb.NSymbol + size(pdschGrid,2);
pdsch.NSlot=pdsch.NSlot + 1;
harqProcCntr=harqProcCntr + 1;
end
% Throughput, BER and BLER calculation
maxThroughput(snrIdx)=sum(txedTrBlkSizes); % Maximum possible throughput
simThroughput(snrIdx)=sum(bitTput,2); % Simulated throughput
simThroughputmbps(snrIdx)=1e-6*simThroughput(snrIdx)/(gnb.NFrames*10e-3); % Simulated throughput (Mbps)
BER(snrIdx)=numerrcombined(snrIdx)/sum(txedTrBlkSizes); % Calculate BER
BLER(snrIdx)= numblkerr(snrIdx)/txedBlkNum; % Calculate BLER
% Display the results dynamically in the command window
fprintf(['\nAt Eb/N0=', num2str(EbN0(snrIdx))]);
fprintf([['\nThroughput(Mbps) for ', num2str(gnb.NFrames),' frame(s) '],...
'= %.4f\n'], simThroughputmbps(snrIdx));
fprintf([['BER for ', num2str(gnb.NFrames),' frame(s) '],...
'= %.4e\n'], BER(snrIdx));
fprintf([['BLER for ', num2str(gnb.NFrames),' frame(s) '],...
'= %.4e\n'], BLER(snrIdx));
% Do not simulate next SNR if BER is 0
if BER(snrIdx)==0
simParameters.SNRIn=simParameters.SNRIn(1:snrIdx);
EbN0=EbN0(1:snrIdx);
break;
end
end
- 显示结果 :
figure;
plot(EbN0,simThroughputmbps,'-x','Linewidth',2)
xlabel('Eb/N0'); ylabel('Throughput (Mbps)'); grid on;
title(sprintf('PDSCH Throughput (%dx%d) / NRB=%d / SCS=%dkHz',...
nTxAnts,nRxAnts,gnb.NRB,gnb.SubcarrierSpacing));
figure;
semilogy(EbN0,BER,'r-x','Linewidth',2)
xlabel('Eb/N0'); ylabel('BER'); grid on;
title(sprintf('BER (%dx%d) / NRB=%d / SCS=%dkHz',...
nTxAnts,nRxAnts,gnb.NRB,gnb.SubcarrierSpacing));
figure;
semilogy(EbN0,BLER,'c-x','Linewidth',2)
xlabel('Eb/N0'); ylabel('BLER'); grid on;
title(sprintf('BLER (%dx%d) / NRB=%d / SCS=%dkHz',...
nTxAnts,nRxAnts,gnb.NRB,gnb.SubcarrierSpacing));
通过上述步骤,可以完成5G PDSCH处理链的MATLAB仿真,并分析不同信噪比下的吞吐量、比特错误率(BER)和块错误率(BLER)。
下面是5G PDSCH处理链仿真流程的mermaid流程图:
graph TD;
A[定义仿真参数] --> B[定义波形参数];
B --> C[定义DL - SCH/PDSCH参数];
C --> D[定义DM - RS参数];
D --> E[定义保留PRB模式];
E --> F[定义信道模型];
F --> G[定义SS突发参数];
G --> H[设置信道模型的采样率];
H --> I[初始化HARQ];
I --> J[创建DLSCH编码器和解码器系统对象];
J --> K[处理循环];
K --> L[显示结果];
5G PDSCH物理层处理与MATLAB仿真分析
3. 仿真结果分析
通过上述MATLAB仿真,可以得到不同信噪比($E_b/N_0$)下5G PDSCH的吞吐量、比特错误率(BER)和块错误率(BLER)。以下是两组不同参数设置下的仿真结果:
3.1 第一组参数仿真结果
-
参数设置 :
- 仿真帧数:1000帧
- 带宽:10 MHz
- 子载波间隔(SCS):30 kHz
- PDSCH目标码率:40/1024
- 调制方式:QPSK
- 发射天线数:2
- 接收天线数:2
-
仿真结果数据 :
| $E_b/N_0$ (dB) | 吞吐量 (Mbps) | BER | BLER |
| ---- | ---- | ---- | ---- |
| -5 | 0.6914 | 2.2968e-01 | 3.4525e-01 |
| -4 | 0.8121 | 1.4976e-01 | 2.3100e-01 |
| -3 | 0.9122 | 8.4471e-02 | 1.3615e-01 |
| -2 | 0.9890 | 3.7603e-02 | 6.3400e-02 |
| -1 | 1.0331 | 1.2453e-02 | 2.1700e-02 |
| 0 | 1.0501 | 3.0246e-03 | 5.5500e-03 |
| 1 | 1.0551 | 4.4261e-04 | 8.5000e-04 |
| 2 | 1.0560 | 0.0000e+00 | 0.0000e+00 |
从这些数据可以看出,随着信噪比的增加,吞吐量逐渐接近最大值,BER和BLER则迅速下降。当信噪比达到2 dB时,BER和BLER均为0,说明此时系统的传输性能非常好,几乎没有错误发生。
3.2 第二组参数仿真结果
-
参数设置 :
- 仿真帧数:100帧
- 带宽:20 MHz
- 子载波间隔(SCS):30 kHz
- PDSCH目标码率:616/1024
- 调制方式:64 - QAM
- 发射天线数:8
- 接收天线数:2
- 传输块大小:34,816 bits
-
仿真结果数据 :
| $E_b/N_0$ (dB) | 吞吐量 (Mbps) | BER | BLER |
| ---- | ---- | ---- | ---- |
| -10 | 31.3344 | 0.3324 | 0.5500 |
| -9 | 33.5278 | 0.3005 | 0.5185 |
| -8 | 38.5413 | 0.2509 | 0.4465 |
| -7 | 45.6438 | 0.1884 | 0.3445 |
| -6 | 52.8855 | 0.1268 | 0.2405 |
| -5 | 61.6591 | 0.0597 | 0.1145 |
| -4 | 66.3245 | 0.0244 | 0.0475 |
| -3 | 68.0653 | 0.0116 | 0.0225 |
| -2 | 68.9009 | 0.0054 | 0.0105 |
| -1 | 69.3187 | 0.0023 | 0.0045 |
| 0 | 69.5624 | 0.0005 | 0.0010 |
| 1 | 69.5972 | | |
同样,随着信噪比的增加,吞吐量不断提高,BER和BLER持续降低。由于提高了带宽、目标码率和调制阶数,这组参数下的吞吐量明显高于第一组,但在低信噪比下,BER和BLER也相对较高。
4. 关键技术点总结
在5G PDSCH物理层处理和MATLAB仿真过程中,涉及到多个关键技术点,以下是对这些技术点的总结:
4.1 DLSCH解码技术
- 速率恢复 :通过码块解连接、比特解交织和反向比特选择,将接收到的码块恢复到适合LDPC解码的形式。
- LDPC解码 :使用置信传播算法(BPA)等算法对码块进行解码,通过迭代计算和奇偶校验来提高解码的准确性。
- 码块解分段和CRC解码 :将解码后的码块段组合成完整的码字,并通过CRC校验来检测传输错误。
4.2 MATLAB仿真技术
- 参数设置 :合理设置仿真参数,包括帧数、带宽、子载波间隔、目标码率、调制方式等,以模拟不同的通信场景。
- 信道模型 :使用nrCDLChannel或nrTDLChannel系统对象来模拟信道特性,考虑多径衰落和噪声的影响。
- HARQ机制 :通过HARQ机制实现重传,提高传输的可靠性。
- 信号处理流程 :包括编码、调制、预编码、资源映射、OFDM调制和解调、信道估计、均衡和解码等一系列信号处理步骤。
5. 结论
通过对5G PDSCH物理层处理的MATLAB仿真,我们可以深入了解5G通信系统在不同信噪比下的性能表现。随着信噪比的增加,系统的吞吐量逐渐提高,比特错误率和块错误率显著降低。同时,合理选择系统参数,如带宽、目标码率和调制方式等,可以在不同的应用场景中实现最佳的性能平衡。
在实际应用中,可以根据具体的需求和环境条件,调整这些参数,以满足不同的通信要求。此外,通过不断优化解码算法和信号处理流程,还可以进一步提高系统的性能和可靠性。
下面是关键技术点与仿真流程的关系mermaid流程图:
graph LR;
A[DLSCH解码技术] --> B[MATLAB仿真技术];
B --> C[仿真结果分析];
C --> D[结论与优化建议];
E[速率恢复] --> A;
F[LDPC解码] --> A;
G[码块解分段和CRC解码] --> A;
H[参数设置] --> B;
I[信道模型] --> B;
J[HARQ机制] --> B;
K[信号处理流程] --> B;
通过以上的分析和总结,我们对5G PDSCH物理层处理和MATLAB仿真有了更全面的认识,为进一步研究和优化5G通信系统提供了有力的支持。
超级会员免费看
1234

被折叠的 条评论
为什么被折叠?



