diff --git a/basic_parameters.c b/basic_parameters.c --- a/basic_parameters.c +++ b/basic_parameters.c @@ -6,52 +6,48 @@ // version 1.4: 16/05/2014 // version 1.5: 20/05/2014 // version 1.6: 19/12/2014 +// version 1.7: 15/01/2015 (modifs de Paul + correction erreurs qui se compensaient (LSB <=> MSB + indices [0,2] <=> [1,3]) + #include - #include "basic_parameters_params.h" -void init_k_coefficients( float *k_coefficients_f0, \ - float *k_coefficients_f1, \ - float *k_coefficients_f2 ) +void init_k_coefficients(float *k_coefficients, + unsigned char nb_binscompressed_matrix ) { - uint16_t i; // 16 bits unsigned - - for(i=0; i MSB + indices [0,2] <=> [1,3]) #ifndef BASIC_PARAMETERS_H_INCLUDED #define BASIC_PARAMETERS_H_INCLUDED @@ -19,7 +20,7 @@ static inline void BP1_set(float * compressed_spec_mat, float * k_coeff_intercalib, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp1); static inline void BP2_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp2); -void init_k_coefficients( float *k_coefficients_f0, float *k_coefficients_f1, float *k_coefficients_f2 ); +void init_k_coefficients( float *k_coefficients_f0, unsigned char nb_binscompressed_matrix ); //*********************************** // STATIC INLINE FUNCTION DEFINITIONS @@ -109,13 +110,13 @@ void BP1_set( float * compressed_spec_ma // left place of the significand bits (nbitsig), // making the 16-bit word to be recorded pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16 -#ifdef LSB_FIRST_TCH - lfr_bp1[i*NB_BYTES_BP1+2] = pt_uint8[0]; // Record LSB of tmp_uint16 - lfr_bp1[i*NB_BYTES_BP1+3] = pt_uint8[1]; // Record MSB of tmp_uint16 +#ifdef MSB_FIRST_TCH + lfr_bp1[i*NB_BYTES_BP1+2] = pt_uint8[0]; // Record MSB of tmp_uint16 + lfr_bp1[i*NB_BYTES_BP1+3] = pt_uint8[1]; // Record LSB of tmp_uint16 #endif -#ifdef MSB_FIRST_TCH - lfr_bp1[i*NB_BYTES_BP1+2] = pt_uint8[1]; // Record LSB of tmp_uint16 - lfr_bp1[i*NB_BYTES_BP1+3] = pt_uint8[0]; // Record MSB of tmp_uint16 +#ifdef LSB_FIRST_TCH + lfr_bp1[i*NB_BYTES_BP1+2] = pt_uint8[1]; // Record MSB of tmp_uint16 + lfr_bp1[i*NB_BYTES_BP1+3] = pt_uint8[0]; // Record LSB of tmp_uint16 #endif #ifdef DEBUG_TCH printf("\nBin number: %d\n", i); @@ -162,13 +163,13 @@ void BP1_set( float * compressed_spec_ma // left place of the significand bits (nbitsig), // making the 16-bit word to be recorded pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16 -#ifdef LSB_FIRST_TCH - lfr_bp1[i*NB_BYTES_BP1+0] = pt_uint8[0]; // Record LSB of tmp_uint16 - lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[1]; // Record MSB of tmp_uint16 +#ifdef MSB_FIRST_TCH + lfr_bp1[i*NB_BYTES_BP1+0] = pt_uint8[0]; // Record MSB of tmp_uint16 + lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[1]; // Record LSB of tmp_uint16 #endif -#ifdef MSB_FIRST_TCH - lfr_bp1[i*NB_BYTES_BP1+0] = pt_uint8[1]; // Record LSB of tmp_uint16 - lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[0]; // Record MSB of tmp_uint16 +#ifdef LSB_FIRST_TCH + lfr_bp1[i*NB_BYTES_BP1+0] = pt_uint8[1]; // Record MSB of tmp_uint16 + lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[0]; // Record LSB of tmp_uint16 #endif #ifdef DEBUG_TCH printf("Bin number: %d\n", i); @@ -202,7 +203,7 @@ void BP1_set( float * compressed_spec_ma // Record it at the 8th bit position (from the right to the left) of lfr_bp1[i*NB_BYTES_BP1+6] #endif #ifdef MSB_FIRST_TCH - lfr_bp1[i*NB_BYTES_BP1+6] = pt_uint8[0] & 0x80; // Extract the sign bit of NVEC_V2 (32-bit float, sign bit in the 0th octet:SPARC convention) + lfr_bp1[i*NB_BYTES_BP1+6] = pt_uint8[0] & 0x80; // Extract the sign bit of NVEC_V2 (32-bit float, sign bit in the 1th octet:SPARC convention) // Record it at the 8th bit position (from the right to the left) of lfr_bp1[i*NB_BYTES_BP1+6] #endif #ifdef DEBUG_TCH @@ -285,15 +286,15 @@ void BP1_set( float * compressed_spec_ma #endif pt_uint8 = (uint8_t*) &e_cross_b_re; // Affect an uint8_t pointer with the adress of e_cross_b_re #ifdef LSB_FIRST_TCH - lfr_bp1[i*NB_BYTES_BP1+1] = lfr_bp1[i*NB_BYTES_BP1+1] | (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention) + lfr_bp1[i*NB_BYTES_BP1+0] = lfr_bp1[i*NB_BYTES_BP1+0] | (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention) // Record it at the 8th bit position (from the right to the left) - // of lfr_bp1[i*NB_BYTES_BP1+1] + // of lfr_bp1[i*NB_BYTES_BP1+0] pt_uint8[3] = (pt_uint8[3] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX| #endif #ifdef MSB_FIRST_TCH - lfr_bp1[i*NB_BYTES_BP1+1] = lfr_bp1[i*NB_BYTES_BP1+1] | (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 0th octet:SPARC convention) + lfr_bp1[i*NB_BYTES_BP1+0] = lfr_bp1[i*NB_BYTES_BP1+0] | (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 1th octet:SPARC convention) // Record it at the 8th bit position (from the right to the left) - // of lfr_bp1[i*NB_BYTES_BP1+1] + // of lfr_bp1[i*NB_BYTES_BP1+0] pt_uint8[0] = (pt_uint8[0] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX| #endif significand = frexpf(e_cross_b_re/2, &exponent); // 0.5 <= significand < 1 @@ -329,24 +330,24 @@ void BP1_set( float * compressed_spec_ma // with lfr_bp1[i*NB_BYTES_BP1+7] #ifdef DEBUG_TCH printf("lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX exponent + significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+7]); - printf("lfr_bp1[i*NB_BYTES_BP1+1] for ReaSX sign + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+1]); + printf("lfr_bp1[i*NB_BYTES_BP1+0] for ReaSX sign + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+0]); printf("ImaSX / 2 : %16.8e\n",e_cross_b_im/2); #endif pt_uint8 = (uint8_t*) &e_cross_b_im; // Affect an uint8_t pointer with the adress of e_cross_b_im #ifdef LSB_FIRST_TCH - pt_uint8[3] = pt_uint8[3] & 0x7f; // Make e_cross_b_im be positive in any case: |ImaSX| + pt_uint8[3] = pt_uint8[3] & 0x7f; // Make e_cross_b_im be positive in any case: |ImaSX| (32-bit float, sign bit in the 4th octet:PC convention) #endif #ifdef MSB_FIRST_TCH - pt_uint8[0] = pt_uint8[0] & 0x7f; // Make e_cross_b_im be positive in any case: |ImaSX| + pt_uint8[0] = pt_uint8[0] & 0x7f; // Make e_cross_b_im be positive in any case: |ImaSX| (32-bit float, sign bit in the 1th octet:SPARC convention) #endif tmp_uint8 = (e_cross_b_im > e_cross_b_re) ? 0x40 : 0x00; // Determine the sector argument of SX. If |Im| > |Re| affect // an unsigned 8-bit char with 01000000; otherwise with null. - lfr_bp1[i*NB_BYTES_BP1+1] = lfr_bp1[i*NB_BYTES_BP1+1] | tmp_uint8; // Record it as a sign bit at the 7th bit position (from the right - // to the left) of lfr_bp1[i*NB_BYTES_BP1+1], by simple logical addition. + lfr_bp1[i*NB_BYTES_BP1+0] = lfr_bp1[i*NB_BYTES_BP1+0] | tmp_uint8; // Record it as a sign bit at the 7th bit position (from the right + // to the left) of lfr_bp1[i*NB_BYTES_BP1+0], by simple logical addition. #ifdef DEBUG_TCH printf("|ImaSX| / 2 : %16.8e\n",e_cross_b_im/2); printf("ArgSX sign : %u\n",tmp_uint8); - printf("lfr_bp1[i*NB_BYTES_BP1+1] for ReaSX & ArgSX signs + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+1]); + printf("lfr_bp1[i*NB_BYTES_BP1+0] for ReaSX & ArgSX signs + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+0]); #endif //====================================================================== // BP1 phase velocity estimator == PA_LFR_SC_BP1_VPHI_F0 == 8 (+ 2) bits @@ -399,15 +400,15 @@ void BP1_set( float * compressed_spec_ma // vphi = n_cross_e_scal_b_re / bx_bx_star => sign(VPHI) = sign(n_cross_e_scal_b_re) pt_uint8 = (uint8_t*) &n_cross_e_scal_b_re; // Affect an uint8_t pointer with the adress of n_cross_e_scal_b_re #ifdef LSB_FIRST_TCH - lfr_bp1[i*NB_BYTES_BP1+3] = lfr_bp1[i*NB_BYTES_BP1+3] | (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention) + lfr_bp1[i*NB_BYTES_BP1+2] = lfr_bp1[i*NB_BYTES_BP1+2] | (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention) // Record it at the 8th bit position (from the right to the left) - // of lfr_bp1[i*NB_BYTES_BP1+3] + // of lfr_bp1[i*NB_BYTES_BP1+2] pt_uint8[3] = (pt_uint8[3] & 0x7f); // Make n_cross_e_scal_b_re be positive in any case: |n_cross_e_scal_b_re| #endif #ifdef MSB_FIRST_TCH - lfr_bp1[i*NB_BYTES_BP1+3] = lfr_bp1[i*NB_BYTES_BP1+3] | (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 0th octet:SPARC convention) + lfr_bp1[i*NB_BYTES_BP1+2] = lfr_bp1[i*NB_BYTES_BP1+2] | (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 1th octet:SPARC convention) // Record it at the 8th bit position (from the right to the left) - // of lfr_bp1[i*NB_BYTES_BP1+3] + // of lfr_bp1[i*NB_BYTES_BP1+2] pt_uint8[0] = (pt_uint8[0] & 0x7f); // Make n_cross_e_scal_b_re be positive in any case: |n_cross_e_scal_b_re| #endif vphi = n_cross_e_scal_b_re / bx_bx_star; // Compute |VPHI| @@ -446,24 +447,24 @@ void BP1_set( float * compressed_spec_ma // with lfr_bp1[i*NB_BYTES_BP1+8] #ifdef DEBUG_TCH printf("lfr_bp1[i*NB_BYTES_BP1+8] for VPHI exponent + significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+8]); - printf("lfr_bp1[i*NB_BYTES_BP1+3] for VPHI sign + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+3]); + printf("lfr_bp1[i*NB_BYTES_BP1+2] for VPHI sign + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+2]); #endif pt_uint8 = (uint8_t*) &n_cross_e_scal_b_im; // Affect an uint8_t pointer with the adress of n_cross_e_scal_b_im #ifdef LSB_FIRST_TCH - pt_uint8[3] = pt_uint8[3] & 0x7f; // Make n_cross_e_scal_b_im be positive in any case: |ImaSX| + pt_uint8[3] = pt_uint8[3] & 0x7f; // Make n_cross_e_scal_b_im be positive in any case: |ImaSX| (32-bit float, sign bit in the 4th octet:PC convention) #endif #ifdef MSB_FIRST_TCH - pt_uint8[0] = pt_uint8[0] & 0x7f; // Make n_cross_e_scal_b_im be positive in any case: |ImaSX| + pt_uint8[0] = pt_uint8[0] & 0x7f; // Make n_cross_e_scal_b_im be positive in any case: |ImaSX| (32-bit float, sign bit in the 1th octet:SPARC convention) #endif tmp_uint8 = (n_cross_e_scal_b_im > n_cross_e_scal_b_re) ? 0x40 : 0x00; // Determine the sector argument of SX. If |Im| > |Re| affect // an unsigned 8-bit char with 01000000; otherwise with null. - lfr_bp1[i*NB_BYTES_BP1+3] = lfr_bp1[i*NB_BYTES_BP1+3] | tmp_uint8; // Record it as a sign bit at the 7th bit position (from the right + lfr_bp1[i*NB_BYTES_BP1+2] = lfr_bp1[i*NB_BYTES_BP1+2] | tmp_uint8; // Record it as a sign bit at the 7th bit position (from the right // to the left) of lfr_bp1[i*NB_BYTES_BP1+3], by simple logical addition. #ifdef DEBUG_TCH printf("|n_cross_e_scal_b_im| : %16.8e\n",n_cross_e_scal_b_im); printf("|n_cross_e_scal_b_im|/bx_bx_star/2: %16.8e\n",n_cross_e_scal_b_im/bx_bx_star/2); printf("ArgNEBX sign : %u\n",tmp_uint8); - printf("lfr_bp1[i*NB_BYTES_BP1+3] for VPHI & ArgNEBX signs + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+3]); + printf("lfr_bp1[i*NB_BYTES_BP1+2] for VPHI & ArgNEBX signs + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+2]); #endif } } @@ -663,13 +664,13 @@ void BP2_set( float * compressed_spec_ma // left place of the significand bits (nbitsig), // making the 16-bit word to be recorded pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16 -#ifdef LSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+0] = pt_uint8[0]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+1] = pt_uint8[1]; // Record MSB of tmp_uint16 +#ifdef MSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+0] = pt_uint8[0]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+1] = pt_uint8[1]; // Record LSB of tmp_uint16 #endif -#ifdef MSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+0] = pt_uint8[1]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+1] = pt_uint8[0]; // Record MSB of tmp_uint16 +#ifdef LSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+0] = pt_uint8[1]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+1] = pt_uint8[0]; // Record LSB of tmp_uint16 #endif #ifdef DEBUG_TCH printf("autocor for S11 significand : %u\n",autocor); @@ -708,13 +709,13 @@ void BP2_set( float * compressed_spec_ma // left place of the significand bits (nbitsig), // making the 16-bit word to be recorded pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16 -#ifdef LSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+2] = pt_uint8[0]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+3] = pt_uint8[1]; // Record MSB of tmp_uint16 +#ifdef MSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+2] = pt_uint8[0]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+3] = pt_uint8[1]; // Record LSB of tmp_uint16 #endif -#ifdef MSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+2] = pt_uint8[1]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+3] = pt_uint8[0]; // Record MSB of tmp_uint16 +#ifdef LSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+2] = pt_uint8[1]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+3] = pt_uint8[0]; // Record LSB of tmp_uint16 #endif #ifdef DEBUG_TCH printf("autocor for S22 significand : %u\n",autocor); @@ -753,13 +754,13 @@ void BP2_set( float * compressed_spec_ma // left place of the significand bits (nbitsig), // making the 16-bit word to be recorded pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16 -#ifdef LSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+4] = pt_uint8[0]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+5] = pt_uint8[1]; // Record MSB of tmp_uint16 +#ifdef MSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+4] = pt_uint8[0]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+5] = pt_uint8[1]; // Record LSB of tmp_uint16 #endif -#ifdef MSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+4] = pt_uint8[1]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+5] = pt_uint8[0]; // Record MSB of tmp_uint16 +#ifdef LSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+4] = pt_uint8[1]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+5] = pt_uint8[0]; // Record LSB of tmp_uint16 #endif #ifdef DEBUG_TCH printf("autocor for S33 significand : %u\n",autocor); @@ -799,13 +800,13 @@ void BP2_set( float * compressed_spec_ma // left place of the significand bits (nbitsig), // making the 16-bit word to be recorded pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16 -#ifdef LSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+6] = pt_uint8[0]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+7] = pt_uint8[1]; // Record MSB of tmp_uint16 +#ifdef MSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+6] = pt_uint8[0]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+7] = pt_uint8[1]; // Record LSB of tmp_uint16 #endif -#ifdef MSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+6] = pt_uint8[1]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+7] = pt_uint8[0]; // Record MSB of tmp_uint16 +#ifdef LSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+6] = pt_uint8[1]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+7] = pt_uint8[0]; // Record LSB of tmp_uint16 #endif #ifdef DEBUG_TCH printf("autocor for S44 significand : %u\n",autocor); @@ -844,13 +845,15 @@ void BP2_set( float * compressed_spec_ma // left place of the significand bits (nbitsig), // making the 16-bit word to be recorded pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16 -#ifdef LSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+8] = pt_uint8[0]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+9] = pt_uint8[1]; // Record MSB of tmp_uint16 +#ifdef MSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+8] = pt_uint8[0]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+9] = pt_uint8[1]; // Record LSB of tmp_uint16 + //printf("MSB:\n"); #endif -#ifdef MSB_FIRST_TCH - lfr_bp2[i*NB_BYTES_BP2+8] = pt_uint8[1]; // Record LSB of tmp_uint16 - lfr_bp2[i*NB_BYTES_BP2+9] = pt_uint8[0]; // Record MSB of tmp_uint16 +#ifdef LSB_FIRST_TCH + lfr_bp2[i*NB_BYTES_BP2+8] = pt_uint8[1]; // Record MSB of tmp_uint16 + lfr_bp2[i*NB_BYTES_BP2+9] = pt_uint8[0]; // Record LSB of tmp_uint16 + //printf("LSB:\n"); #endif #ifdef DEBUG_TCH printf("autocor for S55 significand : %u\n",autocor); diff --git a/basic_parameters_params.h b/basic_parameters_params.h --- a/basic_parameters_params.h +++ b/basic_parameters_params.h @@ -1,14 +1,14 @@ +// In the frame of RPW LFR Sofware ICD Issue1 Rev8 (05/07/2013) // version 1.4: 16/05/2014 // version 1.5: 20/05/2014 // version 1.6: 19/12/2014 +// version 1.7: 15/01/2015 (modifs de Paul + correction erreurs qui se compensaient (LSB <=> MSB + indices [0,2] <=> [1,3]) + #ifndef BASIC_PARAMETERS_PARAMS_H #define BASIC_PARAMETERS_PARAMS_H #define NB_VALUES_PER_SPECTRAL_MATRIX 25 -#define NB_BINS_COMPRESSED_MATRIX_f0 1 -#define NB_BINS_COMPRESSED_MATRIX_f1 13 -#define NB_BINS_COMPRESSED_MATRIX_f2 12 #define NB_BYTES_BP1 9 #define NB_BYTES_BP2 30 diff --git a/basic_parameters_utilities.h b/basic_parameters_utilities.h --- a/basic_parameters_utilities.h +++ b/basic_parameters_utilities.h @@ -1,4 +1,7 @@ +// In the frame of RPW LFR Sofware ICD Issue1 Rev8 (05/07/2013) // version 1.6: 19/12/2014 +// version 1.7: 15/01/2015 (modifs de Paul + correction erreurs qui se compensaient (LSB <=> MSB + indices [0,2] <=> [1,3]) + #ifndef BASIC_PARAMETERS_UTILITIES_H #define BASIC_PARAMETERS_UTILITIES_H @@ -8,6 +11,10 @@ #include "basic_parameters_params.h" +#define NB_BINS_COMPRESSED_MATRIX_f0 1 +#define NB_BINS_COMPRESSED_MATRIX_f1 13 +#define NB_BINS_COMPRESSED_MATRIX_f2 12 + float compressed_spectral_matrix_f0[NB_BINS_COMPRESSED_MATRIX_f0 * NB_VALUES_PER_SPECTRAL_MATRIX]; float k_coefficients_f0[NB_BINS_COMPRESSED_MATRIX_f0 * NB_K_COEFF_PER_BIN]; float k_coefficients_f1[NB_BINS_COMPRESSED_MATRIX_f1 * NB_K_COEFF_PER_BIN]; diff --git a/file_utilities.c b/file_utilities.c --- a/file_utilities.c +++ b/file_utilities.c @@ -6,6 +6,8 @@ // version 1.4: 16/05/2014 // version 1.5: 20/05/2014 // version 1.6: 19/12/2014 +// version 1.7: 15/01/2015 (modifs de Paul + correction erreurs qui se compensaient (LSB <=> MSB + indices [0,2] <=> [1,3]) + #include "basic_parameters_utilities.h" diff --git a/file_utilities.h b/file_utilities.h --- a/file_utilities.h +++ b/file_utilities.h @@ -6,6 +6,8 @@ // version 1.4: 16/05/2014 // version 1.5: 20/05/2014 // version 1.6: 19/12/2014 +// version 1.7: 15/01/2015 (modifs de Paul + correction erreurs qui se compensaient (LSB <=> MSB + indices [0,2] <=> [1,3]) + #ifndef FILE_UTILITIES_H #define FILE_UTILITIES_H diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -6,6 +6,8 @@ // version 1.4: 16/05/2014 // version 1.5: 20/05/2014 // version 1.6: 19/12/2014 +// version 1.7: 15/01/2015 (modifs de Paul + correction erreurs qui se compensaient (LSB <=> MSB + indices [0,2] <=> [1,3]) + #include @@ -28,11 +30,12 @@ int main(void) printf("The multi-byte quantities are laid out in a MSB FIRST (big endian) fashion\n\n"); #endif - //filename="/WIN/Users/chust/DD CHUST/Missions/Solar Orbiter/LFR/Prog C/tests bp Paul/tests2/sm_test2.dat"; - filename="sm_test2.dat"; + filename="/WIN/Users/chust/DD CHUST/Missions/Solar Orbiter/LFR/Prog C/tests bp Paul/tests2/sm_test2.dat"; lecture_file_sm(filename); - init_k_coefficients(k_coefficients_f0, k_coefficients_f1, k_coefficients_f2); + init_k_coefficients(k_coefficients_f0, NB_BINS_COMPRESSED_MATRIX_f0); + init_k_coefficients(k_coefficients_f1, NB_BINS_COMPRESSED_MATRIX_f1); + init_k_coefficients(k_coefficients_f2, NB_BINS_COMPRESSED_MATRIX_f2); printf("\n"); diff --git a/tests5.pro b/tests5.pro new file mode 100755 --- /dev/null +++ b/tests5.pro @@ -0,0 +1,20 @@ +TEMPLATE = app +CONFIG += console +CONFIG -= app_bundle +CONFIG -= qt + +DEFINES += DEBUG_TCH +DEFINES += LSB_FIRST_TCH # PC convention +#DEFINES += MSB_FIRST_TCH # SPARC convention + +SOURCES += main.c \ + basic_parameters.c \ + file_utilities.c + +HEADERS += \ + basic_parameters.h \ + basic_parameters_params.h \ + basic_parameters_utilities.h \ + file_utilities.h + +