|
@@
-6,6
+6,7
|
|
6
|
// version 1.4: 16/05/2014
|
|
6
|
// version 1.4: 16/05/2014
|
|
7
|
// version 1.5: 20/05/2014
|
|
7
|
// version 1.5: 20/05/2014
|
|
8
|
// version 1.6: 19/12/2014
|
|
8
|
// version 1.6: 19/12/2014
|
|
|
|
|
9
|
// version 1.7: 15/01/2015 (modifs de Paul + correction erreurs qui se compensaient (LSB <=> MSB + indices [0,2] <=> [1,3])
|
|
9
|
|
|
10
|
|
|
10
|
#ifndef BASIC_PARAMETERS_H_INCLUDED
|
|
11
|
#ifndef BASIC_PARAMETERS_H_INCLUDED
|
|
11
|
#define BASIC_PARAMETERS_H_INCLUDED
|
|
12
|
#define BASIC_PARAMETERS_H_INCLUDED
|
|
@@
-19,7
+20,7
|
|
19
|
static inline void BP1_set(float * compressed_spec_mat, float * k_coeff_intercalib, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp1);
|
|
20
|
static inline void BP1_set(float * compressed_spec_mat, float * k_coeff_intercalib, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp1);
|
|
20
|
static inline void BP2_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp2);
|
|
21
|
static inline void BP2_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp2);
|
|
21
|
|
|
22
|
|
|
22
|
void init_k_coefficients( float *k_coefficients_f0, float *k_coefficients_f1, float *k_coefficients_f2 );
|
|
23
|
void init_k_coefficients( float *k_coefficients_f0, unsigned char nb_binscompressed_matrix );
|
|
23
|
|
|
24
|
|
|
24
|
//***********************************
|
|
25
|
//***********************************
|
|
25
|
// STATIC INLINE FUNCTION DEFINITIONS
|
|
26
|
// STATIC INLINE FUNCTION DEFINITIONS
|
|
@@
-109,13
+110,13
void BP1_set( float * compressed_spec_ma
|
|
109
|
// left place of the significand bits (nbitsig),
|
|
110
|
// left place of the significand bits (nbitsig),
|
|
110
|
// making the 16-bit word to be recorded
|
|
111
|
// making the 16-bit word to be recorded
|
|
111
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
112
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
112
|
#ifdef LSB_FIRST_TCH
|
|
113
|
#ifdef MSB_FIRST_TCH
|
|
113
|
lfr_bp1[i*NB_BYTES_BP1+2] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
114
|
lfr_bp1[i*NB_BYTES_BP1+2] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
114
|
lfr_bp1[i*NB_BYTES_BP1+3] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
115
|
lfr_bp1[i*NB_BYTES_BP1+3] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
115
|
#endif
|
|
116
|
#endif
|
|
116
|
#ifdef MSB_FIRST_TCH
|
|
117
|
#ifdef LSB_FIRST_TCH
|
|
117
|
lfr_bp1[i*NB_BYTES_BP1+2] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
118
|
lfr_bp1[i*NB_BYTES_BP1+2] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
118
|
lfr_bp1[i*NB_BYTES_BP1+3] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
119
|
lfr_bp1[i*NB_BYTES_BP1+3] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
119
|
#endif
|
|
120
|
#endif
|
|
120
|
#ifdef DEBUG_TCH
|
|
121
|
#ifdef DEBUG_TCH
|
|
121
|
printf("\nBin number: %d\n", i);
|
|
122
|
printf("\nBin number: %d\n", i);
|
|
@@
-162,13
+163,13
void BP1_set( float * compressed_spec_ma
|
|
162
|
// left place of the significand bits (nbitsig),
|
|
163
|
// left place of the significand bits (nbitsig),
|
|
163
|
// making the 16-bit word to be recorded
|
|
164
|
// making the 16-bit word to be recorded
|
|
164
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
165
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
165
|
#ifdef LSB_FIRST_TCH
|
|
166
|
#ifdef MSB_FIRST_TCH
|
|
166
|
lfr_bp1[i*NB_BYTES_BP1+0] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
167
|
lfr_bp1[i*NB_BYTES_BP1+0] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
167
|
lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
168
|
lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
168
|
#endif
|
|
169
|
#endif
|
|
169
|
#ifdef MSB_FIRST_TCH
|
|
170
|
#ifdef LSB_FIRST_TCH
|
|
170
|
lfr_bp1[i*NB_BYTES_BP1+0] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
171
|
lfr_bp1[i*NB_BYTES_BP1+0] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
171
|
lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
172
|
lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
172
|
#endif
|
|
173
|
#endif
|
|
173
|
#ifdef DEBUG_TCH
|
|
174
|
#ifdef DEBUG_TCH
|
|
174
|
printf("Bin number: %d\n", i);
|
|
175
|
printf("Bin number: %d\n", i);
|
|
@@
-202,7
+203,7
void BP1_set( float * compressed_spec_ma
|
|
202
|
// Record it at the 8th bit position (from the right to the left) of lfr_bp1[i*NB_BYTES_BP1+6]
|
|
203
|
// Record it at the 8th bit position (from the right to the left) of lfr_bp1[i*NB_BYTES_BP1+6]
|
|
203
|
#endif
|
|
204
|
#endif
|
|
204
|
#ifdef MSB_FIRST_TCH
|
|
205
|
#ifdef MSB_FIRST_TCH
|
|
205
|
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)
|
|
206
|
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)
|
|
206
|
// Record it at the 8th bit position (from the right to the left) of lfr_bp1[i*NB_BYTES_BP1+6]
|
|
207
|
// Record it at the 8th bit position (from the right to the left) of lfr_bp1[i*NB_BYTES_BP1+6]
|
|
207
|
#endif
|
|
208
|
#endif
|
|
208
|
#ifdef DEBUG_TCH
|
|
209
|
#ifdef DEBUG_TCH
|
|
@@
-285,15
+286,15
void BP1_set( float * compressed_spec_ma
|
|
285
|
#endif
|
|
286
|
#endif
|
|
286
|
pt_uint8 = (uint8_t*) &e_cross_b_re; // Affect an uint8_t pointer with the adress of e_cross_b_re
|
|
287
|
pt_uint8 = (uint8_t*) &e_cross_b_re; // Affect an uint8_t pointer with the adress of e_cross_b_re
|
|
287
|
#ifdef LSB_FIRST_TCH
|
|
288
|
#ifdef LSB_FIRST_TCH
|
|
288
|
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)
|
|
289
|
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)
|
|
289
|
// Record it at the 8th bit position (from the right to the left)
|
|
290
|
// Record it at the 8th bit position (from the right to the left)
|
|
290
|
// of lfr_bp1[i*NB_BYTES_BP1+1]
|
|
291
|
// of lfr_bp1[i*NB_BYTES_BP1+0]
|
|
291
|
pt_uint8[3] = (pt_uint8[3] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
|
|
292
|
pt_uint8[3] = (pt_uint8[3] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
|
|
292
|
#endif
|
|
293
|
#endif
|
|
293
|
#ifdef MSB_FIRST_TCH
|
|
294
|
#ifdef MSB_FIRST_TCH
|
|
294
|
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)
|
|
295
|
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)
|
|
295
|
// Record it at the 8th bit position (from the right to the left)
|
|
296
|
// Record it at the 8th bit position (from the right to the left)
|
|
296
|
// of lfr_bp1[i*NB_BYTES_BP1+1]
|
|
297
|
// of lfr_bp1[i*NB_BYTES_BP1+0]
|
|
297
|
pt_uint8[0] = (pt_uint8[0] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
|
|
298
|
pt_uint8[0] = (pt_uint8[0] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
|
|
298
|
#endif
|
|
299
|
#endif
|
|
299
|
significand = frexpf(e_cross_b_re/2, &exponent); // 0.5 <= significand < 1
|
|
300
|
significand = frexpf(e_cross_b_re/2, &exponent); // 0.5 <= significand < 1
|
|
@@
-329,24
+330,24
void BP1_set( float * compressed_spec_ma
|
|
329
|
// with lfr_bp1[i*NB_BYTES_BP1+7]
|
|
330
|
// with lfr_bp1[i*NB_BYTES_BP1+7]
|
|
330
|
#ifdef DEBUG_TCH
|
|
331
|
#ifdef DEBUG_TCH
|
|
331
|
printf("lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX exponent + significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+7]);
|
|
332
|
printf("lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX exponent + significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+7]);
|
|
332
|
printf("lfr_bp1[i*NB_BYTES_BP1+1] for ReaSX sign + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+1]);
|
|
333
|
printf("lfr_bp1[i*NB_BYTES_BP1+0] for ReaSX sign + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+0]);
|
|
333
|
printf("ImaSX / 2 : %16.8e\n",e_cross_b_im/2);
|
|
334
|
printf("ImaSX / 2 : %16.8e\n",e_cross_b_im/2);
|
|
334
|
#endif
|
|
335
|
#endif
|
|
335
|
pt_uint8 = (uint8_t*) &e_cross_b_im; // Affect an uint8_t pointer with the adress of e_cross_b_im
|
|
336
|
pt_uint8 = (uint8_t*) &e_cross_b_im; // Affect an uint8_t pointer with the adress of e_cross_b_im
|
|
336
|
#ifdef LSB_FIRST_TCH
|
|
337
|
#ifdef LSB_FIRST_TCH
|
|
337
|
pt_uint8[3] = pt_uint8[3] & 0x7f; // Make e_cross_b_im be positive in any case: |ImaSX|
|
|
338
|
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)
|
|
338
|
#endif
|
|
339
|
#endif
|
|
339
|
#ifdef MSB_FIRST_TCH
|
|
340
|
#ifdef MSB_FIRST_TCH
|
|
340
|
pt_uint8[0] = pt_uint8[0] & 0x7f; // Make e_cross_b_im be positive in any case: |ImaSX|
|
|
341
|
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)
|
|
341
|
#endif
|
|
342
|
#endif
|
|
342
|
tmp_uint8 = (e_cross_b_im > e_cross_b_re) ? 0x40 : 0x00; // Determine the sector argument of SX. If |Im| > |Re| affect
|
|
343
|
tmp_uint8 = (e_cross_b_im > e_cross_b_re) ? 0x40 : 0x00; // Determine the sector argument of SX. If |Im| > |Re| affect
|
|
343
|
// an unsigned 8-bit char with 01000000; otherwise with null.
|
|
344
|
// an unsigned 8-bit char with 01000000; otherwise with null.
|
|
344
|
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
|
|
345
|
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
|
|
345
|
// to the left) of lfr_bp1[i*NB_BYTES_BP1+1], by simple logical addition.
|
|
346
|
// to the left) of lfr_bp1[i*NB_BYTES_BP1+0], by simple logical addition.
|
|
346
|
#ifdef DEBUG_TCH
|
|
347
|
#ifdef DEBUG_TCH
|
|
347
|
printf("|ImaSX| / 2 : %16.8e\n",e_cross_b_im/2);
|
|
348
|
printf("|ImaSX| / 2 : %16.8e\n",e_cross_b_im/2);
|
|
348
|
printf("ArgSX sign : %u\n",tmp_uint8);
|
|
349
|
printf("ArgSX sign : %u\n",tmp_uint8);
|
|
349
|
printf("lfr_bp1[i*NB_BYTES_BP1+1] for ReaSX & ArgSX signs + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+1]);
|
|
350
|
printf("lfr_bp1[i*NB_BYTES_BP1+0] for ReaSX & ArgSX signs + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+0]);
|
|
350
|
#endif
|
|
351
|
#endif
|
|
351
|
//======================================================================
|
|
352
|
//======================================================================
|
|
352
|
// BP1 phase velocity estimator == PA_LFR_SC_BP1_VPHI_F0 == 8 (+ 2) bits
|
|
353
|
// BP1 phase velocity estimator == PA_LFR_SC_BP1_VPHI_F0 == 8 (+ 2) bits
|
|
@@
-399,15
+400,15
void BP1_set( float * compressed_spec_ma
|
|
399
|
// vphi = n_cross_e_scal_b_re / bx_bx_star => sign(VPHI) = sign(n_cross_e_scal_b_re)
|
|
400
|
// vphi = n_cross_e_scal_b_re / bx_bx_star => sign(VPHI) = sign(n_cross_e_scal_b_re)
|
|
400
|
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
|
|
401
|
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
|
|
401
|
#ifdef LSB_FIRST_TCH
|
|
402
|
#ifdef LSB_FIRST_TCH
|
|
402
|
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)
|
|
403
|
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)
|
|
403
|
// Record it at the 8th bit position (from the right to the left)
|
|
404
|
// Record it at the 8th bit position (from the right to the left)
|
|
404
|
// of lfr_bp1[i*NB_BYTES_BP1+3]
|
|
405
|
// of lfr_bp1[i*NB_BYTES_BP1+2]
|
|
405
|
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|
|
|
406
|
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|
|
|
406
|
#endif
|
|
407
|
#endif
|
|
407
|
#ifdef MSB_FIRST_TCH
|
|
408
|
#ifdef MSB_FIRST_TCH
|
|
408
|
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)
|
|
409
|
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)
|
|
409
|
// Record it at the 8th bit position (from the right to the left)
|
|
410
|
// Record it at the 8th bit position (from the right to the left)
|
|
410
|
// of lfr_bp1[i*NB_BYTES_BP1+3]
|
|
411
|
// of lfr_bp1[i*NB_BYTES_BP1+2]
|
|
411
|
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|
|
|
412
|
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|
|
|
412
|
#endif
|
|
413
|
#endif
|
|
413
|
vphi = n_cross_e_scal_b_re / bx_bx_star; // Compute |VPHI|
|
|
414
|
vphi = n_cross_e_scal_b_re / bx_bx_star; // Compute |VPHI|
|
|
@@
-446,24
+447,24
void BP1_set( float * compressed_spec_ma
|
|
446
|
// with lfr_bp1[i*NB_BYTES_BP1+8]
|
|
447
|
// with lfr_bp1[i*NB_BYTES_BP1+8]
|
|
447
|
#ifdef DEBUG_TCH
|
|
448
|
#ifdef DEBUG_TCH
|
|
448
|
printf("lfr_bp1[i*NB_BYTES_BP1+8] for VPHI exponent + significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+8]);
|
|
449
|
printf("lfr_bp1[i*NB_BYTES_BP1+8] for VPHI exponent + significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+8]);
|
|
449
|
printf("lfr_bp1[i*NB_BYTES_BP1+3] for VPHI sign + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+3]);
|
|
450
|
printf("lfr_bp1[i*NB_BYTES_BP1+2] for VPHI sign + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+2]);
|
|
450
|
#endif
|
|
451
|
#endif
|
|
451
|
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
|
|
452
|
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
|
|
452
|
#ifdef LSB_FIRST_TCH
|
|
453
|
#ifdef LSB_FIRST_TCH
|
|
453
|
pt_uint8[3] = pt_uint8[3] & 0x7f; // Make n_cross_e_scal_b_im be positive in any case: |ImaSX|
|
|
454
|
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)
|
|
454
|
#endif
|
|
455
|
#endif
|
|
455
|
#ifdef MSB_FIRST_TCH
|
|
456
|
#ifdef MSB_FIRST_TCH
|
|
456
|
pt_uint8[0] = pt_uint8[0] & 0x7f; // Make n_cross_e_scal_b_im be positive in any case: |ImaSX|
|
|
457
|
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)
|
|
457
|
#endif
|
|
458
|
#endif
|
|
458
|
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
|
|
459
|
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
|
|
459
|
// an unsigned 8-bit char with 01000000; otherwise with null.
|
|
460
|
// an unsigned 8-bit char with 01000000; otherwise with null.
|
|
460
|
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
|
|
461
|
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
|
|
461
|
// to the left) of lfr_bp1[i*NB_BYTES_BP1+3], by simple logical addition.
|
|
462
|
// to the left) of lfr_bp1[i*NB_BYTES_BP1+3], by simple logical addition.
|
|
462
|
#ifdef DEBUG_TCH
|
|
463
|
#ifdef DEBUG_TCH
|
|
463
|
printf("|n_cross_e_scal_b_im| : %16.8e\n",n_cross_e_scal_b_im);
|
|
464
|
printf("|n_cross_e_scal_b_im| : %16.8e\n",n_cross_e_scal_b_im);
|
|
464
|
printf("|n_cross_e_scal_b_im|/bx_bx_star/2: %16.8e\n",n_cross_e_scal_b_im/bx_bx_star/2);
|
|
465
|
printf("|n_cross_e_scal_b_im|/bx_bx_star/2: %16.8e\n",n_cross_e_scal_b_im/bx_bx_star/2);
|
|
465
|
printf("ArgNEBX sign : %u\n",tmp_uint8);
|
|
466
|
printf("ArgNEBX sign : %u\n",tmp_uint8);
|
|
466
|
printf("lfr_bp1[i*NB_BYTES_BP1+3] for VPHI & ArgNEBX signs + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+3]);
|
|
467
|
printf("lfr_bp1[i*NB_BYTES_BP1+2] for VPHI & ArgNEBX signs + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+2]);
|
|
467
|
#endif
|
|
468
|
#endif
|
|
468
|
}
|
|
469
|
}
|
|
469
|
}
|
|
470
|
}
|
|
@@
-663,13
+664,13
void BP2_set( float * compressed_spec_ma
|
|
663
|
// left place of the significand bits (nbitsig),
|
|
664
|
// left place of the significand bits (nbitsig),
|
|
664
|
// making the 16-bit word to be recorded
|
|
665
|
// making the 16-bit word to be recorded
|
|
665
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
666
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
666
|
#ifdef LSB_FIRST_TCH
|
|
667
|
#ifdef MSB_FIRST_TCH
|
|
667
|
lfr_bp2[i*NB_BYTES_BP2+0] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
668
|
lfr_bp2[i*NB_BYTES_BP2+0] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
668
|
lfr_bp2[i*NB_BYTES_BP2+1] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
669
|
lfr_bp2[i*NB_BYTES_BP2+1] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
669
|
#endif
|
|
670
|
#endif
|
|
670
|
#ifdef MSB_FIRST_TCH
|
|
671
|
#ifdef LSB_FIRST_TCH
|
|
671
|
lfr_bp2[i*NB_BYTES_BP2+0] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
672
|
lfr_bp2[i*NB_BYTES_BP2+0] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
672
|
lfr_bp2[i*NB_BYTES_BP2+1] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
673
|
lfr_bp2[i*NB_BYTES_BP2+1] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
673
|
#endif
|
|
674
|
#endif
|
|
674
|
#ifdef DEBUG_TCH
|
|
675
|
#ifdef DEBUG_TCH
|
|
675
|
printf("autocor for S11 significand : %u\n",autocor);
|
|
676
|
printf("autocor for S11 significand : %u\n",autocor);
|
|
@@
-708,13
+709,13
void BP2_set( float * compressed_spec_ma
|
|
708
|
// left place of the significand bits (nbitsig),
|
|
709
|
// left place of the significand bits (nbitsig),
|
|
709
|
// making the 16-bit word to be recorded
|
|
710
|
// making the 16-bit word to be recorded
|
|
710
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
711
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
711
|
#ifdef LSB_FIRST_TCH
|
|
712
|
#ifdef MSB_FIRST_TCH
|
|
712
|
lfr_bp2[i*NB_BYTES_BP2+2] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
713
|
lfr_bp2[i*NB_BYTES_BP2+2] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
713
|
lfr_bp2[i*NB_BYTES_BP2+3] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
714
|
lfr_bp2[i*NB_BYTES_BP2+3] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
714
|
#endif
|
|
715
|
#endif
|
|
715
|
#ifdef MSB_FIRST_TCH
|
|
716
|
#ifdef LSB_FIRST_TCH
|
|
716
|
lfr_bp2[i*NB_BYTES_BP2+2] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
717
|
lfr_bp2[i*NB_BYTES_BP2+2] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
717
|
lfr_bp2[i*NB_BYTES_BP2+3] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
718
|
lfr_bp2[i*NB_BYTES_BP2+3] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
718
|
#endif
|
|
719
|
#endif
|
|
719
|
#ifdef DEBUG_TCH
|
|
720
|
#ifdef DEBUG_TCH
|
|
720
|
printf("autocor for S22 significand : %u\n",autocor);
|
|
721
|
printf("autocor for S22 significand : %u\n",autocor);
|
|
@@
-753,13
+754,13
void BP2_set( float * compressed_spec_ma
|
|
753
|
// left place of the significand bits (nbitsig),
|
|
754
|
// left place of the significand bits (nbitsig),
|
|
754
|
// making the 16-bit word to be recorded
|
|
755
|
// making the 16-bit word to be recorded
|
|
755
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
756
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
756
|
#ifdef LSB_FIRST_TCH
|
|
757
|
#ifdef MSB_FIRST_TCH
|
|
757
|
lfr_bp2[i*NB_BYTES_BP2+4] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
758
|
lfr_bp2[i*NB_BYTES_BP2+4] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
758
|
lfr_bp2[i*NB_BYTES_BP2+5] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
759
|
lfr_bp2[i*NB_BYTES_BP2+5] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
759
|
#endif
|
|
760
|
#endif
|
|
760
|
#ifdef MSB_FIRST_TCH
|
|
761
|
#ifdef LSB_FIRST_TCH
|
|
761
|
lfr_bp2[i*NB_BYTES_BP2+4] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
762
|
lfr_bp2[i*NB_BYTES_BP2+4] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
762
|
lfr_bp2[i*NB_BYTES_BP2+5] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
763
|
lfr_bp2[i*NB_BYTES_BP2+5] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
763
|
#endif
|
|
764
|
#endif
|
|
764
|
#ifdef DEBUG_TCH
|
|
765
|
#ifdef DEBUG_TCH
|
|
765
|
printf("autocor for S33 significand : %u\n",autocor);
|
|
766
|
printf("autocor for S33 significand : %u\n",autocor);
|
|
@@
-799,13
+800,13
void BP2_set( float * compressed_spec_ma
|
|
799
|
// left place of the significand bits (nbitsig),
|
|
800
|
// left place of the significand bits (nbitsig),
|
|
800
|
// making the 16-bit word to be recorded
|
|
801
|
// making the 16-bit word to be recorded
|
|
801
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
802
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
802
|
#ifdef LSB_FIRST_TCH
|
|
803
|
#ifdef MSB_FIRST_TCH
|
|
803
|
lfr_bp2[i*NB_BYTES_BP2+6] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
804
|
lfr_bp2[i*NB_BYTES_BP2+6] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
804
|
lfr_bp2[i*NB_BYTES_BP2+7] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
805
|
lfr_bp2[i*NB_BYTES_BP2+7] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
805
|
#endif
|
|
806
|
#endif
|
|
806
|
#ifdef MSB_FIRST_TCH
|
|
807
|
#ifdef LSB_FIRST_TCH
|
|
807
|
lfr_bp2[i*NB_BYTES_BP2+6] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
808
|
lfr_bp2[i*NB_BYTES_BP2+6] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
808
|
lfr_bp2[i*NB_BYTES_BP2+7] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
809
|
lfr_bp2[i*NB_BYTES_BP2+7] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
809
|
#endif
|
|
810
|
#endif
|
|
810
|
#ifdef DEBUG_TCH
|
|
811
|
#ifdef DEBUG_TCH
|
|
811
|
printf("autocor for S44 significand : %u\n",autocor);
|
|
812
|
printf("autocor for S44 significand : %u\n",autocor);
|
|
@@
-844,13
+845,15
void BP2_set( float * compressed_spec_ma
|
|
844
|
// left place of the significand bits (nbitsig),
|
|
845
|
// left place of the significand bits (nbitsig),
|
|
845
|
// making the 16-bit word to be recorded
|
|
846
|
// making the 16-bit word to be recorded
|
|
846
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
847
|
pt_uint8 = (uint8_t*) &tmp_uint16; // Affect an uint8_t pointer with the adress of tmp_uint16
|
|
847
|
#ifdef LSB_FIRST_TCH
|
|
848
|
#ifdef MSB_FIRST_TCH
|
|
848
|
lfr_bp2[i*NB_BYTES_BP2+8] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
849
|
lfr_bp2[i*NB_BYTES_BP2+8] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
849
|
lfr_bp2[i*NB_BYTES_BP2+9] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
850
|
lfr_bp2[i*NB_BYTES_BP2+9] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
|
|
|
851
|
//printf("MSB:\n");
|
|
850
|
#endif
|
|
852
|
#endif
|
|
851
|
#ifdef MSB_FIRST_TCH
|
|
853
|
#ifdef LSB_FIRST_TCH
|
|
852
|
lfr_bp2[i*NB_BYTES_BP2+8] = pt_uint8[1]; // Record LSB of tmp_uint16
|
|
854
|
lfr_bp2[i*NB_BYTES_BP2+8] = pt_uint8[1]; // Record MSB of tmp_uint16
|
|
853
|
lfr_bp2[i*NB_BYTES_BP2+9] = pt_uint8[0]; // Record MSB of tmp_uint16
|
|
855
|
lfr_bp2[i*NB_BYTES_BP2+9] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
|
|
|
856
|
//printf("LSB:\n");
|
|
854
|
#endif
|
|
857
|
#endif
|
|
855
|
#ifdef DEBUG_TCH
|
|
858
|
#ifdef DEBUG_TCH
|
|
856
|
printf("autocor for S55 significand : %u\n",autocor);
|
|
859
|
printf("autocor for S55 significand : %u\n",autocor);
|