comnum.NrPdsch#
- class comnum.NrPdsch(n_rb_grid, prb_start, n_prb, qm, *, first_symbol=2, n_symbols=12, dmrs_type_a_position=2, dmrs_additional_position=0, n_ports=1, prg_size=2, rnti=1, n_id=0, dmrs_n_id=0, slot=0, subcarrier_spacing_hz=15000.0)#
One slot of a single-layer PDSCH (TS 38.211 Sec. 7.3.1): scrambling, modulation, resource mapping around the DM-RS of port 1000 (configuration type 1, one CDM group without data), a precoder per PRG, and a receiver that estimates the precoded channel on the DM-RS by robust 2-D Wiener filtering.
- Parameters:
n_rb_grid (int) – the resource blocks of the carrier.
prb_start (int) – the first PRB of the allocation.
n_prb (int) – the PRBs of the allocation.
qm (int) – the bits per symbol.
first_symbol (int) – the first PDSCH symbol.
n_symbols (int) – the PDSCH symbols.
dmrs_type_a_position (int) – 2 or 3.
dmrs_additional_position (int) – 0 to 3.
n_ports (int) – the transmit ports, 1 or 2.
prg_size (int) – the PRBs per precoding group.
rnti (int) – the RNTI of the scrambling.
n_id (int) – the scrambling identity.
dmrs_n_id (int) – the DM-RS scrambling identity.
slot (int) – the slot in the frame (the DM-RS sequence).
subcarrier_spacing_hz (float) – the subcarrier spacing.
- Raises:
ValueError – for an invalid configuration (when used).
Examples
>>> import comnum >>> p = comnum.NrPdsch(52, 23, 6, 2, dmrs_additional_position=1) >>> p.g(), p.n_prgs (1584, 4)
- data_res(reserved=None)#
The data REs of the slot in their mapping order (frequency first).
- Parameters:
reserved (array_like | None) – REs
(symbol, subcarrier)not used for data.- Returns:
(n, 2)pairs(symbol, subcarrier).- Return type:
- Raises:
ValueError – for an invalid configuration.
- g(reserved=None)#
The channel bits
Gof the slot.- Parameters:
reserved (array_like | None) – REs
(symbol, subcarrier)not used for data.- Returns:
G.- Return type:
- Raises:
ValueError – for an invalid configuration.
- receive(rx, noise_var, *, max_delay_s=4.69e-06, max_doppler_hz=100.0, reserved=None)#
The descrambled LLRs of a received slot.
- Parameters:
rx (array_like) –
(n_rx, 14, 12 n_rb_grid)received resource elements.noise_var (float) – the noise variance per RE and antenna.
max_delay_s (float) – the largest delay the estimator expects.
max_doppler_hz (float) – the largest Doppler shift it expects.
reserved (array_like | None) – REs
(symbol, subcarrier)without data.
- Returns:
the
gLLRs (positive for a 0).- Return type:
- Raises:
ValueError – for grids of another size or a non-positive noise variance.
- transmit(bits, precoders=None, reserved=None)#
The grids of the slot carrying the
gchannel bits.- Parameters:
bits (array_like) – the channel bits (
NrTransportBlock.encode).precoders (array_like | None) – the precoder index of every PRG (0 to 3), zeros by default.
reserved (array_like | None) – REs
(symbol, subcarrier)left empty.
- Returns:
(n_ports, 14, 12 n_rb_grid)resource elements.- Return type:
- Raises:
ValueError – for bits of another length or one precoder per PRG missing.