|
@@
-1,4
+1,4
|
|
1
|
// In the frame of RPW LFR Sofware ICD Issue1 Rev8 (05/07/2013)
|
|
1
|
// In the frame of RPW LFR Sofware ICD Issue1 Rev8 (05/07/2013) => R2 FSW
|
|
2
|
// version 1.0: 31/07/2013
|
|
2
|
// version 1.0: 31/07/2013
|
|
3
|
// version 1.1: 02/04/2014
|
|
3
|
// version 1.1: 02/04/2014
|
|
4
|
// version 1.2: 30/04/2014
|
|
4
|
// version 1.2: 30/04/2014
|
|
@@
-8,6
+8,8
|
|
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
|
// version 1.7: 15/01/2015 (modifs de Paul + correction erreurs qui se compensaient (LSB <=> MSB + indices [0,2] <=> [1,3])
|
|
10
|
// version 1.8: 02/02/2015 (gestion des divisions par zéro)
|
|
10
|
// version 1.8: 02/02/2015 (gestion des divisions par zéro)
|
|
|
|
|
11
|
// In the frame of RPW LFR Sofware ICD Issue3 Rev6 (27/01/2015) => R3 FSW
|
|
|
|
|
12
|
// version 2.0: 19/06/2015
|
|
11
|
|
|
13
|
|
|
12
|
#ifndef BASIC_PARAMETERS_H_INCLUDED
|
|
14
|
#ifndef BASIC_PARAMETERS_H_INCLUDED
|
|
13
|
#define BASIC_PARAMETERS_H_INCLUDED
|
|
15
|
#define BASIC_PARAMETERS_H_INCLUDED
|
|
@@
-21,7
+23,7
|
|
21
|
static inline void BP1_set(float * compressed_spec_mat, float * k_coeff_intercalib, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp1);
|
|
23
|
static inline void BP1_set(float * compressed_spec_mat, float * k_coeff_intercalib, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp1);
|
|
22
|
static inline void BP2_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp2);
|
|
24
|
static inline void BP2_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp2);
|
|
23
|
|
|
25
|
|
|
24
|
void init_k_coefficients( float *k_coefficients_f0, unsigned char nb_binscompressed_matrix );
|
|
26
|
void init_k_coefficients( float *k_coeff_intercalib, unsigned char nb_binscompressed_matrix );
|
|
25
|
|
|
27
|
|
|
26
|
//***********************************
|
|
28
|
//***********************************
|
|
27
|
// STATIC INLINE FUNCTION DEFINITIONS
|
|
29
|
// STATIC INLINE FUNCTION DEFINITIONS
|
|
@@
-67,11
+69,11
void BP1_set( float * compressed_spec_ma
|
|
67
|
#endif
|
|
69
|
#endif
|
|
68
|
|
|
70
|
|
|
69
|
// initialization for managing the exponents of the floating point data:
|
|
71
|
// initialization for managing the exponents of the floating point data:
|
|
70
|
nbitexp = 5; // number of bits for the exponent
|
|
72
|
nbitexp = 6; // number of bits for the exponent
|
|
71
|
expmax = 30; // maximum value of the exponent
|
|
73
|
expmax = 32+5; // maximum value of the exponent
|
|
72
|
expmin = expmax - (1 << nbitexp) + 1; // accordingly the minimum exponent value
|
|
74
|
expmin = expmax - (1 << nbitexp) + 1; // accordingly the minimum exponent value
|
|
73
|
// for floating point data to be recorded on 12-bit words:
|
|
75
|
// for floating point data to be recorded on 16-bit words:
|
|
74
|
nbitsig = 12 - nbitexp; // number of bits for the significand
|
|
76
|
nbitsig = 16 - nbitexp; // number of bits for the significand
|
|
75
|
rangesig = (1 << nbitsig)-1; // == 2^nbitsig - 1
|
|
77
|
rangesig = (1 << nbitsig)-1; // == 2^nbitsig - 1
|
|
76
|
|
|
78
|
|
|
77
|
#ifdef DEBUG_TCH
|
|
79
|
#ifdef DEBUG_TCH
|
|
@@
-81,14
+83,13
void BP1_set( float * compressed_spec_ma
|
|
81
|
|
|
83
|
|
|
82
|
for(i=0; i<nb_bins_compressed_spec_mat; i++){
|
|
84
|
for(i=0; i<nb_bins_compressed_spec_mat; i++){
|
|
83
|
//==============================================
|
|
85
|
//==============================================
|
|
84
|
// BP1 PSDB == PA_LFR_SC_BP1_PB_F0 == 12 bits = 5 bits (exponent) + 7 bits (significand)
|
|
86
|
// BP1 PSDB == PA_LFR_SC_BP1_PB_F0 == 16 bits = 6 bits (exponent) + 10 bits (significand)
|
|
85
|
PSDB = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX] // S11
|
|
87
|
PSDB = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX] // S11
|
|
86
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+9] // S22
|
|
88
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+9] // S22
|
|
87
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+16]; // S33
|
|
89
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+16]; // S33
|
|
88
|
|
|
90
|
|
|
89
|
significand = frexpf(PSDB/3, &exponent); // 0.5 <= significand < 1
|
|
91
|
significand = frexpf(PSDB, &exponent); // 0.5 <= significand < 1
|
|
90
|
// PSDB/3 = significand * 2^exponent
|
|
92
|
// PSDB = significand * 2^exponent
|
|
91
|
// the division by 3 is to ensure that max value <= 2^30
|
|
|
|
|
92
|
|
|
93
|
|
|
93
|
if (exponent < expmin) { // value should be >= 0.5 * 2^expmin
|
|
94
|
if (exponent < expmin) { // value should be >= 0.5 * 2^expmin
|
|
94
|
exponent = expmin;
|
|
95
|
exponent = expmin;
|
|
@@
-121,27
+122,25
void BP1_set( float * compressed_spec_ma
|
|
121
|
#endif
|
|
122
|
#endif
|
|
122
|
#ifdef DEBUG_TCH
|
|
123
|
#ifdef DEBUG_TCH
|
|
123
|
printf("\nBin number: %d\n", i);
|
|
124
|
printf("\nBin number: %d\n", i);
|
|
124
|
printf("PSDB / 3 : %16.8e\n",PSDB/3);
|
|
125
|
printf("PSDB : %16.8e\n",PSDB);
|
|
125
|
printf("significand : %16.8e\n",significand);
|
|
126
|
printf("significand : %16.8e\n",significand);
|
|
126
|
printf("exponent : %d\n" ,exponent);
|
|
127
|
printf("exponent : %d\n" ,exponent);
|
|
127
|
printf("psd for PSDB significand : %d\n",psd);
|
|
128
|
printf("psd for PSDB significand : %d\n",psd);
|
|
128
|
printf("exp for PSDB exponent : %d\n",exp);
|
|
129
|
printf("exp for PSDB exponent : %d\n",exp);
|
|
129
|
printf("pt_uint8[1] for PSDB exponent + significand: %.3d or %.2x\n",pt_uint8[1], pt_uint8[1]);
|
|
130
|
printf("pt_uint8[1] for PSDB exponent + significand: %.3d or %.2x\n",pt_uint8[1], pt_uint8[1]);
|
|
130
|
printf("pt_uint8[0] for PSDB exponent + significand: %.3d or %.2x\n",pt_uint8[0], pt_uint8[0]);
|
|
131
|
printf("pt_uint8[0] for PSDB significand: %.3d or %.2x\n",pt_uint8[0], pt_uint8[0]);
|
|
|
|
|
132
|
printf("lfr_bp1[i*NB_BYTES_BP1+2] : %.3d or %.2x\n",lfr_bp1[i*NB_BYTES_BP1+2], lfr_bp1[i*NB_BYTES_BP1+2]);
|
|
131
|
printf("lfr_bp1[i*NB_BYTES_BP1+3] : %.3d or %.2x\n",lfr_bp1[i*NB_BYTES_BP1+3], lfr_bp1[i*NB_BYTES_BP1+3]);
|
|
133
|
printf("lfr_bp1[i*NB_BYTES_BP1+3] : %.3d or %.2x\n",lfr_bp1[i*NB_BYTES_BP1+3], lfr_bp1[i*NB_BYTES_BP1+3]);
|
|
132
|
printf("lfr_bp1[i*NB_BYTES_BP1+2] : %.3d or %.2x\n",lfr_bp1[i*NB_BYTES_BP1+2], lfr_bp1[i*NB_BYTES_BP1+2]);
|
|
|
|
|
133
|
#endif
|
|
134
|
#endif
|
|
134
|
//==============================================
|
|
135
|
//==============================================
|
|
135
|
// BP1 PSDE == PA_LFR_SC_BP1_PE_F0 == 12 bits = 5 bits (exponent) + 7 bits (significand)
|
|
136
|
// BP1 PSDE == PA_LFR_SC_BP1_PE_F0 == 16 bits = 6 bits (exponent) + 10 bits (significand)
|
|
136
|
PSDE = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+21] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K44_PE] // S44
|
|
137
|
PSDE = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+21] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K44_PE] // S44
|
|
137
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+24] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K55_PE] // S55
|
|
138
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+24] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K55_PE] // S55
|
|
138
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+22] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K45_PE_RE] // S45 Re
|
|
139
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+22] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K45_PE_RE] // S45 Re
|
|
139
|
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+23] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K45_PE_IM]; // S45 Im
|
|
140
|
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+23] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K45_PE_IM]; // S45 Im
|
|
140
|
|
|
141
|
|
|
141
|
significand = frexpf(PSDE/2, &exponent); // 0.5 <= significand < 1
|
|
142
|
significand = frexpf(PSDE, &exponent); // 0.5 <= significand < 1
|
|
142
|
// PSDE/2 = significand * 2^exponent
|
|
143
|
// PSDE = significand * 2^exponent
|
|
143
|
// the division by 2 is to ensure that max value <= 2^30
|
|
|
|
|
144
|
// should be reconsidered by taking into account the k-coefficients ...
|
|
|
|
|
145
|
|
|
144
|
|
|
146
|
if (exponent < expmin) { // value should be >= 0.5 * 2^expmin
|
|
145
|
if (exponent < expmin) { // value should be >= 0.5 * 2^expmin
|
|
147
|
exponent = expmin;
|
|
146
|
exponent = expmin;
|
|
@@
-173,16
+172,15
void BP1_set( float * compressed_spec_ma
|
|
173
|
lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
172
|
lfr_bp1[i*NB_BYTES_BP1+1] = pt_uint8[0]; // Record LSB of tmp_uint16
|
|
174
|
#endif
|
|
173
|
#endif
|
|
175
|
#ifdef DEBUG_TCH
|
|
174
|
#ifdef DEBUG_TCH
|
|
176
|
printf("Bin number: %d\n", i);
|
|
175
|
printf("PSDE : %16.8e\n",PSDE);
|
|
177
|
printf("PSDE/2 : %16.8e\n",PSDE/2);
|
|
|
|
|
178
|
printf("significand : %16.8e\n",significand);
|
|
176
|
printf("significand : %16.8e\n",significand);
|
|
179
|
printf("exponent : %d\n" ,exponent);
|
|
177
|
printf("exponent : %d\n" ,exponent);
|
|
180
|
printf("psd for PSDE significand : %d\n",psd);
|
|
178
|
printf("psd for PSDE significand : %d\n",psd);
|
|
181
|
printf("exp for PSDE exponent : %d\n",exp);
|
|
179
|
printf("exp for PSDE exponent : %d\n",exp);
|
|
182
|
printf("pt_uint8[1] for PSDE exponent + significand: %.3d or %.2x\n",pt_uint8[1], pt_uint8[1]);
|
|
180
|
printf("pt_uint8[1] for PSDE exponent + significand: %.3d or %.2x\n",pt_uint8[1], pt_uint8[1]);
|
|
183
|
printf("pt_uint8[0] for PSDE exponent + significand: %.3d or %.2x\n",pt_uint8[0], pt_uint8[0]);
|
|
181
|
printf("pt_uint8[0] for PSDE significand: %.3d or %.2x\n",pt_uint8[0], pt_uint8[0]);
|
|
|
|
|
182
|
printf("lfr_bp1[i*NB_BYTES_BP1+0] : %.3d or %.2x\n",lfr_bp1[i*NB_BYTES_BP1+0], lfr_bp1[i*NB_BYTES_BP1+0]);
|
|
184
|
printf("lfr_bp1[i*NB_BYTES_BP1+1] : %.3d or %.2x\n",lfr_bp1[i*NB_BYTES_BP1+1], lfr_bp1[i*NB_BYTES_BP1+1]);
|
|
183
|
printf("lfr_bp1[i*NB_BYTES_BP1+1] : %.3d or %.2x\n",lfr_bp1[i*NB_BYTES_BP1+1], lfr_bp1[i*NB_BYTES_BP1+1]);
|
|
185
|
printf("lfr_bp1[i*NB_BYTES_BP1+0] : %.3d or %.2x\n",lfr_bp1[i*NB_BYTES_BP1+0], lfr_bp1[i*NB_BYTES_BP1+0]);
|
|
|
|
|
186
|
#endif
|
|
184
|
#endif
|
|
187
|
//==============================================================================
|
|
185
|
//==============================================================================
|
|
188
|
// BP1 normal wave vector == PA_LFR_SC_BP1_NVEC_V0_F0 == 8 bits
|
|
186
|
// BP1 normal wave vector == PA_LFR_SC_BP1_NVEC_V0_F0 == 8 bits
|
|
@@
-270,9
+268,9
void BP1_set( float * compressed_spec_ma
|
|
270
|
printf("lfr_bp1[i*NB_BYTES_BP1+6] for NVEC_V2 + ellipticity + DOP : %u\n",lfr_bp1[i*NB_BYTES_BP1+6]);
|
|
268
|
printf("lfr_bp1[i*NB_BYTES_BP1+6] for NVEC_V2 + ellipticity + DOP : %u\n",lfr_bp1[i*NB_BYTES_BP1+6]);
|
|
271
|
#endif
|
|
269
|
#endif
|
|
272
|
//=======================================================================================
|
|
270
|
//=======================================================================================
|
|
273
|
// BP1 X_SO-component of the Poynting flux == PA_LFR_SC_BP1_SX_F0 == 8 (+ 2) bits
|
|
271
|
// BP1 X_SO-component of the Poynting flux == PA_LFR_SC_BP1_SX_F0 == 16 bits
|
|
274
|
// = 5 bits (exponent) + 3 bits (significand)
|
|
272
|
// = 1 sign bit + 1 argument bit (two sectors)
|
|
275
|
// + 1 sign bit + 1 argument bit (two sectors)
|
|
273
|
// + 6 bits (exponent) + 8 bits (significand)
|
|
276
|
e_cross_b_re = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_SX_RE] //S34 Re
|
|
274
|
e_cross_b_re = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_SX_RE] //S34 Re
|
|
277
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_SX_RE] //S35 Re
|
|
275
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_SX_RE] //S35 Re
|
|
278
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+5] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K14_SX_RE] //S14 Re
|
|
276
|
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+5] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K14_SX_RE] //S14 Re
|
|
@@
-300,26
+298,23
void BP1_set( float * compressed_spec_ma
|
|
300
|
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_SX_RE] //S24 Im
|
|
298
|
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_SX_RE] //S24 Im
|
|
301
|
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_SX_RE]; //S25 Im
|
|
299
|
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_SX_RE]; //S25 Im
|
|
302
|
#ifdef DEBUG_TCH
|
|
300
|
#ifdef DEBUG_TCH
|
|
303
|
printf("ReaSX / 2 : %16.8e\n",e_cross_b_re/2);
|
|
301
|
printf("ReaSX : %16.8e\n",e_cross_b_re);
|
|
304
|
#endif
|
|
302
|
#endif
|
|
305
|
pt_uint8 = (uint8_t*) &e_cross_b_re; // Affect an uint8_t pointer with the adress of e_cross_b_re
|
|
303
|
pt_uint8 = (uint8_t*) &e_cross_b_re; // Affect an uint8_t pointer with the adress of e_cross_b_re
|
|
306
|
#ifdef LSB_FIRST_TCH
|
|
304
|
#ifdef LSB_FIRST_TCH
|
|
307
|
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)
|
|
305
|
lfr_bp1[i*NB_BYTES_BP1+7] = lfr_bp1[i*NB_BYTES_BP1+7] | (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention)
|
|
308
|
// Record it at the 8th bit position (from the right to the left)
|
|
306
|
// Record it at the 8th bit position (from the right to the left)
|
|
309
|
// of lfr_bp1[i*NB_BYTES_BP1+0]
|
|
307
|
// of lfr_bp1[i*NB_BYTES_BP1+7]
|
|
310
|
pt_uint8[3] = (pt_uint8[3] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
|
|
308
|
pt_uint8[3] = (pt_uint8[3] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
|
|
311
|
#endif
|
|
309
|
#endif
|
|
312
|
#ifdef MSB_FIRST_TCH
|
|
310
|
#ifdef MSB_FIRST_TCH
|
|
313
|
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)
|
|
311
|
lfr_bp1[i*NB_BYTES_BP1+7] = lfr_bp1[i*NB_BYTES_BP1+7] | (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 1th octet:SPARC convention)
|
|
314
|
// Record it at the 8th bit position (from the right to the left)
|
|
312
|
// Record it at the 8th bit position (from the right to the left)
|
|
315
|
// of lfr_bp1[i*NB_BYTES_BP1+0]
|
|
313
|
// of lfr_bp1[i*NB_BYTES_BP1+7]
|
|
316
|
pt_uint8[0] = (pt_uint8[0] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
|
|
314
|
pt_uint8[0] = (pt_uint8[0] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
|
|
317
|
#endif
|
|
315
|
#endif
|
|
318
|
significand = frexpf(e_cross_b_re/2, &exponent); // 0.5 <= significand < 1
|
|
316
|
significand = frexpf(e_cross_b_re, &exponent); // 0.5 <= significand < 1
|
|
319
|
// ReaSX/2 = significand * 2^exponent
|
|
317
|
// ReaSX = significand * 2^exponent
|
|
320
|
// The division by 2 is to ensure that max value <= 2^30 (rough estimate)
|
|
|
|
|
321
|
// Should be reconsidered by taking into account the k-coefficients ...
|
|
|
|
|
322
|
|
|
|
|
|
323
|
if (exponent < expmin) { // value should be >= 0.5 * 2^expmin
|
|
318
|
if (exponent < expmin) { // value should be >= 0.5 * 2^expmin
|
|
324
|
exponent = expmin;
|
|
319
|
exponent = expmin;
|
|
325
|
significand = 0.5; // min value that can be recorded
|
|
320
|
significand = 0.5; // min value that can be recorded
|
|
@@
-333,23
+328,22
void BP1_set( float * compressed_spec_ma
|
|
333
|
significand = 0.5; // min value that can be recorded
|
|
328
|
significand = 0.5; // min value that can be recorded
|
|
334
|
}
|
|
329
|
}
|
|
335
|
|
|
330
|
|
|
336
|
lfr_bp1[i*NB_BYTES_BP1+7] = (uint8_t) ((significand*2-1)*7 + 0.5); // Shift and cast into a 8-bit uint8_t with rounding
|
|
331
|
lfr_bp1[i*NB_BYTES_BP1+8] = (uint8_t) ((significand*2-1)*255 + 0.5); // Shift and cast into a 8-bit uint8_t with rounding
|
|
337
|
// where just the first 3 bits are used (0, ..., 7)
|
|
332
|
// where all bits are used (0, ..., 255)
|
|
338
|
tmp_uint8 = (uint8_t) (exponent-expmin); // Shift and cast into a 8-bit uint8_t where
|
|
333
|
tmp_uint8 = (uint8_t) (exponent-expmin); // Shift and cast into a 8-bit uint8_t where
|
|
339
|
// just the first 5 bits are used (0, ..., 2^5-1)
|
|
334
|
// just the first nbitexp bits are used (0, ..., 2^nbitexp-1)
|
|
340
|
#ifdef DEBUG_TCH
|
|
335
|
#ifdef DEBUG_TCH
|
|
341
|
printf("|ReaSX| / 2 : %16.8e\n",e_cross_b_re/2);
|
|
336
|
printf("|ReaSX| : %16.8e\n",e_cross_b_re);
|
|
342
|
printf("significand : %16.8e\n",significand);
|
|
337
|
printf("significand : %16.8e\n",significand);
|
|
343
|
printf("exponent : %d\n" ,exponent);
|
|
338
|
printf("exponent : %d\n" ,exponent);
|
|
344
|
printf("lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+7]);
|
|
|
|
|
345
|
printf("tmp_uint8 for ReaSX exponent : %d\n",tmp_uint8);
|
|
339
|
printf("tmp_uint8 for ReaSX exponent : %d\n",tmp_uint8);
|
|
346
|
#endif
|
|
340
|
#endif
|
|
347
|
lfr_bp1[i*NB_BYTES_BP1+7] = lfr_bp1[i*NB_BYTES_BP1+7] | (tmp_uint8 << 3); // Shift these 5 bits to the left before logical addition
|
|
341
|
lfr_bp1[i*NB_BYTES_BP1+7] = lfr_bp1[i*NB_BYTES_BP1+7] | tmp_uint8; // Record these nbitexp bits in the nbitexp first bits
|
|
348
|
// with lfr_bp1[i*NB_BYTES_BP1+7]
|
|
342
|
// (from the right to the left) of lfr_bp1[i*NB_BYTES_BP1+7]
|
|
349
|
#ifdef DEBUG_TCH
|
|
343
|
#ifdef DEBUG_TCH
|
|
350
|
printf("lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX exponent + significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+7]);
|
|
344
|
printf("lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX sign + RealSX exponent : %u\n",lfr_bp1[i*NB_BYTES_BP1+7]);
|
|
351
|
printf("lfr_bp1[i*NB_BYTES_BP1+0] for ReaSX sign + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+0]);
|
|
345
|
printf("lfr_bp1[i*NB_BYTES_BP1+8] for ReaSX significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+8]);
|
|
352
|
printf("ImaSX / 2 : %16.8e\n",e_cross_b_im/2);
|
|
346
|
printf("ImaSX : %16.8e\n",e_cross_b_im);
|
|
353
|
#endif
|
|
347
|
#endif
|
|
354
|
pt_uint8 = (uint8_t*) &e_cross_b_im; // Affect an uint8_t pointer with the adress of e_cross_b_im
|
|
348
|
pt_uint8 = (uint8_t*) &e_cross_b_im; // Affect an uint8_t pointer with the adress of e_cross_b_im
|
|
355
|
#ifdef LSB_FIRST_TCH
|
|
349
|
#ifdef LSB_FIRST_TCH
|
|
@@
-360,17
+354,17
void BP1_set( float * compressed_spec_ma
|
|
360
|
#endif
|
|
354
|
#endif
|
|
361
|
tmp_uint8 = (e_cross_b_im > e_cross_b_re) ? 0x40 : 0x00; // Determine the sector argument of SX. If |Im| > |Re| affect
|
|
355
|
tmp_uint8 = (e_cross_b_im > e_cross_b_re) ? 0x40 : 0x00; // Determine the sector argument of SX. If |Im| > |Re| affect
|
|
362
|
// an unsigned 8-bit char with 01000000; otherwise with null.
|
|
356
|
// an unsigned 8-bit char with 01000000; otherwise with null.
|
|
363
|
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
|
|
357
|
lfr_bp1[i*NB_BYTES_BP1+7] = lfr_bp1[i*NB_BYTES_BP1+7] | tmp_uint8; // Record it as a sign bit at the 7th bit position (from the right
|
|
364
|
// to the left) of lfr_bp1[i*NB_BYTES_BP1+0], by simple logical addition.
|
|
358
|
// to the left) of lfr_bp1[i*NB_BYTES_BP1+7], by simple logical addition.
|
|
365
|
#ifdef DEBUG_TCH
|
|
359
|
#ifdef DEBUG_TCH
|
|
366
|
printf("|ImaSX| / 2 : %16.8e\n",e_cross_b_im/2);
|
|
360
|
printf("|ImaSX| : %16.8e\n",e_cross_b_im);
|
|
367
|
printf("ArgSX sign : %u\n",tmp_uint8);
|
|
361
|
printf("ArgSX sign : %u\n",tmp_uint8);
|
|
368
|
printf("lfr_bp1[i*NB_BYTES_BP1+0] for ReaSX & ArgSX signs + PSDE 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+0]);
|
|
362
|
printf("lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX & ArgSX signs + ReaSX exponent : %u\n",lfr_bp1[i*NB_BYTES_BP1+7]);
|
|
369
|
#endif
|
|
363
|
#endif
|
|
370
|
//======================================================================
|
|
364
|
//======================================================================
|
|
371
|
// BP1 phase velocity estimator == PA_LFR_SC_BP1_VPHI_F0 == 8 (+ 2) bits
|
|
365
|
// BP1 phase velocity estimator == PA_LFR_SC_BP1_VPHI_F0 == 16 bits
|
|
372
|
// = 5 bits (exponent) + 3 bits (significand)
|
|
366
|
// = 1 sign bit + 1 argument bit (two sectors)
|
|
373
|
// + 1 sign bit + 1 argument bit (two sectors)
|
|
367
|
// + 6 bits (exponent) + 8 bits (significand)
|
|
374
|
ny = sin(alpha_M)*NVEC_V1 + cos(alpha_M)*NVEC_V2;
|
|
368
|
ny = sin(alpha_M)*NVEC_V1 + cos(alpha_M)*NVEC_V2;
|
|
375
|
nz = NVEC_V0;
|
|
369
|
nz = NVEC_V0;
|
|
376
|
bx_bx_star = cos(alpha_M)*cos(alpha_M)*compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+9] // S22 Re
|
|
370
|
bx_bx_star = cos(alpha_M)*cos(alpha_M)*compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+9] // S22 Re
|
|
@@
-418,15
+412,15
void BP1_set( float * compressed_spec_ma
|
|
418
|
// vphi = n_cross_e_scal_b_re / bx_bx_star => sign(VPHI) = sign(n_cross_e_scal_b_re)
|
|
412
|
// vphi = n_cross_e_scal_b_re / bx_bx_star => sign(VPHI) = sign(n_cross_e_scal_b_re)
|
|
419
|
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
|
|
413
|
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
|
|
420
|
#ifdef LSB_FIRST_TCH
|
|
414
|
#ifdef LSB_FIRST_TCH
|
|
421
|
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)
|
|
415
|
lfr_bp1[i*NB_BYTES_BP1+9] = lfr_bp1[i*NB_BYTES_BP1+9] | (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention)
|
|
422
|
// Record it at the 8th bit position (from the right to the left)
|
|
416
|
// Record it at the 8th bit position (from the right to the left)
|
|
423
|
// of lfr_bp1[i*NB_BYTES_BP1+2]
|
|
417
|
// of lfr_bp1[i*NB_BYTES_BP1+9]
|
|
424
|
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|
|
|
418
|
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|
|
|
425
|
#endif
|
|
419
|
#endif
|
|
426
|
#ifdef MSB_FIRST_TCH
|
|
420
|
#ifdef MSB_FIRST_TCH
|
|
427
|
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)
|
|
421
|
lfr_bp1[i*NB_BYTES_BP1+9] = lfr_bp1[i*NB_BYTES_BP1+9] | (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 1th octet:SPARC convention)
|
|
428
|
// Record it at the 8th bit position (from the right to the left)
|
|
422
|
// Record it at the 8th bit position (from the right to the left)
|
|
429
|
// of lfr_bp1[i*NB_BYTES_BP1+2]
|
|
423
|
// of lfr_bp1[i*NB_BYTES_BP1+9]
|
|
430
|
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|
|
|
424
|
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|
|
|
431
|
#endif
|
|
425
|
#endif
|
|
432
|
if (bx_bx_star != 0.) { // no division by 0.
|
|
426
|
if (bx_bx_star != 0.) { // no division by 0.
|
|
@@
-436,11
+430,8
void BP1_set( float * compressed_spec_ma
|
|
436
|
{
|
|
430
|
{
|
|
437
|
vphi = 1.e+20; // Put a huge value
|
|
431
|
vphi = 1.e+20; // Put a huge value
|
|
438
|
}
|
|
432
|
}
|
|
439
|
significand = frexpf(vphi/2, &exponent); // 0.5 <= significand < 1
|
|
433
|
significand = frexpf(vphi, &exponent); // 0.5 <= significand < 1
|
|
440
|
// vphi/2 = significand * 2^exponent
|
|
434
|
// vphi = significand * 2^exponent
|
|
441
|
// The division by 2 is to ensure that max value <= 2^30 (rough estimate)
|
|
|
|
|
442
|
// Should be reconsidered by taking into account the k-coefficients ...
|
|
|
|
|
443
|
|
|
|
|
|
444
|
if (exponent < expmin) { // value should be >= 0.5 * 2^expmin
|
|
435
|
if (exponent < expmin) { // value should be >= 0.5 * 2^expmin
|
|
445
|
exponent = expmin;
|
|
436
|
exponent = expmin;
|
|
446
|
significand = 0.5; // min value that can be recorded
|
|
437
|
significand = 0.5; // min value that can be recorded
|
|
@@
-453,41
+444,39
void BP1_set( float * compressed_spec_ma
|
|
453
|
exponent = expmin;
|
|
444
|
exponent = expmin;
|
|
454
|
significand = 0.5; // min value that can be recorded
|
|
445
|
significand = 0.5; // min value that can be recorded
|
|
455
|
}
|
|
446
|
}
|
|
|
|
|
447
|
|
|
|
|
|
448
|
lfr_bp1[i*NB_BYTES_BP1+10] = (uint8_t) ((significand*2-1)*255 + 0.5); // Shift and cast into a 8-bit uint8_t with rounding
|
|
|
|
|
449
|
// where all the bits are used (0, ..., 255)
|
|
|
|
|
450
|
tmp_uint8 = (uint8_t) (exponent-expmin); // Shift and cast into a 8-bit uint8_t where
|
|
|
|
|
451
|
// just the first nbitexp bits are used (0, ..., 2^nbitexp-1)
|
|
456
|
#ifdef DEBUG_TCH
|
|
452
|
#ifdef DEBUG_TCH
|
|
457
|
printf("|VPHI| / 2 : %16.8e\n",vphi/2);
|
|
453
|
printf("|VPHI| : %16.8e\n",vphi);
|
|
458
|
printf("significand : %16.8e\n",significand);
|
|
454
|
printf("significand : %16.8e\n",significand);
|
|
459
|
printf("exponent : %d\n" ,exponent);
|
|
455
|
printf("exponent : %d\n" ,exponent);
|
|
460
|
#endif
|
|
|
|
|
461
|
lfr_bp1[i*NB_BYTES_BP1+8] = (uint8_t) ((significand*2-1)*7 + 0.5); // Shift and cast into a 8-bit uint8_t with rounding
|
|
|
|
|
462
|
// where just the first 3 bits are used (0, ..., 7)
|
|
|
|
|
463
|
tmp_uint8 = (uint8_t) (exponent-expmin); // Shift and cast into a 8-bit uint8_t where
|
|
|
|
|
464
|
// just the first 5 bits are used (0, ..., 2^5-1)
|
|
|
|
|
465
|
#ifdef DEBUG_TCH
|
|
|
|
|
466
|
printf("lfr_bp1[i*NB_BYTES_BP1+8] for VPHI significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+8]);
|
|
|
|
|
467
|
printf("tmp_uint8 for VPHI exponent : %d\n",tmp_uint8);
|
|
456
|
printf("tmp_uint8 for VPHI exponent : %d\n",tmp_uint8);
|
|
468
|
#endif
|
|
457
|
#endif
|
|
469
|
lfr_bp1[i*NB_BYTES_BP1+8] = lfr_bp1[i*NB_BYTES_BP1+8] | (tmp_uint8 << 3); // shift these 5 bits to the left before logical addition
|
|
458
|
lfr_bp1[i*NB_BYTES_BP1+9] = lfr_bp1[i*NB_BYTES_BP1+9] | tmp_uint8; // Record these nbitexp bits in the nbitexp first bits
|
|
470
|
// with lfr_bp1[i*NB_BYTES_BP1+8]
|
|
459
|
// (from the right to the left) of lfr_bp1[i*NB_BYTES_BP1+9]
|
|
471
|
#ifdef DEBUG_TCH
|
|
460
|
#ifdef DEBUG_TCH
|
|
472
|
printf("lfr_bp1[i*NB_BYTES_BP1+8] for VPHI exponent + significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+8]);
|
|
461
|
printf("lfr_bp1[i*NB_BYTES_BP1+9] for VPHI sign + VPHI exponent : %u\n",lfr_bp1[i*NB_BYTES_BP1+9]);
|
|
473
|
printf("lfr_bp1[i*NB_BYTES_BP1+2] for VPHI sign + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+2]);
|
|
462
|
printf("lfr_bp1[i*NB_BYTES_BP1+10] for VPHI significand : %u\n",lfr_bp1[i*NB_BYTES_BP1+10]);
|
|
474
|
#endif
|
|
463
|
#endif
|
|
475
|
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
|
|
464
|
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
|
|
476
|
#ifdef LSB_FIRST_TCH
|
|
465
|
#ifdef LSB_FIRST_TCH
|
|
477
|
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)
|
|
466
|
pt_uint8[3] = pt_uint8[3] & 0x7f; // Make n_cross_e_scal_b_im be positive in any case: |ImaNEBX| (32-bit float, sign bit in the 4th octet:PC convention)
|
|
478
|
#endif
|
|
467
|
#endif
|
|
479
|
#ifdef MSB_FIRST_TCH
|
|
468
|
#ifdef MSB_FIRST_TCH
|
|
480
|
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)
|
|
469
|
pt_uint8[0] = pt_uint8[0] & 0x7f; // Make n_cross_e_scal_b_im be positive in any case: |ImaNEBX| (32-bit float, sign bit in the 1th octet:SPARC convention)
|
|
481
|
#endif
|
|
470
|
#endif
|
|
482
|
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
|
|
471
|
tmp_uint8 = (n_cross_e_scal_b_im > n_cross_e_scal_b_re) ? 0x40 : 0x00; // Determine the sector argument of NEBX. If |Im| > |Re| affect
|
|
483
|
// an unsigned 8-bit char with 01000000; otherwise with null.
|
|
472
|
// an unsigned 8-bit char with 01000000; otherwise with null.
|
|
484
|
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
|
|
473
|
lfr_bp1[i*NB_BYTES_BP1+9] = lfr_bp1[i*NB_BYTES_BP1+9] | tmp_uint8; // Record it as a sign bit at the 7th bit position (from the right
|
|
485
|
// to the left) of lfr_bp1[i*NB_BYTES_BP1+3], by simple logical addition.
|
|
474
|
// to the left) of lfr_bp1[i*NB_BYTES_BP1+9], by simple logical addition.
|
|
486
|
#ifdef DEBUG_TCH
|
|
475
|
#ifdef DEBUG_TCH
|
|
487
|
printf("|n_cross_e_scal_b_im| : %16.8e\n",n_cross_e_scal_b_im);
|
|
476
|
printf("|n_cross_e_scal_b_im| : %16.8e\n",n_cross_e_scal_b_im);
|
|
488
|
printf("|n_cross_e_scal_b_im|/bx_bx_star/2: %16.8e\n",n_cross_e_scal_b_im/bx_bx_star/2);
|
|
477
|
printf("|n_cross_e_scal_b_im|/bx_bx_star : %16.8e\n",n_cross_e_scal_b_im/bx_bx_star);
|
|
489
|
printf("ArgNEBX sign : %u\n",tmp_uint8);
|
|
478
|
printf("ArgNEBX sign : %u\n",tmp_uint8);
|
|
490
|
printf("lfr_bp1[i*NB_BYTES_BP1+2] for VPHI & ArgNEBX signs + PSDB 'exponent' : %u\n",lfr_bp1[i*NB_BYTES_BP1+2]);
|
|
479
|
printf("lfr_bp1[i*NB_BYTES_BP1+9] for VPHI & ArgNEBX signs + VPHI exponent : %u\n",lfr_bp1[i*NB_BYTES_BP1+9]);
|
|
491
|
#endif
|
|
480
|
#endif
|
|
492
|
}
|
|
481
|
}
|
|
493
|
}
|
|
482
|
}
|
|
@@
-519,12
+508,13
void BP2_set( float * compressed_spec_ma
|
|
519
|
nbitexp = 6; // number of bits for the exponent
|
|
508
|
nbitexp = 6; // number of bits for the exponent
|
|
520
|
nbitsig = 16 - nbitexp; // number of bits for the significand
|
|
509
|
nbitsig = 16 - nbitexp; // number of bits for the significand
|
|
521
|
rangesig = (1 << nbitsig)-1; // == 2^nbitsig - 1
|
|
510
|
rangesig = (1 << nbitsig)-1; // == 2^nbitsig - 1
|
|
522
|
expmax = 32;
|
|
511
|
expmax = 32 + 5;
|
|
523
|
expmin = expmax - (1 << nbitexp) + 1;
|
|
512
|
expmin = expmax - (1 << nbitexp) + 1;
|
|
524
|
|
|
513
|
|
|
525
|
#ifdef DEBUG_TCH
|
|
514
|
#ifdef DEBUG_TCH
|
|
526
|
printf("nbitexp : %d, nbitsig : %d, rangesig : %d\n", nbitexp, nbitsig, rangesig);
|
|
515
|
|
|
527
|
printf("expmin : %d, expmax : %d\n", expmin, expmax);
|
|
516
|
printf("nbitexp : %d, expmax : %d, expmin : %d\n", nbitexp, expmax, expmin);
|
|
|
|
|
517
|
printf("nbitsig : %d, rangesig : %d\n", nbitsig, rangesig);
|
|
528
|
#endif
|
|
518
|
#endif
|
|
529
|
|
|
519
|
|
|
530
|
for(i = 0; i<nb_bins_compressed_spec_mat; i++){
|
|
520
|
for(i = 0; i<nb_bins_compressed_spec_mat; i++){
|
|
@@
-769,9
+759,9
void BP2_set( float * compressed_spec_ma
|
|
769
|
printf("autocor for S11 significand : %u\n",autocor);
|
|
759
|
printf("autocor for S11 significand : %u\n",autocor);
|
|
770
|
printf("exp for S11 exponent : %u\n",exp);
|
|
760
|
printf("exp for S11 exponent : %u\n",exp);
|
|
771
|
printf("pt_uint8[1] for S11 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
761
|
printf("pt_uint8[1] for S11 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
772
|
printf("pt_uint8[0] for S11 exponent + significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
762
|
printf("pt_uint8[0] for S11 significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
|
|
|
763
|
printf("lfr_bp2[i*NB_BYTES_BP2+0] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+0], lfr_bp2[i*NB_BYTES_BP2+0]);
|
|
773
|
printf("lfr_bp2[i*NB_BYTES_BP2+1] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+1], lfr_bp2[i*NB_BYTES_BP2+1]);
|
|
764
|
printf("lfr_bp2[i*NB_BYTES_BP2+1] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+1], lfr_bp2[i*NB_BYTES_BP2+1]);
|
|
774
|
printf("lfr_bp2[i*NB_BYTES_BP2+0] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+0], lfr_bp2[i*NB_BYTES_BP2+0]);
|
|
|
|
|
775
|
#endif
|
|
765
|
#endif
|
|
776
|
// S22
|
|
766
|
// S22
|
|
777
|
significand = frexpf(compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+9], &exponent); // 0.5 <= significand < 1
|
|
767
|
significand = frexpf(compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+9], &exponent); // 0.5 <= significand < 1
|
|
@@
-814,9
+804,9
void BP2_set( float * compressed_spec_ma
|
|
814
|
printf("autocor for S22 significand : %u\n",autocor);
|
|
804
|
printf("autocor for S22 significand : %u\n",autocor);
|
|
815
|
printf("exp for S11 exponent : %u\n",exp);
|
|
805
|
printf("exp for S11 exponent : %u\n",exp);
|
|
816
|
printf("pt_uint8[1] for S22 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
806
|
printf("pt_uint8[1] for S22 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
817
|
printf("pt_uint8[0] for S22 exponent + significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
807
|
printf("pt_uint8[0] for S22 significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
|
|
|
808
|
printf("lfr_bp2[i*NB_BYTES_BP2+2] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+2], lfr_bp2[i*NB_BYTES_BP2+2]);
|
|
818
|
printf("lfr_bp2[i*NB_BYTES_BP2+3] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+3], lfr_bp2[i*NB_BYTES_BP2+3]);
|
|
809
|
printf("lfr_bp2[i*NB_BYTES_BP2+3] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+3], lfr_bp2[i*NB_BYTES_BP2+3]);
|
|
819
|
printf("lfr_bp2[i*NB_BYTES_BP2+2] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+2], lfr_bp2[i*NB_BYTES_BP2+2]);
|
|
|
|
|
820
|
#endif
|
|
810
|
#endif
|
|
821
|
// S33
|
|
811
|
// S33
|
|
822
|
significand = frexpf(compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+16], &exponent); // 0.5 <= significand < 1
|
|
812
|
significand = frexpf(compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+16], &exponent); // 0.5 <= significand < 1
|
|
@@
-859,9
+849,9
void BP2_set( float * compressed_spec_ma
|
|
859
|
printf("autocor for S33 significand : %u\n",autocor);
|
|
849
|
printf("autocor for S33 significand : %u\n",autocor);
|
|
860
|
printf("exp for S33 exponent : %u\n",exp);
|
|
850
|
printf("exp for S33 exponent : %u\n",exp);
|
|
861
|
printf("pt_uint8[1] for S33 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
851
|
printf("pt_uint8[1] for S33 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
862
|
printf("pt_uint8[0] for S33 exponent + significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
852
|
printf("pt_uint8[0] for S33 significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
|
|
|
853
|
printf("lfr_bp2[i*NB_BYTES_BP2+4] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+4], lfr_bp2[i*NB_BYTES_BP2+4]);
|
|
863
|
printf("lfr_bp2[i*NB_BYTES_BP2+5] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+5], lfr_bp2[i*NB_BYTES_BP2+5]);
|
|
854
|
printf("lfr_bp2[i*NB_BYTES_BP2+5] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+5], lfr_bp2[i*NB_BYTES_BP2+5]);
|
|
864
|
printf("lfr_bp2[i*NB_BYTES_BP2+4] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+4], lfr_bp2[i*NB_BYTES_BP2+4]);
|
|
|
|
|
865
|
#endif
|
|
855
|
#endif
|
|
866
|
// S44
|
|
856
|
// S44
|
|
867
|
significand = frexpf(compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+21], &exponent); // 0.5 <= significand < 1
|
|
857
|
significand = frexpf(compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+21], &exponent); // 0.5 <= significand < 1
|
|
@@
-905,9
+895,9
void BP2_set( float * compressed_spec_ma
|
|
905
|
printf("autocor for S44 significand : %u\n",autocor);
|
|
895
|
printf("autocor for S44 significand : %u\n",autocor);
|
|
906
|
printf("exp for S44 exponent : %u\n",exp);
|
|
896
|
printf("exp for S44 exponent : %u\n",exp);
|
|
907
|
printf("pt_uint8[1] for S44 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
897
|
printf("pt_uint8[1] for S44 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
908
|
printf("pt_uint8[0] for S44 exponent + significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
898
|
printf("pt_uint8[0] for S44 significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
|
|
|
899
|
printf("lfr_bp2[i*NB_BYTES_BP2+6] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+6], lfr_bp2[i*NB_BYTES_BP2+6]);
|
|
909
|
printf("lfr_bp2[i*NB_BYTES_BP2+7] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+7], lfr_bp2[i*NB_BYTES_BP2+7]);
|
|
900
|
printf("lfr_bp2[i*NB_BYTES_BP2+7] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+7], lfr_bp2[i*NB_BYTES_BP2+7]);
|
|
910
|
printf("lfr_bp2[i*NB_BYTES_BP2+6] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+6], lfr_bp2[i*NB_BYTES_BP2+6]);
|
|
|
|
|
911
|
#endif
|
|
901
|
#endif
|
|
912
|
// S55
|
|
902
|
// S55
|
|
913
|
significand = frexpf(compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+24], &exponent); // 0.5 <= significand < 1
|
|
903
|
significand = frexpf(compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+24], &exponent); // 0.5 <= significand < 1
|
|
@@
-952,9
+942,9
void BP2_set( float * compressed_spec_ma
|
|
952
|
printf("autocor for S55 significand : %u\n",autocor);
|
|
942
|
printf("autocor for S55 significand : %u\n",autocor);
|
|
953
|
printf("exp for S55 exponent : %u\n",exp);
|
|
943
|
printf("exp for S55 exponent : %u\n",exp);
|
|
954
|
printf("pt_uint8[1] for S55 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
944
|
printf("pt_uint8[1] for S55 exponent + significand : %.3d or %2x\n",pt_uint8[1], pt_uint8[1]);
|
|
955
|
printf("pt_uint8[0] for S55 exponent + significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
945
|
printf("pt_uint8[0] for S55 significand : %.3d or %2x\n",pt_uint8[0], pt_uint8[0]);
|
|
|
|
|
946
|
printf("lfr_bp2[i*NB_BYTES_BP2+8] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+8], lfr_bp2[i*NB_BYTES_BP2+8]);
|
|
956
|
printf("lfr_bp2[i*NB_BYTES_BP2+9] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+9], lfr_bp2[i*NB_BYTES_BP2+9]);
|
|
947
|
printf("lfr_bp2[i*NB_BYTES_BP2+9] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+9], lfr_bp2[i*NB_BYTES_BP2+9]);
|
|
957
|
printf("lfr_bp2[i*NB_BYTES_BP2+8] : %3u or %2x\n",lfr_bp2[i*NB_BYTES_BP2+8], lfr_bp2[i*NB_BYTES_BP2+8]);
|
|
|
|
|
958
|
#endif
|
|
948
|
#endif
|
|
959
|
}
|
|
949
|
}
|
|
960
|
}
|
|
950
|
}
|