Included error correction on P25 TDULC.

Added a new "heuristics" module for P25 that improves the estimation of the symbol (dibit) that corresponds to a given analog signal value.
Added a BER (bit error reate) estimation for P25.
This commit is contained in:
EdFuentetaja
2014-05-11 02:23:24 +08:00
parent b45e563e54
commit 9d0fe07931
30 changed files with 2976 additions and 828 deletions

View File

@@ -4,22 +4,29 @@
#include "Hamming.hpp"
#include "ReedSolomon.hpp"
// Uncomment for very verbose trace messages
//#define CHECK_LDU_DEBUG
//#define __CHECK_HDU_DEBUG__
// The following methods are just a C bridge for the C++ implementations of the Golay and ReedSolomon
// algorithms.
static Hamming_10_6_3_TableImpl hamming;
static DSDReedSolomon_24_12_13 reed_solomon_24_12_13;
static DSDReedSolomon_24_16_9 reed_solomon_24_16_9;
int check_and_fix_hamming_10_12_13(char* hex, char* parity)
int check_and_fix_hamming_10_6_3(char* hex, char* parity)
{
static Hamming_10_6_3_TableImpl hamming;
return hamming.decode(hex, parity);
}
int check_and_fix_redsolomon_24_12_13(char* data, char* parity)
void encode_hamming_10_6_3(char* hex, char* out_parity)
{
static DSDReedSolomon_24_12_13 reed_solomon_24_12_13;
hamming.encode(hex, out_parity);
}
#ifdef __CHECK_HDU_DEBUG__
int check_and_fix_reedsolomon_24_12_13(char* data, char* parity)
{
#ifdef CHECK_LDU_DEBUG
char original[12][6];
for (int i = 0; i < 12; i++) {
for (int j = 0; j < 6; j++) {
@@ -30,7 +37,7 @@ int check_and_fix_redsolomon_24_12_13(char* data, char* parity)
int irrecoverable_error = reed_solomon_24_12_13.decode(data, parity);
#ifdef __CHECK_HDU_DEBUG__
#ifdef CHECK_LDU_DEBUG
printf("Results for Reed-Solomon code (24,12,13)\n\n");
if (irrecoverable_error == 0) {
printf(" i original fixed\n");
@@ -62,11 +69,14 @@ int check_and_fix_redsolomon_24_12_13(char* data, char* parity)
return irrecoverable_error;
}
int check_and_fix_redsolomon_24_16_9(char* data, char* parity)
void encode_reedsolomon_24_12_13(char* hex_data, char* fixed_parity)
{
static DSDReedSolomon_24_16_9 reed_solomon_24_16_9;
reed_solomon_24_12_13.encode(hex_data, fixed_parity);
}
#ifdef __CHECK_HDU_DEBUG__
int check_and_fix_reedsolomon_24_16_9(char* data, char* parity)
{
#ifdef CHECK_LDU_DEBUG
char original[16][6];
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 6; j++) {
@@ -77,7 +87,7 @@ int check_and_fix_redsolomon_24_16_9(char* data, char* parity)
int irrecoverable_error = reed_solomon_24_16_9.decode(data, parity);
#ifdef __CHECK_HDU_DEBUG__
#ifdef CHECK_LDU_DEBUG
printf("Results for Reed-Solomon code (24,16,9)\n\n");
if (irrecoverable_error == 0) {
printf(" i original fixed\n");
@@ -108,3 +118,8 @@ int check_and_fix_redsolomon_24_16_9(char* data, char* parity)
return irrecoverable_error;
}
void encode_reedsolomon_24_16_9(char* hex_data, char* fixed_parity)
{
reed_solomon_24_16_9.encode(hex_data, fixed_parity);
}