Live sample rate changing for RTL devices in modes_gui

This commit is contained in:
Nick Foster 2014-09-21 19:28:44 -07:00
parent 78c5500c80
commit 48f9c2a29a
2 changed files with 9 additions and 4 deletions

View File

@ -141,7 +141,12 @@ class modes_radio (gr.top_block, pubsub):
else:
self._rx_rate = rate
self._rx_path.set_rate(self._rx_rate)
return self._u.set_rate(rate) if self.live_source() else 0
if self._options.source in ("osmocom"):
return self._u.set_sample_rate(rate)
if self._options.source in ("uhd"):
return self._u.set_rate(rate)
else:
return 0
def set_threshold(self, threshold):
self._rx_path.set_threshold(threshold)

View File

@ -65,13 +65,13 @@ class rx_path(gr.hier_block2):
self.connect(self._sync, self._slicer)
def set_rate(self, rate):
self._sync.set_rate(rate)
self._sync.set_rate(int(rate))
self._spc = int(rate/2e6)
self._avg.set_length_and_scale(48*self._spc, 1.0/(48*self._spc))
if self._bb != self._demod:
self._pmf.set_length_and_scale(self._spc, 1.0/self._spc)
if self._dcblock is not None:
self._dcblock.set_length(100*self._spc)
# if self._dcblock is not None:
# self._dcblock.set_length(100*self._spc)
def set_threshold(self, threshold):
self._sync.set_threshold(threshold)