function [pdschIndices,dmrsIndices,dmrsSymbols,varargout] = hPDSCHResources(gnb,pdsch)
% Argument check
narginchk(2,2);
% Continue to support the older v15.2.0 RRC derived parameter names in this function
pmap = [
% v15.2.0 -> v15.3.0
"DL_DMRS_add_pos" "DMRSAdditionalPosition"; % dmrs-AdditionalPosition
"DL_DMRS_max_len" "DMRSLength"; % maxLength - DMRS-DownlinkConfig RRC
"DL_DMRS_typeA_pos" "DMRSTypeAPosition"; % dmrs-TypeA-Position (2,3)
"DL_DMRS_config_type" "DMRSConfigurationType" ]; % dmrs-Type (1,2)
% Map across older parameter names, if present at the input
pwarningstr = 'The %s parameter name is based on a pre-v15.3.0 version of the 3GPP NR standard. Use %s instead.';
for i=1:size(pmap,1)
if isfield(pdsch,pmap(i,1))
pdsch.(pmap(i,2)) = pdsch.(pmap(i,1));
warning('nr5g:DMRSParametersRelease15',pwarningstr,pmap(i,1), pmap(i,2));
pdsch = rmfield(pdsch,pmap(i,1));
end
end
% Map across 'NDLRB' to 'NRB' parameter name, if present at the input
if isfield(gnb,'NDLRB')
gnb.NRB = gnb.NDLRB;
warning('nr5g:DMRSParametersRelease15',pwarningstr,'NDLRB','NRB');
gnb = rmfield(gnb,'NDLRB');
end
% Get the carrier and pdsch objects from the input structures
[carrier,pdschObj,indNonContig] = convertStructToObjects(gnb,pdsch);
numSymNonContig = numel(indNonContig); % Number of OFDM symbols that are not part of the contiguous symbol allocation
% Get the number of layers
nLayers = pdschObj.NumLayers;
% Get the PDSCH resource element indices and structural information
[pdschIndicesAll,gInfo] = nrPDSCHIndices(carrier,pdschObj);
pdschIndices = reshape(double(pdschIndicesAll),[],nLayers);
% Get the PDSCH DM-RS and PT-RS OFDM symbol locations within the
% allocated OFDM symbols
nDMRSSym = numel(gInfo.DMRSSymbolSet);
nPTRSSym = numel(gInfo.PTRSSymbolSet);
if numSymNonContig
% Remove the DM-RS and PT-RS OFDM symbol locations, which are not
% part of allocated OFDM symbols
dmrsLogicalMatrix = repmat(gInfo.DMRSSymbolSet,numSymNonContig,1) == repmat(indNonContig,1,nDMRSSym);
dmrsLogicalIndex = ~sum(dmrsLogicalMatrix,1);
ptrsLogicalMatrix = repmat(gInfo.PTRSSymbolSet,numSymNonContig,1) == repmat(indNonContig,1,nPTRSSym);
ptrsLogicalIndex = ~sum(ptrsLogicalMatrix,1);
else
dmrsLogicalIndex = true(nDMRSSym,1);
ptrsLogicalIndex = true(nPTRSSym,1);
end
dmrsSymbolSet = gInfo.DMRSSymbolSet(dmrsLogicalIndex);
ptrsSymbolSet = gInfo.PTRSSymbolSet(ptrsLogicalIndex);
% Get the PDSCH DM-RS symbols and indices
if ~isempty(dmrsSymbolSet)
dmrsIndices = reshape(double(nrPDSCHDMRSIndices(carrier,pdschObj)),[],nLayers);
dmrsSymbols = reshape(nrPDSCHDMRS(carrier,pdschObj),[],nLayers);
else
dmrsIndices = zeros(0,nLayers);
dmrsSymbols = zeros(0,nLayers);
end
% Get the PDSCH PT-RS symbols and indices
if ~isempty(gInfo.PTRSSymbolSet) && ~isempty(dmrsSymbolSet)
% Assign the PDSCH DM-RS OFDM symbol locations, which are within
% the allocated OFDM symbols to CustomSymbolSet
pdschObj.DMRS.CustomSymbolSet = dmrsSymbolSet;
ptrsIndices = double(nrPDSCHPTRSIndices(carrier,pdschObj));
ptrsSymbols = nrPDSCHPTRS(carrier,pdschObj);
else
ptrsIndices = zeros(0,1);
ptrsSymbols = zeros(0,1);
end
% Get the number of resource elements (RE) in a resource block (RB)
% allocated for PDSCH
if numSymNonContig
% When DM-RS OFDM symbol indices are not within the OFDM symbols
% allocated for PDSCH, get the number of REs in an RB used for data
% DM-RS subcarrier (SC) locations in an RB
if pdschObj.DMRS.DMRSConfigurationType==1
% Type 1: 6 DM-RS SC per PRB per CDM (every other SC)
dmrssc = [0 2 4 6 8 10]'; % RE indices in an RB
dshiftsnodata = 0:min(pdschObj.DMRS.NumCDMGroupsWithoutData,2)-1; % Delta shifts for CDM groups without data
else
% Type 2: 4 DM-RS SC per PRB per CDM (2 groups of 2 SC)
dmrssc = [0 1 6 7]'; % RE indices in an RB
dshiftsnodata = 2*(0:min(pdschObj.DMRS.NumCDMGroupsWithoutData,3)-1); % Delta shifts for CDM groups without data
end
dshifts = pdschObj.DMRS.DeltaShifts;
% Non DM-RS resource elements in a DM-RS containing symbol
fullprb = ones(12,1); % Binary map of all the subcarriers in an RB
dshiftsComp = [dshifts dshiftsnodata];
dmrsre = repmat(dmrssc,1,numel(dshiftsComp)) + repmat(dshiftsComp, numel(dmrssc),1);
fullprb(dmrsre+1) = 0; % Clear all RE which will carry DM-RS in at least one port
pdschre = find(fullprb)-1; % Find PDSCH (non DM-RS) RE in a DM-RS containing symbol
nDMRSSym = length(dmrsSymbolSet);
nREPerPRB = 12*(length(unique(pdsch.SymbolSet(:)))-nDMRSSym)+numel(pdschre)*nDMRSSym;
else
nREPerPRB = gInfo.NREPerPRB;
end
% Combine information into output structure
pdschInfo.G = gInfo.G;
pdschInfo.Gd = gInfo.Gd;
pdschInfo.NREPerPRB = nREPerPRB;
pdschInfo.DMRSSymbolSet = dmrsSymbolSet;
pdschInfo.CDMGroups = pdschObj.DMRS.CDMGroups;
pdschInfo.CDMLengths = pdschObj.DMRS.CDMLengths;
pdschInfo.PTRSSymbolSet = ptrsSymbolSet;
% Assign the outputs based on number of output arguments
if nargout <= 4
% [pdschIndices,dmrsIndices,dmrsSymbols,pdschInfo]
varargout{1} = pdschInfo;
else
% [pdschIndices,dmrsIndices,dmrsSymbols,ptrsIndices,ptrsSymbols,pdschInfo]
varargout{1} = ptrsIndices;
varargout{2} = ptrsSymbols;
varargout{3} = pdschInfo;
end
end
function [carrier,pdsch,ind] = convertStructToObjects(gnb,chs)
%convertStructToObjects Provides the configuration objects given structures
%
% [CARRIER,PDSCH,IND] = convertStructToObjects(GNB,CHS) provides the
% carrier configuration object CARRIER and physical downlink shared
% channel object PDSCH, given the input structures GNB-wide settings GNB
% and channel specific transmission configuration CHS. This function also
% provides the OFDM symbol indices IND that are not part of the
% contiguous symbol allocation.
% Get the carrier configuration with the inputs gnb and chs
carrier = nrCarrierConfig;
carrier.NSizeGrid = gnb.NRB;
carrier = passign(gnb,carrier,'NCellID');
carrier = passign(gnb,carrier,'SubcarrierSpacing');
carrier = passign(gnb,carrier,'CyclicPrefix');
carrier = passign(gnb,carrier,'RBOffset','NStartGrid');
carrier = passign(chs,carrier,'NSlot');
% Get the pdsch configuration object with the chs input
pdsch = nrPDSCHConfig;
dmrs = nrPDSCHDMRSConfig;
pdsch = passign(chs,pdsch,'ReservedREs','ReservedRE');
dmrs = passign(chs,dmrs,'PortSet','DMRSPortSet');
numDMRSPorts = numel(dmrs.DMRSPortSet);
if numDMRSPorts
% Assign the number of layers to the number of DM-RS antenna ports
pdsch.NumLayers = numDMRSPorts;
else
% Get the number of layers, when DM-RS antenna port set is empty
pdsch = passign(chs,pdsch,'NLayers','NumLayers');
end
pdsch.Modulation = chs.Modulation;
pdsch = passign(chs,pdsch,'PDSCHMappingType','MappingType');
% Get SymbolAllocation value, depending on the values of SymbolSet
% field
if ~isfield(chs,'SymbolSet')
pdsch.SymbolAllocation = [0 carrier.SymbolsPerSlot];
ind = zeros(0,1);
elseif isempty(chs.SymbolSet)
pdsch.SymbolAllocation = [0 0];
ind = zeros(0,1);
else
[lb,ub] = bounds(chs.SymbolSet);
pdsch.SymbolAllocation = [lb ub-lb+1];
symTemp = lb:ub;
logicalMatrix = repmat(sym
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
1.版本:matlab2022A,包含仿真操作录像和代码注释,操作录像使用windows media player播放。 2.领域:5G通信系统信道估计 3.内容:基于深度学习网络的5G通信系统信道估计算法。 layers = [ ... imageInputLayer([612 14 1],'Normalization','none') convolution2dLayer(9,64,'Padding',4) reluLayer convolution2dLayer(5,64,'Padding',2,'NumChannels',64) reluLayer convolution2dLayer(5,64,'Padding',2,'NumChannels',64) reluLayer convolution2dLayer(5,32,'Padding', 4.注意事项:注意MATLAB左侧当前文件夹路径,必须是程序所在文件夹位置,具体可以参考视频录。
资源推荐
资源详情
资源评论
收起资源包目录
基于深度学习网络的5G通信系统信道估计算法matlab性能仿真.rar (12个子文件)
DeepLearningDataSynthesis5G_ExampleOverview.png 60KB
2.jpg 81KB
仿真操作录像0019.avi 120.36MB
1.png 93KB
DeepLearningDataSynthesis5G_ChEstimationOverview.png 35KB
code
trainedChannelEstimationNetwork.mat 956KB
plotChEstimates.m 949B
hPreprocessInput.m 977B
hPDSCHResources.m 13KB
Runme.m 8KB
hDeepLearningChanEstSimParameters.m 3KB
hGenerateTrainingData.m 7KB
共 12 条
- 1
fpga和matlab
- 粉丝: 17w+
- 资源: 2627
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页