nrChannelEstimate
Practical channel estimation
Syntax
Description
[
performs practical channel estimation on the received resource grid
h
,nVar
,info
] = nrChannelEstimate(rxGrid
,refInd
,refSym
)rxGrid
by using a reference resource grid containing reference
symbols refSym
at locations refInd
. The function
returns the channel estimate h
, noise variance estimate
nVar
, and additional information info
.
[
specifies carrier configuration parameters for a specific orthogonal frequency-division
multiplexing (OFDM) numerology, in addition to the input arguments from any of the previous
syntaxes. The function uses only the h
,nVar
,info
] = nrChannelEstimate(carrier
,___)CyclicPrefix
property of the
carrier
input.
[
specifies options by using one or more name-value arguments in addition to the input
arguments in any of the previous syntaxes.h
,nVar
,info
] = nrChannelEstimate(___,Name=Value
)
Examples
Generate physical broadcast channel (PBCH) demodulation reference signal (DM-RS) symbols for physical layer cell identity number 42. The time-dependent part of the DM-RS scrambling initialization is 0.
ncellid = 42; ibar_SSB = 0; dmrsSym = nrPBCHDMRS(ncellid,ibar_SSB);
Obtain resource element indices for the PBCH DM-RS.
dmrsInd = nrPBCHDMRSIndices(ncellid);
Create a resource grid containing the generated DM-RS symbols.
nrb = 20; scs = 15; carrier = nrCarrierConfig('NSizeGrid',nrb,'SubcarrierSpacing',scs); nTxAnts = 1; txGrid = nrResourceGrid(carrier,nTxAnts); txGrid(dmrsInd) = dmrsSym;
Modulate the resource grid using the specified FFT length and cyclic prefix length.
ofdmInfo = nrOFDMInfo(carrier); txWaveform = nrOFDMModulate(carrier,txGrid);
Create a TDL-C channel model with the specified properties.
channel = nrTDLChannel;
channel.NumReceiveAntennas = 1;
channel.SampleRate = ofdmInfo.SampleRate;
channel.DelayProfile = 'TDL-C';
channel.DelaySpread = 100e-9;
channel.MaximumDopplerShift = 20;
Get the maximum channel delay.
chInfo = info(channel); maxChDelay = chInfo.MaximumChannelDelay;
To flush delayed samples from the channel, append zeros at the end of the transmitted waveform corresponding to the maximum number of delayed samples and the number of transmit antennas. Transmit the padded waveform through the TDL-C channel model.
[rxWaveform,pathGains] = channel([txWaveform; zeros(maxChDelay,nTxAnts)]);
Estimate timing offset for the transmission using the DM-RS symbols as reference symbols. The OFDM modulation of the reference symbols uses an initial slot number of 0.
initialSlot = 0; offset = nrTimingEstimate(carrier,rxWaveform,txGrid);
Synchronize the received waveform according to the estimated timing offset.
rxWaveform = rxWaveform(1+offset:end,:);
Create a received resource grid containing the demodulated and synchronized received waveform.
cpFraction = 0.55;
rxGrid = nrOFDMDemodulate(carrier,rxWaveform,'CyclicPrefixFraction',cpFraction);
Obtain the practical channel estimate.
H = nrChannelEstimate(rxGrid,dmrsInd,dmrsSym);
Obtain the perfect channel estimate.
pathFilters = getPathFilters(channel); H_ideal = nrPerfectChannelEstimate(carrier,pathGains,pathFilters,offset);
Compare practical and perfect channel estimates.
figure; subplot(1,2,1); imagesc(abs(H)); xlabel('OFDM Symbol'); ylabel('Subcarrier'); title('Practical Estimate Magnitude'); subplot(1,2,2); imagesc(abs(H_ideal)); xlabel('OFDM Symbol'); ylabel('Subcarrier'); title('Perfect Estimate Magnitude');
Input Arguments
Received resource grid, specified as a K-by-L-by-R complex array.
K is the number of subcarriers equal to NRB × 12, where NRB is the number of resource blocks in the range from 1 to 275.
L is the number of OFDM symbols in a slot or in a reference grid.
When you call
nrChannelEstimate
with reference symbolsrefSym
, L is 12 for extended cyclic prefix and 14 for normal cyclic prefix. Set the cyclic prefix length by using the'
name-value pair argument.CyclicPrefix
'When you call
nrChannelEstimate
with reference resource gridrefGrid
, L must equal N, the number of OFDM symbols in the reference grid.
R is the number of receive antennas.
Data Types: single
| double
Complex Number Support: Yes
Reference symbol indices, specified as an integer matrix. The number of rows equals
the number of resource elements. You can specify all indices in a single column or
spread them across several columns. The number of elements in
refInd
and refSym
must be the same but their
dimensionality can differ. The function reshapes refInd
and
refSym
into column vectors before mapping them into a reference
grid: refGrid(refInd(:)) = refSym(:)
.
The elements of refInd
are 1-based linear indices addressing a
K-by-L-by-P resource array.
K is the number of subcarriers equal to NRB × 12, where NRB is the number of resource blocks in the range from 1 to 275. K must be equal to the first dimension of
rxGrid
.L is the number of OFDM symbols in a slot. L is 12 for extended cyclic prefix and 14 for normal cyclic prefix. Set the cyclic prefix length by using the
'
name-value pair argument.CyclicPrefix
'P is the number of reference signal ports, inferred from the range of values in
refInd
.
Data Types: double
Reference symbols, specified as a complex matrix. The number of rows equals the number of
resource elements. You can specify all symbols in a single column or distribute them
across several columns. The number of elements in refInd
and
refSym
must be the same but their dimensionality can differ.
The function reshapes refInd
and refSym
into
column vectors before mapping them into a reference grid: refGrid(refInd(:)) =
refSym(:)
.
Data Types: single
| double
Complex Number Support: Yes
Predefined reference grid, specified as a
K-by-N-by-P complex array.
refGrid
can span multiple slots.
K is the number of subcarriers equal to NRB × 12, where NRB is the number of resource blocks in the range from 1 to 275.
N is the number of OFDM symbols in the reference grid.
P is the number of reference signal ports.
Data Types: single
| double
Complex Number Support: Yes
Carrier configuration parameters for a specific OFDM numerology, specified as an
nrCarrierConfig
object. The
function uses only the CyclicPrefix
property of this input.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'CyclicPrefix','extended'
specifies extended cyclic prefix
length.
Cyclic prefix length, specified as one of these values:
'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.
Note
If you specify the carrier
input, use the
CyclicPrefix
property of the carrier
input to specify the cyclic prefix length. You cannot use this name-value pair
argument together with the carrier
input.
Data Types: char
| string
Code domain multiplexing (CDM) arrangement for reference signals, specified as a 1-by-2 array of nonnegative integers [FD TD]. Array elements FD and TD specify the length of CDM despreading in the frequency domain (FD-CDM) and time domain (TD-CDM), respectively. A value of 1 for an element specifies no CDM.
Example: CDMLengths=[2 1]
specifies FD-CDM2 and no TD-CDM.
Example: CDMLengths=[1 1]
specifies no orthogonal
despreading.
Data Types: double
Preinterpolation averaging window, specified as a 1-by-2 array of nonnegative odd
integers [F
T]. Array elements F and T
specify the number of adjacent reference symbols in the frequency domain and time
domain, respectively, over which the function performs averaging before interpolation.
If F or T is zero, the function determines the
averaging value from the estimated signal-to-noise ratio (SNR) based on the noise
variance estimate nVar
.
Data Types: double
Since R2025a
Interpolation, specified as one of these values:
'on'
— By default, the function interpolates the averaged consecutive estimates across frequency, then interpolates the averaged consecutive estimates across time and frequency.'off'
— The function returns the channel estimates only for the reference symbol locations that are specified by therefInd
orrefGrid
inputs for each receive antenna across all ports. The function returns zero for all other grid locations.
Data Types: string
| char
Output Arguments
Practical channel estimate, returned as a
K-by-L-by-R-by-P
complex array. K-by-L-by-R is
the shape of the received resource grid rxGrid
.
P is the number of reference signal ports.
h
inherits its data type from
rxGrid
.
Data Types: double
| single
Noise variance estimate, returned as a nonnegative scalar or an
NPRG-by-1 column vector of nonnegative
numbers (when PRGBundleSize
is nonempty) (since R2025a).
NPRG is the number of the transmitted PRGs
based on the PRGBundleSize
input.
nVar
is the measured variance of additive white Gaussian noise
on the received reference symbols.
Data Types: double
Additional information, returned as a structure with the field
AveragingWindow
.
Parameter Field | Value | Description |
---|---|---|
AveragingWindow | 1-by-2 array, NPRG-by-2 array (since R2025a) | Preinterpolation averaging window, returned as a 1-by-2 array or
an
NPRG-by-2 array (when
The array rows are of the form [F T], where F and T indicate the number of adjacent reference symbols in the frequency domain and time domain, respectively, over which the function performed averaging before interpolation. |
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
The nrChannelEstimate
function
supports GPU array input with these usage notes and limitations:
This function accepts and returns GPU arrays but does not run on a GPU.
For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version History
Introduced in R2019bThe nrChannelEstimate
function enables you to:
Turn off interpolation by setting the
Interpolation
name-value input argument to'off'
. When you turn off interpolation, the function returns the channel estimates only for the reference symbol locations that are specified by therefInd
orrefGrid
inputs for each receive antenna across all ports. The function returns zero for all other grid locations.Enable subband channel estimation by setting the
PRGBundleSize
name-value input argument to a nonempty value. In this case, the function returns thenVar
andinfo
outputs in terms of the number of the transmitted PRGs.
The nrChannelEstimate
function adds support for GPU arrays. For more
information, see GPU Arrays.
For C/C++ code generation, the limitation to specify name-value arguments as compile-time constants has been removed.
See Also
Functions
Objects
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)