pub struct Puncturer { /* private fields */ }
Expand description
Puncturer.
This struct is used to perform puncturing on codewords to be transmitted, and “depuncturing” on demodulated LLRs.
Implementations§
Source§impl Puncturer
impl Puncturer
Sourcepub fn new(pattern: &[bool]) -> Puncturer
pub fn new(pattern: &[bool]) -> Puncturer
Creates a new puncturer.
The puncturing pattern is defined by blocks. For example [true, true, true, false]
means that the first 3/4 of the codeword bits are
preserved, and the last 1/4 is punctured.
§Panics
This function panics if the pattern is empty.
Sourcepub fn puncture<S, A>(
&self,
codeword: &ArrayBase<S, Ix1>,
) -> Result<Array1<A>, Error>
pub fn puncture<S, A>( &self, codeword: &ArrayBase<S, Ix1>, ) -> Result<Array1<A>, Error>
Puncture a codeword.
Given a codeword, returns the punctured codeword. An error is returned if the length of the codeword is not divisible by the length of the puncturing pattern.
Sourcepub fn depuncture<T: Copy + Default>(&self, llrs: &[T]) -> Result<Vec<T>, Error>
pub fn depuncture<T: Copy + Default>(&self, llrs: &[T]) -> Result<Vec<T>, Error>
Depuncture LLRs.
This function depunctures demodulated LLRs by inserting zeros (which
indicate erasures) in the positions of the codeword that were
punctured. The input length must correspond to the punctured codeword,
while the output length is equal to the codeword length. An error is
returned if the length of input is not divisible by the number of true
elements in the pattern.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Puncturer
impl RefUnwindSafe for Puncturer
impl Send for Puncturer
impl Sync for Puncturer
impl Unpin for Puncturer
impl UnwindSafe for Puncturer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more