DMR Burst Type FEC Fix;

This commit is contained in:
lwvmobile
2022-10-17 17:16:22 -04:00
parent 0bb9dd760c
commit 4138f92917
6 changed files with 116 additions and 92 deletions

View File

@@ -872,11 +872,14 @@ void Golay_20_8_encode(unsigned char *origBits, unsigned char *encodedBits)
}
}
// golay (20,8) hamming-weight of 6 reliably corrects at most 2 bit-errors
bool Golay_20_8_decode(unsigned char *rxBits)
{
unsigned int syndromeI = 0; // syndrome index
int is = 0;
int i = 0;
//tally corrections made, exceeding 2 will return false
int correction = 0;
for (is = 0; is < 12; is++)
{
@@ -915,6 +918,7 @@ bool Golay_20_8_decode(unsigned char *rxBits)
else
{
rxBits[Golay_20_8_m_corr[syndromeI][i]] ^= 1; // flip bit
correction++;
}
}
@@ -922,6 +926,12 @@ bool Golay_20_8_decode(unsigned char *rxBits)
{
return false;
}
//return false due to exceeding the number of allowed corrected bits
if (correction > 2)
{
return false;
}
}
return true;