|
@@ -79,6 +79,7 @@ class fm_radio(gr.top_block, Qt.QWidget):
|
|
self.samp_rate = samp_rate = 2560000
|
|
self.samp_rate = samp_rate = 2560000
|
|
self.frequency_mhz = frequency_mhz = 98.3
|
|
self.frequency_mhz = frequency_mhz = 98.3
|
|
self.channel_width_hertz = channel_width_hertz = 250000
|
|
self.channel_width_hertz = channel_width_hertz = 250000
|
|
|
|
+ self.audio_sample_rate_hertz = audio_sample_rate_hertz = 48000
|
|
|
|
|
|
##################################################
|
|
##################################################
|
|
# Blocks
|
|
# Blocks
|
|
@@ -102,7 +103,7 @@ class fm_radio(gr.top_block, Qt.QWidget):
|
|
self.rtlsdr_source_0.set_antenna('', 0)
|
|
self.rtlsdr_source_0.set_antenna('', 0)
|
|
self.rtlsdr_source_0.set_bandwidth(0, 0)
|
|
self.rtlsdr_source_0.set_bandwidth(0, 0)
|
|
self.rational_resampler_xxx_0 = filter.rational_resampler_fff(
|
|
self.rational_resampler_xxx_0 = filter.rational_resampler_fff(
|
|
- interpolation=48000,
|
|
|
|
|
|
+ interpolation=audio_sample_rate_hertz,
|
|
decimation=channel_width_hertz,
|
|
decimation=channel_width_hertz,
|
|
taps=None,
|
|
taps=None,
|
|
fractional_bw=None)
|
|
fractional_bw=None)
|
|
@@ -191,7 +192,7 @@ class fm_radio(gr.top_block, Qt.QWidget):
|
|
firdes.WIN_KAISER,
|
|
firdes.WIN_KAISER,
|
|
6.76))
|
|
6.76))
|
|
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_ff(volume)
|
|
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_ff(volume)
|
|
- self.audio_sink_0 = audio.sink(48000, '', True)
|
|
|
|
|
|
+ self.audio_sink_0 = audio.sink(audio_sample_rate_hertz, '', True)
|
|
self.analog_wfm_rcv_0 = analog.wfm_rcv(
|
|
self.analog_wfm_rcv_0 = analog.wfm_rcv(
|
|
quad_rate=channel_width_hertz,
|
|
quad_rate=channel_width_hertz,
|
|
audio_decimation=1,
|
|
audio_decimation=1,
|
|
@@ -246,6 +247,12 @@ class fm_radio(gr.top_block, Qt.QWidget):
|
|
self.channel_width_hertz = channel_width_hertz
|
|
self.channel_width_hertz = channel_width_hertz
|
|
self.qtgui_freq_sink_x_0.set_frequency_range(0, self.channel_width_hertz)
|
|
self.qtgui_freq_sink_x_0.set_frequency_range(0, self.channel_width_hertz)
|
|
|
|
|
|
|
|
+ def get_audio_sample_rate_hertz(self):
|
|
|
|
+ return self.audio_sample_rate_hertz
|
|
|
|
+
|
|
|
|
+ def set_audio_sample_rate_hertz(self, audio_sample_rate_hertz):
|
|
|
|
+ self.audio_sample_rate_hertz = audio_sample_rate_hertz
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
def main(top_block_cls=fm_radio, options=None):
|
|
def main(top_block_cls=fm_radio, options=None):
|