nrPerfectChannelEstimate
Perfect channel estimation
Syntax
Description
performs perfect channel estimation. The function first reconstructs the channel impulse
response from the channel path gains h
= nrPerfectChannelEstimate(carrier
,pathGains
,pathFilters
)pathGains
and the path filter
impulse response pathFilters
. The function then performs orthogonal
frequency division multiplexing (OFDM) demodulation. carrier
specifies
the parameters for the OFDM demodulation.
performs the OFDM demodulation for h
= nrPerfectChannelEstimate(pathGains
,pathFilters
,nrb
,scs
,initialNSlot
)nrb
number of resource blocks with
subcarrier spacing scs
and initial slot number
initialNSlot
.
specifies the sample times of the channel snapshots in addition to the input arguments in
the previous syntax.h
= nrPerfectChannelEstimate(___,toffset
,sampleTimes
)
specifies options by using one or more name-value pair arguments in addition to the input
arguments in any of the previous syntaxes.h
= nrPerfectChannelEstimate(___,Name,Value
)
Examples
Plot Estimated Channel Magnitude Response for TDL-C Channel Model
Define a channel configuration structure using an nrTDLChannel
System object. Use delay profileTDL-C from TR 38.901 Section 7.7.2.
SR = 7.68e6;
tdl = nrTDLChannel;
tdl.DelayProfile = 'TDL-C';
tdl.DelaySpread = 100e-9;
tdl.MaximumDopplerShift = 300;
tdl.SampleRate = SR;
Create a random waveform with a duration of 1 subframe.
T = SR*1e-3; tdlInfo = info(tdl); Nt = tdlInfo.NumTransmitAntennas; in = complex(randn(T,Nt),randn(T,Nt));
Transmit the input waveform through the channel. Obtain the path filters used in channel filtering.
[~,pathGains] = tdl(in); pathFilters = getPathFilters(tdl);
Perform perfect channel estimation using the specified number of blocks, subcarrier spacing, and slot number.
NRB = 25; SCS = 15; nSlot = 0; hest = nrPerfectChannelEstimate(pathGains,pathFilters,NRB,SCS,nSlot); size(hest)
ans = 1×3
300 14 2
Plot the estimated channel magnitude response for the first receive antenna.
figure; surf(abs(hest(:,:,1))); shading('flat'); xlabel('OFDM Symbols'); ylabel('Subcarriers'); zlabel('|H|'); title('Channel Magnitude Response');
Repeat the channel estimate for extended cyclic prefix.
hest = nrPerfectChannelEstimate(pathGains,pathFilters,NRB,SCS, ... nSlot,'extended'); size(hest)
ans = 1×3
300 12 2
Plot the updated results.
figure; surf(abs(hest(:,:,1))); shading('flat'); xlabel('OFDM Symbols'); ylabel('Subcarriers'); zlabel('|H|'); title('Channel Magnitude Response with Extended Cyclic Prefix');
Plot Estimated Channel Magnitude Response for CDL-D Channel Model
Define a channel configuration structure using an nrCDLChannel
System object. Use delay profile CDL-C from TR 38.901 Section 7.7.1.
cdl = nrCDLChannel;
cdl.DelayProfile = 'CDL-D';
cdl.DelaySpread = 30e-9;
cdl.MaximumDopplerShift = 5;
Create a random waveform with a duration of 1 subframe.
SR = 15.36e6; T = SR*1e-3; cdl.SampleRate = SR; cdlInfo = info(cdl); Nt = cdlInfo.NumTransmitAntennas; in = complex(randn(T,Nt),randn(T,Nt));
Transmit the input waveform through the channel. Obtain the path filters used in channel filtering.
[~,pathGains,sampleTimes] = cdl(in); pathFilters = getPathFilters(cdl);
Perform timing offset estimation using the path filter and path gains.
offset = nrPerfectTimingEstimate(pathGains,pathFilters);
Perform perfect channel estimation. Use the specified number of blocks, subcarrier spacing, slot number, timing offset, and sample times.
NRB = 25;
SCS = 15;
nSlot = 0;
hest = nrPerfectChannelEstimate(pathGains,pathFilters,...
NRB,SCS,nSlot,offset,sampleTimes);
size(hest)
ans = 1×4
300 14 2 8
Plot the estimated channel magnitude response for the first receive antenna.
figure; surf(abs(hest(:,:,1))); shading('flat'); xlabel('OFDM Symbols'); ylabel('Subcarriers'); zlabel('|H|'); title('Channel Magnitude Response');
Input Arguments
carrier
— Carrier configuration parameters
nrCarrierConfig
object
Carrier configuration parameters for a specific OFDM numerology, specified as an
nrCarrierConfig
object. Only
these object properties are relevant for this function.
pathGains
— Channel path gains of fading process
NCS-by-NP-by-NT-by-NR complex matrix
Channel path gains of the fading process, specified as an NCS-by-NP-by-NT-by-NR complex matrix, where:
NCS is the number of channel snapshots.
NP is the number of paths.
NT is the number of transmit antennas.
NR is the number of receive antennas.
Data Types: single
| double
Complex Number Support: Yes
pathFilters
— Path filter impulse response
NH-by-NP
real matrix
Path filter impulse response, specified as an NH-by-NP real matrix, where:
NH is the number of impulse response samples.
NP is the number of paths.
Each column of the matrix contains the filter impulse response for each path of the delay profile.
Data Types: double
nrb
— Number of resource blocks
integer from 1 to 275
Number of resource blocks, specified as an integer from 1 to 275.
Data Types: double
scs
— Subcarrier spacing in kHz
15
| 30
| 60
| 120
| 240
| 480
| 960
Subcarrier spacing in kHz, specified as 15
, 30
,
60
, 120
, 240
,
480
, or 960
.
Data Types: double
initialNSlot
— Initial slot number
nonnegative integer
Initial slot number, 0-based, specified as a nonnegative integer. The function
selects the appropriate cyclic prefix length for the OFDM
demodulation
based on the value of initialNSlot
modulo the number of slots per
subframe.
Data Types: double
toffset
— Timing offset in samples
nonnegative integer
Timing offset in samples, specified as a nonnegative integer. The timing offset
indicates the OFDM demodulation starting point on the reconstructed waveform. The offset
accounts for propagation delays, which is essential when obtaining the perfect estimate
of the channel seen by a synchronized receiver. toffset
defaults to
the value nrPerfectTimingEstimate
(pathGains,pathFilters)
when not
specified as an input argument.
Data Types: double
sampleTimes
— Sample times of channel snapshots
NCS-by-1 column vector of nonnegative
real numbers
Sample times of channel snapshots, specified as an
NCS-by-1 column vector of nonnegative real
numbers. sampleTimes
specifies the time of occurrence of each
channel snapshot. The number of channel snapshots,
NCS, is identical to the first dimension of
pathGains
. When not specified, sampleTimes
defaults to an NCS-by-1 vector of times
starting at zero with sampling rate used for the OFDM modulation of the number of
resource blocks nrb
and subcarrier spacing
scs
. Ensure that the channel snapshots span at least one slot. The
function performs channel estimation for each complete slot.
Data Types: double
cpl
— 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, the extended cyclic prefix length only applies to 60 kHz subcarrier spacing.
Note
If you specify the
carrier
input, use theCyclicPrefix
property of thecarrier
input to specify the cyclic prefix length. You cannot use thecpl
input together with thecarrier
input.If you specify the cyclic prefix length with the
'CyclicPrefix'
name-value pair argument, you cannot use thecpl
input.
Data Types: char
| string
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: 'CyclicPrefixFraction',0.75
specifies the start location for
demodulation relative to the cyclic prefix length.
CyclicPrefix
— Cyclic prefix length
'normal'
(default) | 'extended'
Cyclic prefix length, specified as the comma-separated pair consisting of
'CyclicPrefix'
and 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 theCyclicPrefix
property of thecarrier
input to specify the cyclic prefix length. You cannot use this name-value pair argument together with thecarrier
input.If you specify the cyclic prefix length with the
cpl
input, you cannot use this name-value pair argument.
Data Types: char
| string
Nfft
— Number of FFT points
integer greater than 127 (default depends on other input values) | []
Number of fast Fourier transform (FFT) points, specified as the comma-separated pair
consisting of 'Nfft'
and a nonnegative integer greater than 127 or
[]
. The value you specify must result in integer-valued cyclic
prefix lengths and a maximum occupancy of 100%. The occupancy is defined as the value of (12 ×
NRB)/Nfft
, where NRB is the number of
resource blocks.
If you do not specify this input, or if you specify 'Nfft',[]
, the
function sets an integer value greater than 127 as a default value for this input. The
actual default value depends on other input values.
If you do not specify the
SampleRate
input, or if you specify'SampleRate',[]
, the function setsNfft
satisfying these conditions.Nfft
is an integer power of 2.Nfft
results in a maximum occupancy of 85%.
If you specify the
SampleRate
input, the function setsNfft
satisfying these conditions.
For more information, see Configure OFDM Sample Rate and FFT Size.
Data Types: double
SampleRate
— Waveform sample rate
positive scalar (default depends on other input values) | []
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.
For more information, see Configure OFDM Sample Rate and FFT Size.
Data Types: double
CyclicPrefixFraction
— FFT window position within cyclic prefix
0.5
(default) | scalar in the interval [0, 1]
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
h
— Perfect channel estimate
NSC-by-NSYM-by-NR-by-NT
complex array
Perfect channel estimate, returned as an NSC-by-NSYM-by-NR-by-NT complex array, where:
NSC is the number of subcarriers.
NSYM is the number of OFDM symbols.
NR is the number of receive antennas.
NT is the number of transmit antennas.
h
inherits its data type from
pathGains
.
Data Types: double
| single
References
[1] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
The
'SampleRate'
name-value argument must be compile-time constant for code generation. For example, when you call the function with'SampleRate',15.36e6
, include{coder.Constant('SampleRate'),coder.Constant(15.36e6)}
in the-args
value of thecodegen
function. For more information, see thecoder.Constant
(MATLAB Coder) class.If you specify the
'SampleRate'
name-value argument, thenrb
,scs
input arguments and the'Nfft'
name-value argument must also be compile-time constants. For example, include also{coder.Constant(nrb)}
and{coder.Constant(scs)}
in the-args
value of thecodegen
function.The
'SampleRate'
name-value pair argument cannot be used together with thecarrier
input.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™. (since R2024b)
The nrPerfectChannelEstimate
function
fully supports GPU arrays. To run the function on a GPU, specify the input data as a gpuArray
(Parallel Computing Toolbox). For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version History
Introduced in R2018bR2024b: GPU array support
The nrPerfectChannelEstimate
function adds support for GPU arrays. For more
information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
R2023a: Subcarrier spacing for FR2-2
The function now supports 480 kHz and 960 kHz subcarrier spacings, as defined in TS 38.211 Sections 4.2 and 4.3.
R2023a: C/C++ code generation updates
For C/C++ code generation, the limitation to specify
'CyclicPrefix'
, 'CyclicPrefixFraction'
, or
'Nfft'
name-value arguments as compile-time constants has been
removed. However, if you specify the 'SampleRate'
name-value argument,
the 'Nfft'
name-value argument must still be compile-time constant for
code generation.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)