diff --git a/qspectrumanalyzer/__main__.py b/qspectrumanalyzer/__main__.py index e96cc24..0a2d33a 100755 --- a/qspectrumanalyzer/__main__.py +++ b/qspectrumanalyzer/__main__.py @@ -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)) diff --git a/qspectrumanalyzer/backend.py b/qspectrumanalyzer/backend.py index 259db3b..62f76a1 100644 --- a/qspectrumanalyzer/backend.py +++ b/qspectrumanalyzer/backend.py @@ -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 diff --git a/qspectrumanalyzer/qspectrumanalyzer.ui b/qspectrumanalyzer/qspectrumanalyzer.ui index 238c9ab..2562645 100644 --- a/qspectrumanalyzer/qspectrumanalyzer.ui +++ b/qspectrumanalyzer/qspectrumanalyzer.ui @@ -265,10 +265,10 @@ 3 - 2800.000000000000000 + 5000.000000000000000 - 10.000000000000000 + 100.000000000000000 diff --git a/qspectrumanalyzer/ui_qspectrumanalyzer.py b/qspectrumanalyzer/ui_qspectrumanalyzer.py index db72b62..115af1d 100644 --- a/qspectrumanalyzer/ui_qspectrumanalyzer.py +++ b/qspectrumanalyzer/ui_qspectrumanalyzer.py @@ -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)