1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-08 09:36:02 -05:00
sdrangel/libfreedv/mpdecode_core.h
2019-03-04 23:04:27 +01:00

52 lines
1.3 KiB
C++

/*
FILE...: mpdecode_core.h
AUTHOR.: David Rowe
CREATED: Sep 2016
C-callable core functions for MpDecode, so they can be used for
Octave and C programs. Also some convenience functions to help use
the C-callable LDPC decoder in C programs.
*/
#ifndef __MPDECODE_CORE__
#define __MPDECODE_CORE__
#include <stdint.h>
#include "codec2/comp.h"
namespace FreeDV
{
struct LDPC {
int max_iter;
int dec_type;
int q_scale_factor;
int r_scale_factor;
int CodeLength;
int NumberParityBits;
int NumberRowsHcols;
int max_row_weight;
int max_col_weight;
int data_bits_per_frame;
int coded_bits_per_frame;
int coded_syms_per_frame;
uint16_t *H_rows;
uint16_t *H_cols;
};
void encode(struct LDPC *ldpc, unsigned char ibits[], unsigned char pbits[]);
int run_ldpc_decoder(struct LDPC *ldpc, uint8_t out_char[], float input[], int *parityCheckCount);
void sd_to_llr(float llr[], double sd[], int n);
void Demod2D(float symbol_likelihood[], COMP r[], COMP S_matrix[], float EsNo, float fading[], float mean_amp, int number_symbols);
void Somap(float bit_likelihood[], float symbol_likelihood[], int number_symbols);
void symbols_to_llrs(float llr[], COMP rx_qpsk_symbols[], float rx_amps[], float EsNo, float mean_amp, int nsyms);
void ldpc_print_info(struct LDPC *ldpc);
} // FreeDV
#endif