apps: filter bandwidth follows sample rate in osmocom_fft
This commit is contained in:
parent
b97cac30c6
commit
217872a785
|
@ -121,6 +121,7 @@ class app_top_block(stdgui2.std_top_block, pubsub):
|
||||||
options.center_freq = float(r.start()+r.stop())/2
|
options.center_freq = float(r.start()+r.stop())/2
|
||||||
|
|
||||||
input_rate = self.src.set_sample_rate(options.samp_rate)
|
input_rate = self.src.set_sample_rate(options.samp_rate)
|
||||||
|
self.src.set_bandwidth(input_rate)
|
||||||
|
|
||||||
self.src.set_gain(options.gain)
|
self.src.set_gain(options.gain)
|
||||||
|
|
||||||
|
@ -410,6 +411,12 @@ class app_top_block(stdgui2.std_top_block, pubsub):
|
||||||
self.scope.set_sample_rate(samp_rate)
|
self.scope.set_sample_rate(samp_rate)
|
||||||
if self._verbose:
|
if self._verbose:
|
||||||
print "Set sample rate to:", samp_rate
|
print "Set sample rate to:", samp_rate
|
||||||
|
|
||||||
|
try:
|
||||||
|
self[BWIDTH_KEY] = self.set_bandwidth(samp_rate)
|
||||||
|
except RuntimeError:
|
||||||
|
pass
|
||||||
|
|
||||||
return samp_rate
|
return samp_rate
|
||||||
|
|
||||||
def get_gain_names(self):
|
def get_gain_names(self):
|
||||||
|
@ -436,6 +443,8 @@ class app_top_block(stdgui2.std_top_block, pubsub):
|
||||||
if self._verbose:
|
if self._verbose:
|
||||||
print "Set bandwidth to:", bw
|
print "Set bandwidth to:", bw
|
||||||
|
|
||||||
|
return bw
|
||||||
|
|
||||||
def set_freq_from_callback(self, freq):
|
def set_freq_from_callback(self, freq):
|
||||||
freq = self.src.set_center_freq(freq)
|
freq = self.src.set_center_freq(freq)
|
||||||
self[CENTER_FREQ_KEY] = freq;
|
self[CENTER_FREQ_KEY] = freq;
|
||||||
|
|
Loading…
Reference in New Issue