@@ -64,20 +64,8 @@ char quantize(double D,double x,unsigned char B)
return((char)qxd);
}
//#define MAX_BLOCK_LENGTH 6000
#define MAX_BLOCK_LENGTH 8448
/*
int test_ldpc(unsigned int coded_bits,
double sigma,
unsigned char qbits,
unsigned int block_length,
unsigned int ntrials,
unsigned int *errors,
unsigned int *trials,
unsigned int *uerrors,
unsigned int *crc_misses,
unsigned int *iterations)
*/
int test_ldpc(short No_iteration,
double rate,
double SNR,
...
...
@@ -88,43 +76,40 @@ int test_ldpc(short No_iteration,
unsigned int *crc_misses)
{
//unsigned char test_input[block_length+1];
//clock initiate
time_stats_t time;
opp_enabled=1;
cpu_freq_GHz = get_cpu_freq_GHz();
short test_input[block_length];
short *c; //padded codeword
short *esimated_output;
short *esimated_output;
short *channel_input;
double *channel_output;
double *channel_output;
double *modulated_input;
short *channel_output_fixed;
short *channel_output_fixed;
unsigned int i,trial=0;
unsigned char crc_type;
short *Gen_shift_values, *no_shift_values, *pointer_shift_values;
short BG,Zc,Kb,nrows,ncols;
int i1,i2,i3,i4,t;
int i1,i2,i3,i4,i5,i6,t,temp,k;
//Table of possible lifting sizes
short lift_size[51]={2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
*errors=0;
*crc_misses=0;
while (trial++ < ntrials) {
// printf("encoding\n");
// test_input[0] = 0x80;
// generate input block
for (i=0; i<block_length; i++) {
//test_input[i] = (unsigned char)(taus()&0xff);
test_input[i]=rand()%2;
//test_input[i]=i%2;
}
start_meas(&time);
//determine number of bits in codeword
if (block_length>3840)
...
...
@@ -167,8 +152,10 @@ for (i=0; i<block_length; i++) {