www.pudn.com > LDPCCode.rar > LDPC.h
#ifndef _LDPC_H_ #define _LDPC_H_ #include#include #include #include short Column; short H_row; short G_row; /*Define the LDPC code parameters structure*/ struct LDPCParam { short mat_param[5]; short iterC; short *MatCol; short *MatRow; short *GMatrix; }; struct LDPCParam ldpc_param; void LDPC_init(struct LDPCParam *p_ldpc_param, FILE *fpLDPC); void init_mat_para(short *mat_para, FILE *f_H_data); void array_sort (short *in , short length , short init_min); void gauss_elimate_to_P_I (short *mat_col , short *mat_row , short **t , short *rank , short *mat_para); void Construct_H_Matrix (short *mat_para , short *mat_col , short *mat_row, FILE *f_H_data); void Construct_G_Matrix (short *mat_col , short *mat_row , short **gen , short *mat_para); void LDPC_encode(short *gen, short *input, short *output, short *mat_para); double correct_factor(double x,double y); void BP_decoding(double *llr_in, double *llr_out, short *dec_out, short *mat_col, short *mat_row, short *mat_param, short iterN); #endif