Struct ldpc_toolbox::simulation::ber::BerTest
source · pub struct BerTest { /* private fields */ }Expand description
BER test.
This struct is used to configure and run a BER test.
Implementations§
source§impl BerTest
impl BerTest
sourcepub fn new(
h: SparseMatrix,
decoder_implementation: DecoderImplementation,
puncturing_pattern: Option<&[bool]>,
max_frame_errors: u64,
max_iterations: usize,
ebn0s_db: &[f32],
reporter: Option<Reporter>
) -> Result<BerTest, Error>
pub fn new( h: SparseMatrix, decoder_implementation: DecoderImplementation, puncturing_pattern: Option<&[bool]>, max_frame_errors: u64, max_iterations: usize, ebn0s_db: &[f32], reporter: Option<Reporter> ) -> Result<BerTest, Error>
Creates a new BER test.
The parameters required to define the test are the parity check matrix
h, an optional puncturing pattern (which uses the semantics of
Puncturer), the maximum number of frame errors at which to stop the
simulation for each Eb/N0, the maximum number of iterations of the LDPC
decoder, a list of Eb/N0’s in dB units, and an optional Reporter to
send messages about the test progress.
This function only defines the BER test. To run it it is necessary to
call the BerTest::run method.
sourcepub fn run(self) -> Result<Vec<Statistics>, Box<dyn Error>>
pub fn run(self) -> Result<Vec<Statistics>, Box<dyn Error>>
Runs the BER test.
This function runs the BER test until completion. It returns a list of statistics for each Eb/N0, or an error.
sourcepub fn n(&self) -> usize
pub fn n(&self) -> usize
Returns the frame size of the code.
This corresponds to the frame size after puncturing.