From ef5c0fbd539a3fc8bf327483bf5e295e9b3df434 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Mon, 30 May 2011 21:00:57 -0700 Subject: [PATCH] cosmetics --- src/lib/air_modes_preamble.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/air_modes_preamble.cc b/src/lib/air_modes_preamble.cc index 17efbe6..f5e2992 100644 --- a/src/lib/air_modes_preamble.cc +++ b/src/lib/air_modes_preamble.cc @@ -112,8 +112,12 @@ int air_modes_preamble::work(int noutput_items, float avgpeak = (bit_energies[0] + bit_energies[1] + bit_energies[2] + bit_energies[3]) / 4; - float space_threshold = bit_energies[0] / d_threshold; //set the threshold requirement for spaces (0 chips) to threshold dB below the current peak - //search between pulses and all the way out to 8.0us to make sure there are no pulses inside the "0" chips. make sure all the samples are <= (inraw[peak] * d_threshold). + //set the threshold requirement for spaces (0 chips) to + //threshold dB below the current peak + float space_threshold = bit_energies[0] / d_threshold; + //search between pulses and all the way out to 8.0us to make + //sure there are no pulses inside the "0" chips. make sure + //all the samples are <= (inraw[peak] * d_threshold). //so 0.5us has to be < space_threshold, as does (1.5-3), 4, (5-7.5) in order to qualify. for(int j = 1.5 * d_samples_per_symbol; j <= 3 * d_samples_per_symbol; j+=d_samples_per_chip) if(inraw[i+j] > space_threshold) valid_preamble = false;