Generate PRACH OFDM modulated waveform
[
generates waveform,info] = nrPRACHOFDMModulate(carrier,prach,grid)waveform, a physical random access channel (PRACH)
time-domain waveform, by performing orthogonal frequency-division multiplexing (OFDM)
modulation of PRACH carrier resource array grid for carrier
configuration parameters carrier and PRACH configuration parameters
prach. The function also returns info, a
structure containing OFDM information.
Generate a PRACH waveform by performing OFDM modulation of a resource array that contains PRACH symbols.
Specify carrier configuration parameters.
carrier = nrCarrierConfig;
Configure PRACH for format A1.
prach = nrPRACHConfig('ConfigurationIndex',106,'SubcarrierSpacing',15);
Generate PRACH symbols and map to a PRACH slot resource grid.
sym = nrPRACH(carrier,prach); ind = nrPRACHIndices(carrier,prach); grid = nrPRACHGrid(carrier,prach); grid(ind) = sym;
Generate the PRACH OFDM waveform by modulating the grid. Display PRACH OFDM information.
[waveform,info] = nrPRACHOFDMModulate(carrier,prach,grid); disp(info)
Nfft: 1024
SampleRate: 15360000
CyclicPrefixLengths: [152 0 144 0 144 0 152 0 144 0 144 0 0 0]
GuardLengths: [0 0 0 0 0 0 0 0 0 0 0 0 0 144]
SymbolLengths: [1x14 double]
OffsetLength: 0
Windowing: 72
Generate a PRACH OFDM modulated waveform by modulating a carrier containing PRACH symbols, specifying the number of samples over which the modulator applies windowing and overlapping of OFDM symbols.
Specify carrier configuration parameters, specifying a subcarrier spacing of 60 kHz.
carrier = nrCarrierConfig('SubcarrierSpacing',60);Configure and generate PRACH symbols and map to a PRACH slot resource grid.
prach = nrPRACHConfig('FrequencyRange','FR2','SubcarrierSpacing',60,'DuplexMode','TDD'); sym = nrPRACH(carrier,prach); ind = nrPRACHIndices(carrier,prach); grid = nrPRACHGrid(carrier,prach); grid(ind) = sym;
Generate the PRACH OFDM waveform by modulating the grid, specifying the number of time domain samples over which the PRACH OFDM modulator applies windowing and overlapping of OFDM symbols.
samples = 80;
[waveform,info] = nrPRACHOFDMModulate(carrier,prach,grid,'Windowing',samples);carrier — Carrier configuration parametersnrCarrierConfig objectCarrier configuration parameters for a specific OFDM numerology, specified as an
nrCarrierConfig object. Only
these object properties are relevant for this function.
NSizeGrid — Number of RBs in carrier resource grid52 (default) | integer from 1 to 275Number of RBs in the carrier resource grid, specified as an integer from 1 to 275. The default
value of 52 corresponds to the maximum number of RBs of a 10 MHz
carrier with 15 kHz SCS.
Data Types: double
SubcarrierSpacing — Subcarrier spacing in kHz15 (default) | 30 | 60 | 120 | 240Subcarrier spacing in kHz, for all channels and reference signals of the carrier, specified as 15, 30, 60, 120, or 240.
Data Types: double
CyclicPrefix — Cyclic prefix length'normal' (default) | 'extended'Cyclic prefix length, specified as one of these options.
'normal' — Use this value to specify normal cyclic
prefix. This option corresponds to 14 OFDM symbols in a slot.
'extended' — Use this value to specify extended cyclic
prefix. This option corresponds to 12 OFDM symbols in a slot. For the
numerologies specified in TS 38.211 Section 4.2, extended cyclic prefix
length applies for only 60 kHz subcarrier spacing.
Data Types: char | string
prach — PRACH configuration parametersnrPRACHConfig objectPRACH configuration parameters, specified as an nrPRACHConfig object. The
function uses only these properties of this input.
FrequencyRange — Frequency range'FR1' (default) | 'FR2' Frequency range, specified as 'FR1' or 'FR2'.
Use this property together with the DuplexMode property to specify these PRACH configuration tables from TS 38.211.
To specify Table 6.3.3.2-2, set FrequencyRange to 'FR1' and DuplexMode to 'FDD' or 'SUL'.
To specify Table 6.3.3.2-3, set FrequencyRange to 'FR1' and DuplexMode to 'TDD'.
To specify Table 6.3.3.2-4, set FrequencyRange to 'FR2' and DuplexMode to 'TDD'.
Data Types: char | string
DuplexMode — Duplex mode for uplink transmission'FDD' (default) | 'TDD' | 'SUL'Duplex mode for uplink transmission, specified as one of these values:
'FDD' — Use this value to specify frequency division duplex (FDD) mode for paired spectrum.
'TDD' — Use this value to specify time division duplex (TDD) mode for unpaired spectrum.
'SUL' — Use this value to specify supplementary uplink.
Use this property together with the FrequencyRange property to specify these PRACH configuration tables from TS 38.211:
To specify Table 6.3.3.2-2, set FrequencyRange to 'FR1' and DuplexMode to 'FDD' or 'SUL'.
To specify Table 6.3.3.2-3, set FrequencyRange to 'FR1' and DuplexMode to 'TDD'.
To specify Table 6.3.3.2-4, set FrequencyRange to 'FR2' and DuplexMode to 'TDD'.
Data Types: char | string
ConfigurationIndex — Time resource of PRACH preamble27 (default) | integer from 0 to 255Time resource of PRACH preamble, specified as an integer from 0 to 255. This property specifies a configuration index from Tables 6.3.3.2-2 to 6.3.3.2-4 in TS 38.211. Properties FrequencyRange and DuplexMode determine the actual configuration table to consider.
This property is the higher layer parameter prach-ConfigurationIndex.
Data Types: double
SubcarrierSpacing — Subcarrier spacing for PRACH in kHz1.25 (default) | 5 | 15 | 30 | 60 | 120Subcarrier spacing for the PRACH in kHz, specified as 1.25, 5, 15, or 30 for frequency range FR1 and 60 or 120 for frequency range FR2.
Set this property in relation to the preamble format property Format. To identify valid preamble format and subcarrier spacing combinations, see the LongPreambleFormats and ShortPreambleFormats fields of the Tables property. For more information, see Table 6.3.3.1-1 for long preambles and Table 6.3.3.1-2 for short preambles.
Data Types: double
NPRACHSlot — PRACH slot number0 (default) | nonnegative integerPRACH slot number, specified as a nonnegative integer. You can set NPRACHSlot to a value larger than the number of slots per frame. For example, you can set this value using transmission loop counters in a MATLAB® simulation. In this case, you might have to ensure that the property value is modulo the number of slots per frame in a calling code.
Data Types: double
grid — PRACH resource gridPRACH resource grid, specified as a K-by-L-by-P complex array.
K is the number of subcarriers equal to
(carrier.SubcarrierSpacing /
prach.SubcarrierSpacing) ×
carrier.NSizeGrid × 12
L is the number of OFDM symbols and depends on the PRACH preamble format.
For long formats, L =
prach.PRACHDuration.
For short format C0, L = 7.
For all other short formats, L = 14.
For more information on PRACH preamble formats, see TS 38.211 Tables 6.3.3.1-1 and 6.3.3.1-2 [1].
P is the number of transmit antennas.
Data Types: double
Complex Number Support: Yes
samples — Number of time-domain samples for OFDM symbol windowing and overlapping[]Number of time-domain samples over which the function applies raised cosine windowing and overlapping of OFDM symbols, specified as a nonnegative integer or [].
If you do not specify this input, or if you specify it as [], the function sets this input to the maximum value E that does not impact error vector magnitude (EVM) tests, as specified in TS 38.101-1 Annex F.5.5 and TS 38.101-2 Annex F.5.5. E is equal to value of floor((NCP − W) × info.Nfft ⁄ NFFT, nominal), where NCP, W, and NFFT, nominal are the values in the table columns labeled "Cyclic prefix length", "EVM window length", and "FFT size", respectively.
Data Types: double
waveform — PRACH OFDM modulated waveformPRACH OFDM modulated waveform, returned as a complex-valued matrix of size T-by-P.
Data Types: double
Complex Number Support: Yes
info — OFDM informationOFDM information, returned as a structure containing these fields.
| Fields | Values | Description |
|---|---|---|
Nfft | Positive integer | Number of FFT points |
SampleRate | Positive integer | Waveform sample rate |
CyclicPrefixLengths | 1-by-N vector of nonnegative integers, where N is the number of OFDM symbols in a PRACH slot | Cyclic prefix lengths of each OFDM symbol, in samples |
GuardLengths | 1-by-N vector of positive integers, where N is the number of OFDM symbols in a PRACH slot | Guard lengths of OFDM symbols, in samples |
SymbolLengths | 1-by-N vector of nonnegative integers, where N is the number of OFDM symbols in a PRACH slot | OFDM symbol lengths, in samples |
OffsetLength | Nonnegative integer | Length, in samples, of the initial time offset between the start of the configured PRACH slot period to the start of the cyclic prefix |
Windowing | Nonnegative integer | Number of time-domain samples over which the function applies raised cosine windowing and overlapping of OFDM symbols |
For long formats, for which the LRA property of the
prach input is 839, the first slot of a
PRACH preamble can occur part of the way through the nominal PRACH slot period. In this
case, the function increases the value of the OffsetLength field,
which ensures that the OFDM waveform spans the entire active PRACH preamble. To balance
these slots with the nominal PRACH slot period, some inactive PRACH slots have OFDM
waveforms that are shorter than the nominal PRACH slot period. The function conveys this
by returning the CyclicPrefixLengths and
GuardLengths fields as [], corresponding to
no OFDM symbols, and setting the OffsetLength field equal to the
number of empty subframes required.
Data Types: struct
[1] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
[2] 3GPP TS 38.101-1. “NR; User Equipment (UE) radio transmission and reception; Part 1: Range 1 Standalone.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
[3] 3GPP TS 38.101-2. “NR; User Equipment (UE) radio transmission and reception; Part 2: Range 2 Standalone.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
Usage notes and limitations:
The
samples input argument must be compile-time constant. Include
{coder.Constant('Windowing'),coder.Constant(samples)} in the
-args value of the codegen function. For more
information, see the coder.Constant (MATLAB Coder) class.
You have a modified version of this example. Do you want to open this example with your edits?