Fix preamble/slicer dB numbers. Was using power ratios for voltages (2.0 instead of 1.414 for 3dB, etc.). No real performance change.

Fix suggested by Denis Gapotchenko.
This commit is contained in:
Nick Foster
2012-10-13 20:55:45 -07:00
parent 628003fbe6
commit 85da74b43a
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ air_modes_preamble::air_modes_preamble(int channel_rate, float threshold_db) :
d_samples_per_symbol = d_samples_per_chip * 2;
d_check_width = 120 * d_samples_per_symbol; //only search to this far from the end of the stream buffer
d_threshold_db = threshold_db;
d_threshold = powf(10., threshold_db/10.); //the level that the sample must be above the moving average in order to qualify as a pulse
d_threshold = powf(10., threshold_db/20.); //the level that the sample must be above the moving average in order to qualify as a pulse
d_secs_per_sample = 1.0 / channel_rate;
set_output_multiple(1+d_check_width*2);
+2 -2
View File
@@ -65,8 +65,8 @@ static slice_result_t slicer(const float bit0, const float bit1, const float ref
slice_result_t result;
//3dB limits for bit slicing and confidence measurement
float highlimit=ref*2;
float lowlimit=ref*0.5;
float highlimit=ref*1.414;
float lowlimit=ref*0.707;
bool firstchip_inref = ((bit0 > lowlimit) && (bit0 < highlimit));
bool secondchip_inref = ((bit1 > lowlimit) && (bit1 < highlimit));