increased default and maximum bin size settings

This commit is contained in:
Michael Ossmann 2017-02-10 17:04:54 -07:00
parent ab431554aa
commit 76c3ad2b55
4 changed files with 9 additions and 5 deletions

View File

@ -225,7 +225,7 @@ class QSpectrumAnalyzerMainWindow(QtGui.QMainWindow, Ui_QSpectrumAnalyzerMainWin
settings = QtCore.QSettings()
self.startFreqSpinBox.setValue(settings.value("start_freq", 88.0, float))
self.stopFreqSpinBox.setValue(settings.value("stop_freq", 108.0, float))
self.binSizeSpinBox.setValue(settings.value("bin_size", 10.0, float))
self.binSizeSpinBox.setValue(settings.value("bin_size", 100.0, float))
self.intervalSpinBox.setValue(settings.value("interval", 10.0, float))
self.gainSpinBox.setValue(settings.value("gain", 0, int))
self.ppmSpinBox.setValue(settings.value("ppm", 0, int))

View File

@ -65,6 +65,8 @@ class RtlPowerThread(RtlPowerBaseThread):
def setup(self, start_freq, stop_freq, bin_size, interval=10.0, gain=-1,
ppm=0, crop=0, single_shot=False, device_index=0, sample_rate=2560000):
"""Setup rtl_power params"""
if bin_size > 2800:
bin_size = 2800
self.params = {
"start_freq": start_freq,
"stop_freq": stop_freq,
@ -153,6 +155,8 @@ class RtlPowerFftwThread(RtlPowerBaseThread):
min_overhang = sample_rate * overlap * 0.01
hops = math.ceil((freq_range - min_overhang) / (sample_rate - min_overhang))
overhang = (hops * sample_rate - freq_range) / (hops - 1) if hops > 1 else 0
if bin_size > 2800:
bin_size = 2800
bins = math.ceil(sample_rate / (bin_size * 1e3))
crop_freq = sample_rate * crop * 0.01

View File

@ -265,10 +265,10 @@
<number>3</number>
</property>
<property name="maximum">
<double>2800.000000000000000</double>
<double>5000.000000000000000</double>
</property>
<property name="value">
<double>10.000000000000000</double>
<double>100.000000000000000</double>
</property>
</widget>
</item>

View File

@ -148,8 +148,8 @@ class Ui_QSpectrumAnalyzerMainWindow(object):
self.binSizeSpinBox.setSizePolicy(sizePolicy)
self.binSizeSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.binSizeSpinBox.setDecimals(3)
self.binSizeSpinBox.setMaximum(2800.0)
self.binSizeSpinBox.setProperty("value", 10.0)
self.binSizeSpinBox.setMaximum(5000.0)
self.binSizeSpinBox.setProperty("value", 100.0)
self.binSizeSpinBox.setObjectName(_fromUtf8("binSizeSpinBox"))
self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.binSizeSpinBox)
spacerItem1 = QtGui.QSpacerItem(20, 0, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)