Skip to main content

NrLdpc

Struct NrLdpc 

Source
pub struct NrLdpc { /* private fields */ }
Expand description

The LDPC code of 5G NR for one code block (see the module).

Implementations§

Source§

impl NrLdpc

Source

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

As NrLdpc::with_options.

Source

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.

Source

pub fn base_graph(&self) -> u8

The base graph, 1 or 2.

Source

pub fn lifting_size(&self) -> usize

The lifting size $Z_{c}$.

Source

pub fn bit_map(&self) -> &[usize]

The bit of the full codeword carried by every output bit.

Source

pub fn code(&self) -> &LdpcCode

The code of the lifted parity-check matrix.

Source

pub fn decoder_mut(&mut self) -> &mut LdpcDecoder

The settings of the decoder, which can change without changing the code.

Source

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().

Source

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

Source§

fn k(&self) -> usize

Information bits per block.
Source§

fn n(&self) -> usize

Coded bits per block.
Source§

fn encode_block(&self, info: &[u8]) -> Result<Vec<u8>>

Encode one block of $k$ bits. Read more
Source§

fn decode_block(&self, llr: &[f64]) -> Result<Vec<u8>>

Decode one block of $n$ LLRs into $k$ bits. Read more
Source§

fn encode_block_into(&self, info: &[u8], out: &mut [u8]) -> Result<()>

Encode one block of $k$ bits into the $n$ values of out (ADR 0011: the default copies BlockCode::encode_block; a code overrides it when a profile shows the copy). Read more
Source§

fn decode_block_into(&self, llr: &[f64], out: &mut [u8]) -> Result<()>

Decode one block of $n$ LLRs into the $k$ values of out (as BlockCode::encode_block_into). Read more
Source§

fn code_rate(&self) -> f64

Code rate $k/n$.
Source§

fn encode_stream(&self, info: &[u8]) -> Result<Vec<u8>>

Encode whole blocks. Read more
Source§

fn decode_stream(&self, llr: &[f64]) -> Result<Vec<u8>>

Decode whole blocks. Read more
Source§

impl Clone for NrLdpc

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NrLdpc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Decode for NrLdpc

Source§

fn decode_into(&mut self, llr: &Llr, out: &mut Bits) -> Result<()>

Decode llr into out. Read more
Source§

fn decode(&mut self, llr: &Llr) -> Result<Bits, Error>

Decode llr (allocates, calls Decode::decode_into). Read more
Source§

impl Encode for NrLdpc

Source§

fn rate(&self) -> f64

Code rate k/n.
Source§

fn encode_into(&self, info: &Bits, out: &mut Bits) -> Result<()>

Encode info into out. Read more
Source§

fn encode(&self, info: &Bits) -> Result<Bits, Error>

Encode info (allocates, calls Encode::encode_into). Read more
Source§

impl SoftDecode for NrLdpc

Source§

fn app_into( &self, llr: &[f64], apriori: Option<&[f64]>, out: &mut [f64], ) -> Result<usize>

The a posteriori LLRs of the $K’$ information bits after the belief propagation of the full codeword (the a priori LLRs added to theirs).

Source§

fn app(&self, llr: &[f64], apriori: Option<&[f64]>) -> Result<Vec<f64>>

SoftDecode::app_into into a new vector. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.