matlab 生成lte信号,【求助】LTE PRS基带信号到射频信号如何做?具体代码如下

rng('default'); % Initialize the random number generator stream

NeNodeB = 5;    % Number of eNodeB

% Create eNodeB configurations

enb = cell(1,NeNodeB);

for i=1:NeNodeB

enb{i}=lteRMCDL('R.5');            % Get configuration based on RMC,选R7正好合适。

enb{i}.NCellID = mod((i-1)*2,504); % Set arbitrary cell identity

enb{i}.TotSubframes = 1;           % Number of subframes to generate

enb{i}.NPRSRB = 2;                 % Bandwidth of PRS in resource blocks

enb{i}.IPRS = 0;                   % PRS configuration index

enb{i}.PRSPeriod = 'On';           % PRS present in all subframes

enb{i}.Position = hPositioningPosition(i-1, NeNodeB); % eNodeB position

end

% Use the first eNodeB configuration for general settings

info = lteOFDMInfo(enb{1});

% Plot Location of eNodeBs and UE

% The positions of the eNodeBs and the UE are plotted for reference. The UE lies at

% (0,0) and the eNodeBs are distributed around the UE.

hPositioningPlotPositions(enb);

% Generate Transmissions

% For each eNodeB, a transmission is made consisting of the PRS, Primary Synchronisation Signal (PSS),

% Secondary Synchronisation Signal (SSS) and Cell-specific Reference Signal (Cell RS).

% An empty resource grid is created and a PRS is generated and mapped onto the grid using ltePRS

% and ltePRSIndices. The PSS, SSS and Cell RS are added in a similar fashion. The resultant grid is

% OFDM modulated to produce a transmit waveform.

tx = cell(1,NeNodeB);

for i = 1:NeNodeB

grid = [];

for nsf = 0:19

enb{i}.NSubframe = mod(nsf,10);

sfgrid = lteDLResourceGrid(enb{i});       % Empty subframe

sfgrid(ltePRSIndices(enb{i})) = ltePRS(enb{i});       % PRS REs

sfgrid(ltePSSIndices(enb{i})) = ltePSS(enb{i});       % PSS REs

sfgrid(lteSSSIndices(enb{i})) = lteSSS(enb{i});       % SSS REs

sfgrid(lteCellRSIndices(enb{i})) = lteCellRS(enb{i}); % Cell RS REs

grid = [grid sfgrid]; %#ok

end

enb{i}.NSubframe = 0;

tx{i} = lteOFDMModulate(enb{i}, grid);        % OFDM modulate

end

% Compute delays from eNodeBs to UEs

% Using the known eNodeB positions, the time delay from each eNodeB to the UE is calculated

% using the distance between the UE and eNodeB, radius, and the speed of propagation (speed of light).

% Using knowledge of the sampling rate, info.SamplingRate, the sample delay is calculated and stored in sampleDelay.

% These variables will be used to model the environment between the eNodeBs and the UE but the information will NOT be

% provided to the UE.

speedOfLight = 299792458.0; % Speed of light in m/s

sampleDelay = zeros(1, NeNodeB);

radius = cell(1, NeNodeB);

for i = 1:NeNodeB

[~, radius{i}] = cart2pol(enb{i}.Position(1), enb{i}.Position(2));

delay = radius{i}/speedOfLight;                  % Delay in seconds

sampleDelay(i) = round(delay*info.SamplingRate); % Delay in samples

end

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值