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:52:38 -07:00
parent 628003fbe6
commit 85da74b43a
4 changed files with 6 additions and 6 deletions

View File

@ -48,8 +48,8 @@ class mainwindow(QtGui.QMainWindow):
#should round to actual achieved gain
self.ui.line_gain.insert("30")
#default to 3dB
self.ui.line_threshold.insert("3")
#default to 5dB
self.ui.line_threshold.insert("5")
self.ui.prog_rssi.setMinimum(-40)
self.ui.prog_rssi.setMaximum(0)

View File

@ -151,7 +151,7 @@ if __name__ == '__main__':
help="set RF gain", metavar="dB")
parser.add_option("-r", "--rate", type="eng_float", default=4000000,
help="set ADC sample rate [default=%default]")
parser.add_option("-T", "--threshold", type="eng_float", default=3.0,
parser.add_option("-T", "--threshold", type="eng_float", default=5.0,
help="set pulse detection threshold above noise in dB [default=%default]")
parser.add_option("-a","--output-all", action="store_true", default=False,
help="output all frames")

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);

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));