Main Content

nrOFDMDemodulate

Demodulate OFDM waveform

Description

example

grid = nrOFDMDemodulate(carrier,waveform) recovers a carrier resource array by demodulating waveform, an OFDM modulated waveform, for carrier configuration parameters carrier.

grid = nrOFDMDemodulate(waveform,nrb,scs,initNSlot) demodulates waveform for nrb, the specified number of resource blocks, subcarrier spacing scs, and initial slot number initNSlot.

example

grid = nrOFDMDemodulate(waveform,nrb,scs,initNSlot,'CyclicPrefix',cpl) specifies cyclic prefix length cpl in addition to the input arguments from the previous syntax.

example

grid = nrOFDMDemodulate(___,Name,Value) specifies options by using one or more name-value pair arguments in addition to any combination of input arguments from the previous syntaxes.

Examples

collapse all

Recover a transmitted carrier resource array by demodulating an OFDM waveform.

Set carrier configuration parameters, specifying 106 resource blocks (RBs) in the carrier resource array.

carrier = nrCarrierConfig('NSizeGrid',106);

Generate physical downlink shared channel (PDSCH) demodulation reference signal (DM-RS) symbols and indices.

p = 2;
pdsch = nrPDSCHConfig('NumLayers',p);
sym = nrPDSCHDMRS(carrier,pdsch);
ind = nrPDSCHDMRSIndices(carrier,pdsch);

Create a carrier resource array containing the PDSCH DM-RS symbols.

txGrid = nrResourceGrid(carrier,p);
txGrid(ind) = sym;

Generate OFDM modulated waveform.

[txWaveform,~] = nrOFDMModulate(carrier,txGrid);

Pass the waveform through a simple 2-by-1 channel.

H = [0.6; 0.4];
waveform = txWaveform*H;

Recover the carrier resource array by demodulating the received OFDM waveform.

grid = nrOFDMDemodulate(carrier,waveform);

Recover a resource array that contains PDSCH DM-RS symbols by demodulating an OFDM waveform.

Set carrier configuration parameters, specifying a subcarrier spacing of 60 kHz.

scs = 60;
carrier = nrCarrierConfig('SubcarrierSpacing',scs);

Generate PDSCH DM-RS symbols and indices.

p = 2;
pdsch = nrPDSCHConfig('NumLayers',p);
sym = nrPDSCHDMRS(carrier,pdsch);
ind = nrPDSCHDMRSIndices(carrier,pdsch);

Create a carrier resource array containing the PDSCH DM-RS symbols.

txGrid = nrResourceGrid(carrier,p);
txGrid(ind) = sym;

Generate an OFDM modulated waveform, specifying the subcarrier spacing, initial slot number, and cyclic prefix length.

initNSlot = carrier.NSlot;
cpl = 'extended';
[txWaveform,info] = nrOFDMModulate(txGrid,scs,initNSlot,'CyclicPrefix',cpl);

Pass the waveform through a simple 2-by-1 channel.

H = [0.9; 0.95];
waveform = txWaveform*H;

Recover the carrier resource array by demodulating the received OFDM waveform.

nrb = carrier.NSizeGrid;
grid = nrOFDMDemodulate(waveform,nrb,scs,initNSlot,'CyclicPrefix',cpl);

Recover a transmitted resource array that contains sounding reference signals (SRSs) and spans an entire frame by demodulating an OFDM waveform.

Set carrier configuration parameters, specifying a subcarrier spacing of 30 kHz and 24 resource blocks in the carrier resource array.

carrier = nrCarrierConfig('SubcarrierSpacing',30,'NSizeGrid',24);

Configure SRS parameters, setting the slot periodicity and offset.

srs = nrSRSConfig('SRSPeriod',[4 0]);

Get OFDM information for the specified carrier configuration.

info = nrOFDMInfo(carrier);

Produce the frame resource array by creating and concatenating slot resource arrays.

frameGrid = [];
for nslot = 0:(info.SlotsPerFrame - 1)
    carrier.NSlot = nslot;
    slotGrid = nrResourceGrid(carrier);
    ind = nrSRSIndices(carrier,srs);
    sym = nrSRS(carrier,srs);
    slotGrid(ind) = sym;
    frameGrid = [frameGrid slotGrid];
end

Generate the OFDM modulated waveform.

[txWaveform,~] = nrOFDMModulate(carrier,frameGrid);

Pass the waveform through a simple channel.

H = 0.86;
waveform = txWaveform*H;

Recover the carrier resource array by demodulating the received OFDM waveform, specifying the sample rate.

sr = info.SampleRate;
grid = nrOFDMDemodulate(carrier,waveform,'SampleRate',sr);

Input Arguments

collapse all

Carrier configuration parameters for a specific OFDM numerology, specified as an nrCarrierConfig object. The function uses only these properties of this input.

Number 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

Subcarrier spacing in kHz, for all channels and reference signals of the carrier, specified as 15, 30, 60, 120, or 240.

Data Types: double

Slot number, specified as a nonnegative integer. You can set NSlot 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 may have to ensure that the property value is modulo the number of slots per frame in a calling code.

Data Types: double

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

OFDM modulated waveform, specified as a complex-valued matrix of size T-by-R.

  • T is the number of time-domain samples in the waveform.

  • R is the number of receive antennas.

Data Types: double
Complex Number Support: Yes

Number of resource blocks, specified as an integer from 1 to 275.

Data Types: double

Subcarrier spacing, in kHz, specified as 15, 30, 60, 120, or 240.

Data Types: double

Initial slot number, in zero-based form, specified as a nonnegative integer. The function selects the appropriate cyclic prefix lengths for OFDM demodulation by using the value of initNSlot mod S, where S is the number of slots per subframe.

Data Types: double

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, the extended cyclic prefix length only applies to 60 kHz subcarrier spacing.

Data Types: char | string

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'CyclicPrefixFraction',0.75 specifies the start location for demodulation relative to the cyclic prefix length.

Number of fast Fourier transform (FFT) points, specified as the comma-separated pair consisting of 'Nfft' and either a nonnegative integer greater than 127, or []. The value you specify must result in integer-valued cyclic prefix lengths and a maximum occupancy, defined as the value of (12 × NRB)/Nfft, where NRB is the number of resource blocks, of 100%.

If you do not specify this input, or if you specify 'Nfft',[], the function sets a default value satisfying these conditions.

  • The value of this input is an integer power of 2.

  • The maximum occupancy is 85%.

  • The minimum value of this input is 128.

Data Types: double

Waveform sample rate, specified as the comma-separated pair consisting of 'SampleRate' and either a positive scalar or [].

If you do not specify this input, or if you specify 'SampleRate',[], then the function sets this input to the value of Nfft × SCS.

  • Nfft is the value of the 'Nfft' input.

  • SCS is the subcarrier spacing specified in the SubcarrierSpacing property of the config input for the first function syntax, or the scs input for the other syntaxes.

Data Types: double

Number of time-domain samples over which the function applies raised cosine windowing and overlapping of OFDM symbols, specified as the comma-separated pair consisting of 'Windowing' and either a nonnegative integer or [].

If you do not specify this input, or if you specify 'Windowing',[], the function sets this input to the maximum value that does not impact error vector magnitude (EVM) tests, as specified in [1], [2], and [3].

Data Types: double

Carrier frequency, in Hz, specified as the comma-separated pair consisting of 'CarrierFrequency' and a nonnegative scalar. This input corresponds to f0, defined in Section 5.4 of [4].

Data Types: double

Fast Fourier transform (FFT) window position within the cyclic prefix, specified as the comma-separated pair consisting of 'CyclicPrefixFraction' and a scalar in the interval [0, 1].

The value that you specify indicates the start location for OFDM demodulation relative to the beginning of the cyclic prefix.

Data Types: double

Output Arguments

collapse all

Carrier resource array, returned as a complex-valued array of size K-by-L-by-R.

  • K is the number of subcarriers.

  • L is the number of OFDM symbols.

  • R is the number of receive antennas.

Data Types: double
Complex Number Support: Yes

References

[1] 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.

[2] 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.

[3] 3GPP TS 38.104. “NR; Base Station (BS) radio transmission and reception.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[4] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

Extended Capabilities

Introduced in R2020b