Really use 64 data types for demodulation
This commit is contained in:
parent
71cdc75e77
commit
db4450e8a1
|
@ -422,7 +422,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
|
|||
// into the bits_outp word.
|
||||
*bits_outp = 0;
|
||||
for ( bitnum=0; bitnum<n_bits; bitnum++ )
|
||||
*bits_outp |= bit_values[bitnum] << bitnum;
|
||||
*bits_outp |= (unsigned long long) bit_values[bitnum] << bitnum;
|
||||
|
||||
debug_log(" frame algo=%u confidence=%f ampl=%f\n",
|
||||
CONFIDENCE_ALGO, confidence, *ampl_outp);
|
||||
|
@ -439,7 +439,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
|
|||
const char *expect_bits_string,
|
||||
unsigned long long *bits_outp,
|
||||
float *ampl_outp,
|
||||
unsigned long long *frame_start_outp
|
||||
unsigned int *frame_start_outp
|
||||
)
|
||||
{
|
||||
int expect_n_bits = strlen(expect_bits_string);
|
||||
|
@ -450,7 +450,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
|
|||
|
||||
unsigned int best_t = 0;
|
||||
float best_c = 0.0, best_a = 0.0;
|
||||
unsigned int best_bits = 0;
|
||||
unsigned long long best_bits = 0;
|
||||
|
||||
// Scan the frame positions starting with the one try_first_sample,
|
||||
// alternating between a step above that, a step below that, above, below,
|
||||
|
|
|
@ -67,7 +67,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
|
|||
const char *expect_bits_string,
|
||||
unsigned long long *bits_outp,
|
||||
float *ampl_outp,
|
||||
unsigned long long *frame_start_outp
|
||||
unsigned int *frame_start_outp
|
||||
);
|
||||
|
||||
int
|
||||
|
|
|
@ -1088,7 +1088,7 @@ main( int argc, char*argv[] )
|
|||
unsigned long long bits = 0;
|
||||
/* Note: frame_start_sample is actually the sample where the
|
||||
* prev_stop bit begins (since the "frame" includes the prev_stop). */
|
||||
unsigned long long frame_start_sample = 0;
|
||||
unsigned int frame_start_sample = 0;
|
||||
|
||||
unsigned int try_first_sample;
|
||||
float try_confidence_search_limit;
|
||||
|
@ -1203,7 +1203,7 @@ main( int argc, char*argv[] )
|
|||
try_confidence_search_limit = INFINITY;
|
||||
float confidence2, amplitude2;
|
||||
unsigned long long bits2;
|
||||
unsigned long long frame_start_sample2;
|
||||
unsigned int frame_start_sample2;
|
||||
confidence2 = fsk_find_frame(fskp, samplebuf, expect_nsamples,
|
||||
try_first_sample,
|
||||
try_max_nsamples,
|
||||
|
@ -1257,7 +1257,8 @@ main( int argc, char*argv[] )
|
|||
|
||||
// chop off framing bits
|
||||
unsigned int frame_bits_shift = bfsk_nstartbits;
|
||||
unsigned int frame_bits_mask = (int)(1<<bfsk_n_data_bits) - 1;
|
||||
unsigned long long frame_bits_mask = (long long)(1ULL<<bfsk_n_data_bits) - 1;
|
||||
fprintf(stderr, "Input: %08x%08x - Databits: %i - Shift: %i - Mask: %08x\n", (unsigned int)(bits >> 32), (unsigned int)bits, bfsk_n_data_bits, bfsk_nstartbits, frame_bits_mask);
|
||||
bits = ( bits >> frame_bits_shift ) & frame_bits_mask;
|
||||
|
||||
unsigned int dataout_size = 4096;
|
||||
|
|
Loading…
Reference in New Issue