template<typename TS, int NSTATES, typename TUS, int NUS, int NCS>
struct leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >
Definition at line 44 of file viterbi.h.
template<typename TS, int NSTATES, typename TUS, int NUS, int NCS>
Definition at line 57 of file viterbi.h.
References leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::state::branches, leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::state::branch::pred, and leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::states.
59 for (TS s = 0; s < NSTATES; ++s)
60 for (
int cs = 0; cs < NCS; ++cs)
struct leansdr::trellis::state states[NSTATES]
template<typename TS, int NSTATES, typename TUS, int NUS, int NCS>
Definition at line 102 of file viterbi.h.
References leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::state::branches, leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::state::branch::pred, leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::states, and leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::state::branch::us.
104 for (
int s = 0; s < NSTATES; ++s)
106 fprintf(stderr,
"State %02x:", s);
107 for (
int cs = 0; cs < NCS; ++cs)
111 fprintf(stderr,
" - ");
113 fprintf(stderr,
" %02x+%x", b->pred, b->us);
115 fprintf(stderr,
"\n");
struct leansdr::trellis::state::branch branches[NCS]
struct leansdr::trellis::state states[NSTATES]
template<typename TS, int NSTATES, typename TUS, int NUS, int NCS>
Definition at line 65 of file viterbi.h.
References leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::state::branches, leansdr::log2i(), leansdr::parity(), leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::state::branch::pred, leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::states, and leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::state::branch::us.
Referenced by leansdr::viterbi_sync::viterbi_sync().
69 fprintf(stderr,
"NCS must be a power of 2\n");
74 for (TS s = 0; s < NSTATES; ++s)
76 for (TUS us = 0; us < NUS; ++us)
82 for (
int b = 1; b < NUS; b *= 2)
84 us_rev |= (NUS / 2 / b);
85 shiftreg |= us_rev * NSTATES;
87 for (
int g = 0; g < nG; ++g)
88 cs = (cs << 1) |
parity(shiftreg & G[g]);
94 fprintf(stderr,
"Invalid convolutional code\n");
struct leansdr::trellis::state::branch branches[NCS]
struct leansdr::trellis::state states[NSTATES]
unsigned char parity(uint8_t x)
unsigned __int64 uint64_t