pub struct NrLdpc { /* private fields */ }Expand description
The LDPC code of 5G NR for one code block (see the module).
Implementations§
Source§impl NrLdpc
impl NrLdpc
Sourcepub fn new(k_info: usize, e: usize) -> Result<NrLdpc>
pub fn new(k_info: usize, e: usize) -> Result<NrLdpc>
The code of k_info information bits rate-matched to e bits, redundancy
version 0, without bit interleaving.
§Errors
Sourcepub fn with_options(
k_info: usize,
e: usize,
base_graph_override: Option<u8>,
rv: u8,
qm: usize,
) -> Result<NrLdpc>
pub fn with_options( k_info: usize, e: usize, base_graph_override: Option<u8>, rv: u8, qm: usize, ) -> Result<NrLdpc>
The code of k_info information bits rate-matched to e bits, the base graph
chosen as in Sec. 7.2.2 or forced by base_graph, the redundancy version rv
and the bit interleaver of qm bits per symbol (1: none).
§Errors
comnum_core::Error::Config for a block larger than one code block (8448 bits for
base graph 1, 3840 for base graph 2), e not a multiple of qm, an rv above
3, or a base graph other than 1 or 2.
Sourcepub fn base_graph(&self) -> u8
pub fn base_graph(&self) -> u8
The base graph, 1 or 2.
Sourcepub fn lifting_size(&self) -> usize
pub fn lifting_size(&self) -> usize
The lifting size $Z_{c}$.
Sourcepub fn decoder_mut(&mut self) -> &mut LdpcDecoder
pub fn decoder_mut(&mut self) -> &mut LdpcDecoder
The settings of the decoder, which can change without changing the code.
Sourcepub fn combine(&self, llr: &[f64], buffer: &mut [f64]) -> Result<()>
pub fn combine(&self, llr: &[f64], buffer: &mut [f64]) -> Result<()>
Add the e LLRs of one transmission to the soft buffer buffer of the full
codeword (code().n() values, zeros before the first transmission): the soft
combining of the transmissions of a HARQ process (chase combining of the same
redundancy version, incremental redundancy of the others), every redundancy
version of the same $K’$, $E$ and base graph sharing the buffer.
§Errors
comnum_core::Error::Shape unless llr has $E$ values and buffer code().n().
Sourcepub fn decode_buffer(&self, buffer: &[f64]) -> Result<Vec<u8>>
pub fn decode_buffer(&self, buffer: &[f64]) -> Result<Vec<u8>>
Decode the soft buffer of NrLdpc::combine: the $K’$ information bits.
§Errors
comnum_core::Error::Shape unless buffer has code().n() values.
Trait Implementations§
Source§impl BlockCode for NrLdpc
impl BlockCode for NrLdpc
Source§fn encode_block(&self, info: &[u8]) -> Result<Vec<u8>>
fn encode_block(&self, info: &[u8]) -> Result<Vec<u8>>
Source§fn decode_block(&self, llr: &[f64]) -> Result<Vec<u8>>
fn decode_block(&self, llr: &[f64]) -> Result<Vec<u8>>
Source§fn encode_block_into(&self, info: &[u8], out: &mut [u8]) -> Result<()>
fn encode_block_into(&self, info: &[u8], out: &mut [u8]) -> Result<()>
out (ADR 0011: the default
copies BlockCode::encode_block; a code overrides it when a profile shows the
copy). Read moreSource§fn decode_block_into(&self, llr: &[f64], out: &mut [u8]) -> Result<()>
fn decode_block_into(&self, llr: &[f64], out: &mut [u8]) -> Result<()>
out (as
BlockCode::encode_block_into). Read more