Reference Signal Measurements (RSRP, RSSI, RSRQ) for Cell Reselection matlab code i got this error .
cany you sent this matlab code for reference purpose:please
Attempt to execute SCRIPT hRSMeasurements as a function:
C:\Users\uses\Documents\MATLAB\hRSMeasurements.m
Error in today (line 60)
rsmeas1 = hRSMeasurements(cell1,rxgridcell1);

 採用された回答

KSSV
KSSV 2021 年 7 月 10 日

0 投票

It seems the file: hRSMeasurements is not a function it is a code. Go inside the file, define your variables cell1,rxgridcell1 and then run the code.

1 件のコメント

chockalingam t
chockalingam t 2021 年 7 月 10 日
This is my code can you check & correct any error .please
SINRdB1 = [ 16 13 16]; % Es/Noc for Cell 1
SINRdB2 = [-Inf 16 13]; % Es/Noc for Cell 2
edit('hRSMeasurements.m');
NocdBm = -98; % dBm/15kHz average power spectral density
NocdBW = NocdBm-30; % Noc in dBW/15kHz
Noc = 10^(NocdBW/10); % linear Noc
cell1 = lteRMCDL('R.7','TDD');
cell1.TDDConfig = 1;
cell1.SSC = 6;
cell1.OCNGPDCCHEnable = 'On';
cell1.OCNGPDSCHEnable = 'On';
cell1.NCellID = 101;
cell2 = cell1;
cell2.NCellID = 313;
searchalg.MaxCellCount = 3;
searchalg.SSSDetection = 'PostFFT';
nTimePeriods = 3;
txRSRPs = -inf(nTimePeriods,2);
rxRSRPs = -inf(nTimePeriods,searchalg.MaxCellCount);
detectedCells = zeros(nTimePeriods,1);
rng('default');
separator = repmat('-',1,44);
% For each time period:
for T = 1:nTimePeriods
fprintf('\n%s\n Time period T%d\n%s\n\n',separator,T,separator);
fprintf(' tx: Cell 1 Cell 2\n');
fprintf(' NCellID: %7d %7d\n',cell1.NCellID,cell2.NCellID);
% Cell 1 transmission.
SINR1 = 10^(SINRdB1(min(T,end))/10); % linear Es/Noc
Es1 = SINR1*Noc; % linear Es per RE
[txcell1,~,info] = lteRMCDLTool(cell1,randi([0 1],1000,1));
txcell1 = txcell1 * sqrt(Es1);
rxwaveform = txcell1;
% Cell 2 transmission.
SINR2 = 10^(SINRdB2(min(T,end))/10); % linear Es/Noc
Es2 = SINR2*Noc; % linear Es per RE
txcell2 = lteRMCDLTool(cell2,randi([0 1],1000,1));
txcell2 = txcell2 * sqrt(Es2);
delta_t = round(info.SamplingRate*3e-6); % Time offset between cells
rxwaveform = rxwaveform + circshift(txcell2,delta_t);
% Display ideal signal to noise/interference ratios based on test
% parameters.
EsToIot1 = 10*log10(Es1) - 10*log10(Es2 + Noc);
EsToNoc1 = 10*log10(Es1) - 10*log10(Noc);
EsToIot2 = 10*log10(Es2) - 10*log10(Es1 + Noc);
EsToNoc2 = 10*log10(Es2) - 10*log10(Noc);
fprintf(' Es/Iot: %7.2fdB %7.2fdB\n',EsToIot1,EsToIot2);
fprintf(' Es/Noc: %7.2fdB %7.2fdB\n',EsToNoc1,EsToNoc2);
% Perform Reference Signal (RS) measurements on the transmitted
% signals.
rxgridcell1 = lteOFDMDemodulate(cell1,txcell1);
rsmeas1 = hRSMeasurements(cell1,rxgridcell1);
txRSRPs(T,1) = rsmeas1.RSRPdBm;
rxgridcell2 = lteOFDMDemodulate(cell2,txcell2);
rsmeas2 = hRSMeasurements(cell2,rxgridcell2);
txRSRPs(T,2) = rsmeas2.RSRPdBm;
fprintf(' RSRP: %7.2fdBm %7.2fdBm\n',txRSRPs(T,1),txRSRPs(T,2));
% Add noise.
No = sqrt(Noc/(2*double(info.Nfft)));
noise = No*complex(randn(size(rxwaveform)),randn(size(rxwaveform)));
rxwaveform = rxwaveform + noise;
% Cell search.
% NDLRB is only required so that lteCellSearch can infer the sampling
% rate of 'rxwavefom'
enb.NDLRB = cell1.NDLRB;
% assumed parameters
enb.DuplexMode = cell1.DuplexMode;
enb.CyclicPrefix = cell1.CyclicPrefix;
% perform cell search
[cellIDs,offsets] = lteCellSearch(enb,rxwaveform,searchalg);
% Compute RSRPs for each detected cell.
% The TDD uplink-downlink configuration and special subframe
% configuration are assumed to be known. The assumption of CellRefP=1
% here means that the RS measurements will only be calculated for
% cell-specific reference signal port 0. NSubframe is set to zero
% because the timing offsets returned by lteCellSearch are relative to
% the start of a frame.
enb.TDDConfig = cell1.TDDConfig;
enb.SSC = cell1.SSC;
enb.CellRefP = 1;
enb.NSubframe = 0;
nDetected = length(cellIDs);
for n = 1:nDetected
enb.NCellID = cellIDs(n);
rxgrid = lteOFDMDemodulate(enb,rxwaveform(1+offsets(n):end,:));
rsmeas = hRSMeasurements(enb,rxgrid);
rxRSRPs(T,n) = rsmeas.RSRPdBm;
end
[~,idx] = sort(rxRSRPs(T,1:nDetected),'descend');
fprintf('\n rx:\n');
for n = 1:nDetected
fprintf(' NCellID: %3d RSRP: %7.2fdBm\n',cellIDs(idx(n)),rxRSRPs(T,idx(n)));
end
% Select the cell with the highest RSRP.
enb.NCellID = cellIDs(idx(1));
detectedCells(T) = find(enb.NCellID==[cell1.NCellID cell2.NCellID]);
fprintf('\n Selected: Cell %d (NCellID=%d)\n',detectedCells(T),enb.NCellID);
end

サインインしてコメントする。

その他の回答 (1 件)

chockalingam t
chockalingam t 2021 年 7 月 10 日

0 投票

This is my code can you check & correct any error .please
SINRdB1 = [ 16 13 16]; % Es/Noc for Cell 1
SINRdB2 = [-Inf 16 13]; % Es/Noc for Cell 2
edit('hRSMeasurements.m');
NocdBm = -98; % dBm/15kHz average power spectral density
NocdBW = NocdBm-30; % Noc in dBW/15kHz
Noc = 10^(NocdBW/10); % linear Noc
cell1 = lteRMCDL('R.7','TDD');
cell1.TDDConfig = 1;
cell1.SSC = 6;
cell1.OCNGPDCCHEnable = 'On';
cell1.OCNGPDSCHEnable = 'On';
cell1.NCellID = 101;
cell2 = cell1;
cell2.NCellID = 313;
searchalg.MaxCellCount = 3;
searchalg.SSSDetection = 'PostFFT';
nTimePeriods = 3;
txRSRPs = -inf(nTimePeriods,2);
rxRSRPs = -inf(nTimePeriods,searchalg.MaxCellCount);
detectedCells = zeros(nTimePeriods,1);
rng('default');
separator = repmat('-',1,44);
% For each time period:
for T = 1:nTimePeriods
fprintf('\n%s\n Time period T%d\n%s\n\n',separator,T,separator);
fprintf(' tx: Cell 1 Cell 2\n');
fprintf(' NCellID: %7d %7d\n',cell1.NCellID,cell2.NCellID);
% Cell 1 transmission.
SINR1 = 10^(SINRdB1(min(T,end))/10); % linear Es/Noc
Es1 = SINR1*Noc; % linear Es per RE
[txcell1,~,info] = lteRMCDLTool(cell1,randi([0 1],1000,1));
txcell1 = txcell1 * sqrt(Es1);
rxwaveform = txcell1;
% Cell 2 transmission.
SINR2 = 10^(SINRdB2(min(T,end))/10); % linear Es/Noc
Es2 = SINR2*Noc; % linear Es per RE
txcell2 = lteRMCDLTool(cell2,randi([0 1],1000,1));
txcell2 = txcell2 * sqrt(Es2);
delta_t = round(info.SamplingRate*3e-6); % Time offset between cells
rxwaveform = rxwaveform + circshift(txcell2,delta_t);
% Display ideal signal to noise/interference ratios based on test
% parameters.
EsToIot1 = 10*log10(Es1) - 10*log10(Es2 + Noc);
EsToNoc1 = 10*log10(Es1) - 10*log10(Noc);
EsToIot2 = 10*log10(Es2) - 10*log10(Es1 + Noc);
EsToNoc2 = 10*log10(Es2) - 10*log10(Noc);
fprintf(' Es/Iot: %7.2fdB %7.2fdB\n',EsToIot1,EsToIot2);
fprintf(' Es/Noc: %7.2fdB %7.2fdB\n',EsToNoc1,EsToNoc2);
% Perform Reference Signal (RS) measurements on the transmitted
% signals.
rxgridcell1 = lteOFDMDemodulate(cell1,txcell1);
rsmeas1 = hRSMeasurements(cell1,rxgridcell1);
txRSRPs(T,1) = rsmeas1.RSRPdBm;
rxgridcell2 = lteOFDMDemodulate(cell2,txcell2);
rsmeas2 = hRSMeasurements(cell2,rxgridcell2);
txRSRPs(T,2) = rsmeas2.RSRPdBm;
fprintf(' RSRP: %7.2fdBm %7.2fdBm\n',txRSRPs(T,1),txRSRPs(T,2));
% Add noise.
No = sqrt(Noc/(2*double(info.Nfft)));
noise = No*complex(randn(size(rxwaveform)),randn(size(rxwaveform)));
rxwaveform = rxwaveform + noise;
% Cell search.
% NDLRB is only required so that lteCellSearch can infer the sampling
% rate of 'rxwavefom'
enb.NDLRB = cell1.NDLRB;
% assumed parameters
enb.DuplexMode = cell1.DuplexMode;
enb.CyclicPrefix = cell1.CyclicPrefix;
% perform cell search
[cellIDs,offsets] = lteCellSearch(enb,rxwaveform,searchalg);
% Compute RSRPs for each detected cell.
% The TDD uplink-downlink configuration and special subframe
% configuration are assumed to be known. The assumption of CellRefP=1
% here means that the RS measurements will only be calculated for
% cell-specific reference signal port 0. NSubframe is set to zero
% because the timing offsets returned by lteCellSearch are relative to
% the start of a frame.
enb.TDDConfig = cell1.TDDConfig;
enb.SSC = cell1.SSC;
enb.CellRefP = 1;
enb.NSubframe = 0;
nDetected = length(cellIDs);
for n = 1:nDetected
enb.NCellID = cellIDs(n);
rxgrid = lteOFDMDemodulate(enb,rxwaveform(1+offsets(n):end,:));
rsmeas = hRSMeasurements(enb,rxgrid);
rxRSRPs(T,n) = rsmeas.RSRPdBm;
end
[~,idx] = sort(rxRSRPs(T,1:nDetected),'descend');
fprintf('\n rx:\n');
for n = 1:nDetected
fprintf(' NCellID: %3d RSRP: %7.2fdBm\n',cellIDs(idx(n)),rxRSRPs(T,idx(n)));
end
% Select the cell with the highest RSRP.
enb.NCellID = cellIDs(idx(1));
detectedCells(T) = find(enb.NCellID==[cell1.NCellID cell2.NCellID]);
fprintf('\n Selected: Cell %d (NCellID=%d)\n',detectedCells(T),enb.NCellID);
end

カテゴリ

ヘルプ センター および File ExchangeTest and Measurement についてさらに検索

製品

リリース

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by