main content

5g nr prach waveform generation -凯发k8网页登录

this example implements a 5g nr prach waveform generator using 5g toolbox™. the example shows how to parameterize and generate a 5g new radio (nr) physical random access channel (prach) waveform, as defined in ts 38.211 [ 1 ]. the example demonstrates the parameterization and generation of one prach configuration in a single carrier, and displays the positions of the prach preambles in the resource grid. you can define the length of the waveform, in terms of subframes, and set the pattern of the active prach preambles in the generated waveform.

waveform and carrier configuration

configure one carrier and set the length of the generated waveform in terms of 1 ms subframes. visualize the generated resource grid by setting the displaygrids field to 1.

use the waveconfig structure to store configuration parameters needed for the prach waveform generation. the waveconfig structure contains these fields:

  • numsubframes: number of 1 ms subframes in generated waveform.

  • displaygrids: if set to 1, the example displays the resource grid.

  • windowing: number of time-domain samples over which to apply windowing and overlapping of ofdm symbols. for more information, see .

  • carriers: carrier-specific configuration object, as described in .

  • prach: structure containing the prach-related configuration, as described in detail in the prach configuration section.

waveconfig = [];
waveconfig.numsubframes = 10; % number of 1 ms subframes in generated waveform
waveconfig.displaygrids = 1;  % display the resource grid
waveconfig.windowing = [];    % use the default windowing
% define a carrier configuration object
carrier = nrcarrierconfig;
carrier.subcarrierspacing = 15;
carrier.nsizegrid = 52;
% store the carrier into the waveconfig structure
waveconfig.carriers = carrier;

prach configuration

set the parameters for the prach, taking into account that the numerology of the prach can be different from that of the carrier. this example sets the prach configuration corresponding to a prach short preamble format b2 with 15 khz subcarrier spacing.

you can also set additional prach parameters. for more information, see .

add the field prach to the waveconfig structure to store the prach configuration and related parameters. the field prach is a structure containing these fields:

  • config: prach configuration object

  • allocatedpreambles: index (0-based) of the allocated prach preambles to transmit. this field considers only the active prach preambles. set this value to 'all' to include all the active prach preambles in the waveform.

  • power: prach power scaling in db. this parameter represents $\beta_{prach}$ (in db) in ts 38.211 section 6.3.3.2.

% prach configuration
prach = nrprachconfig;
prach.frequencyrange = 'fr1';   % frequency range ('fr1', 'fr2')
prach.duplexmode = 'fdd';       % duplex mode ('fdd', 'tdd', 'sul')
prach.configurationindex = 145; % configuration index (0...255)
prach.subcarrierspacing = 15;   % subcarrier spacing (1.25, 5, 15, 30, 60, 120)
prach.frequencyindex = 0;       % index of the prach transmission occasions in frequency domain (0...7)
prach.timeindex = 2;            % index of the prach transmission occasions in time domain (0...6)
prach.activeprachslot = 0;      % active prach slot number within a subframe or a 60 khz slot (0, 1)
% store the prach configuration and additional parameters in the
% waveconfig structure
waveconfig.prach.config = prach;
waveconfig.prach.allocatedpreambles = 'all'; % index of the allocated prach preambles
waveconfig.prach.power = 0;                  % prach power scaling in db

waveform generation

generate the prach complex baseband waveform by using the parameters stored in the waveconfig structure.

[waveform,gridset,winfo] = hnrprachwaveformgenerator(waveconfig);

when waveconfig.displaygrids is set to 1, the waveform generator also plots the prach resource grid, in prach numerology. for more information on the number of ofdm symbols in the resource grid, see 5g nr prach configuration.

the waveform generator function returns the time domain waveform, and two structures: gridset and winfo.

the structure winfo contains these fields:

  • nprachslot: prach slot numbers of each allocated prach preamble

  • prachsymbols: prach symbols corresponding to each allocated prach slot

  • prachsymbolsinfo: additional information associated with prach symbols

  • prachindices: prach indices corresponding to each allocated prach slot

  • prachindicesinfo: additional information associated with prach indices

the structure gridset contains these fields:

  • resourcegrid: resource grid corresponding to this carrier

  • info: structure with information corresponding to the prach ofdm modulation. if the prach is configured for fr2 or the prach slot for the current configuration spans more than one subframe, some of the ofdm-related information may be different between prach slots. in this case, the info structure is an array of the same length as the number of prach slots in the waveform.

if ~isempty(gridset.info)
    disp('information associated with prach ofdm modulation for the first prach slot:')
    disp(gridset.info(1))
end
information associated with prach ofdm modulation for the first prach slot:
                   nfft: 1024
             samplerate: 15360000
    cyclicprefixlengths: [188 0 0 0 188 0 0 0 180 0 0 0 0 0]
           guardlengths: [0 0 0 108 0 0 0 108 0 0 0 108 0 144]
          symbollengths: [1212 1024 1024 1132 1212 1024 1024 1132 1204 ... ]
           offsetlength: 0
              windowing: 72

summary and further exploration

this example shows how to generate a time-domain waveform for a single prach configuration on a single carrier. you can set the length of the generated waveform in terms of number of subframes. you can also set the pattern of prach preambles in the generated waveform. the example also shows the ofdm-related information for the prach.

to generate a waveform containing multiple prach configurations in the same carrier, run this example for several prach configurations and add the generated waveforms together.

for more information about the prach configuration and the prach resource grid, see 5g nr prach configuration.

selected bibliography

  1. 3gpp ts 38.211. "nr; physical channels and modulation." 3rd generation partnership project; technical specification group radio access network.

see also

functions

  • | |

objects

related topics

网站地图