From 9c0c616efb9da93aa25731ca28d675b108ca649e Mon Sep 17 00:00:00 2001 From: mer0m Date: Thu, 27 Apr 2017 16:38:22 +0200 Subject: [PATCH] - --- redpitaya/client/iq_pid_vco.grc | 6 +++--- redpitaya/client/iq_pid_vco.py | 14 ++++++------- redpitaya/client/pid_only.py | 2 +- sdr/fm_radio/fm_radio.grc | 24 ++++++++++----------- sdr/fm_radio/fm_radio.py | 46 +++++++++++++++++++++++------------------ 5 files changed, 49 insertions(+), 43 deletions(-) diff --git a/redpitaya/client/iq_pid_vco.grc b/redpitaya/client/iq_pid_vco.grc index fc878d2..d6deec7 100644 --- a/redpitaya/client/iq_pid_vco.grc +++ b/redpitaya/client/iq_pid_vco.grc @@ -305,7 +305,7 @@ value - 0 + 21000000 _enabled @@ -368,7 +368,7 @@ value - 0 + 21000000 _enabled @@ -651,7 +651,7 @@ value - 0 + 42000000 _enabled diff --git a/redpitaya/client/iq_pid_vco.py b/redpitaya/client/iq_pid_vco.py index 38e3f8d..4566817 100755 --- a/redpitaya/client/iq_pid_vco.py +++ b/redpitaya/client/iq_pid_vco.py @@ -3,7 +3,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Iq Pid Vco -# Generated: Wed Apr 26 19:01:48 2017 +# Generated: Thu Apr 27 16:17:01 2017 ################################################## if __name__ == '__main__': @@ -62,13 +62,13 @@ class iq_pid_vco(gr.top_block, Qt.QWidget): self.pid_kp = pid_kp = 0 self.pid_ki = pid_ki = 0 self.pid_kd = pid_kd = 0 - self.demod_nco = demod_nco = 0 + self.demod_nco = demod_nco = 42000000 self.dds_range = dds_range = 0 self.dds_poff_sw = dds_poff_sw = 1 self.dds_pinc_sw = dds_pinc_sw = 1 self.dds_offset = dds_offset = 0 - self.dds_nco = dds_nco = 0 - self.dds_f0 = dds_f0 = 0 + self.dds_nco = dds_nco = 21000000 + self.dds_f0 = dds_f0 = 21000000 self.dds_ampl = dds_ampl = 0 self.dac2_offset = dac2_offset = 0 self.addr = addr = "192.168.0.202" @@ -101,7 +101,7 @@ class iq_pid_vco(gr.top_block, Qt.QWidget): self._pid_kd_range = Range(0, 2**13-1, 1, 0, 200) self._pid_kd_win = RangeWidget(self._pid_kd_range, self.set_pid_kd, 'pid_kd', "counter_slider", int) self.top_grid_layout.addWidget(self._pid_kd_win, 4, 1) - self._demod_nco_range = Range(0, 60000000, 1, 0, 200) + self._demod_nco_range = Range(0, 60000000, 1, 42000000, 200) self._demod_nco_win = RangeWidget(self._demod_nco_range, self.set_demod_nco, 'demod_nco', "counter_slider", int) self.top_grid_layout.addWidget(self._demod_nco_win, 3, 4) self._dds_range_range = Range(-2**13, 2**13-1, 1, 0, 200) @@ -124,10 +124,10 @@ class iq_pid_vco(gr.top_block, Qt.QWidget): self._dds_offset_range = Range(-2**13, 2**13-1, 1, 0, 200) self._dds_offset_win = RangeWidget(self._dds_offset_range, self.set_dds_offset, 'dds_offset', "counter_slider", int) self.top_grid_layout.addWidget(self._dds_offset_win, 3, 3) - self._dds_nco_range = Range(0, 60000000, 1, 0, 200) + self._dds_nco_range = Range(0, 60000000, 1, 21000000, 200) self._dds_nco_win = RangeWidget(self._dds_nco_range, self.set_dds_nco, 'dds_nco', "counter_slider", int) self.top_grid_layout.addWidget(self._dds_nco_win, 2, 3) - self._dds_f0_range = Range(0, 60000000, 1, 0, 200) + self._dds_f0_range = Range(0, 60000000, 1, 21000000, 200) self._dds_f0_win = RangeWidget(self._dds_f0_range, self.set_dds_f0, 'dds_f0', "counter_slider", int) self.top_grid_layout.addWidget(self._dds_f0_win, 4, 3) self._dds_ampl_range = Range(0, 2**13-1, 1, 0, 200) diff --git a/redpitaya/client/pid_only.py b/redpitaya/client/pid_only.py index e1ab246..6f5cc14 100755 --- a/redpitaya/client/pid_only.py +++ b/redpitaya/client/pid_only.py @@ -3,7 +3,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Pid Only -# Generated: Wed Apr 19 09:35:59 2017 +# Generated: Thu Apr 27 15:50:24 2017 ################################################## if __name__ == '__main__': diff --git a/sdr/fm_radio/fm_radio.grc b/sdr/fm_radio/fm_radio.grc index 548e38e..5820c3b 100644 --- a/sdr/fm_radio/fm_radio.grc +++ b/sdr/fm_radio/fm_radio.grc @@ -89,7 +89,7 @@ value - 160011000 + 158000000 _enabled @@ -215,7 +215,7 @@ quad_rate - samp_rate*10 + samp_rate*8 @@ -340,7 +340,7 @@ _enabled - 1 + 0 type @@ -376,7 +376,7 @@ samp_rate - samp_rate*10*4 + samp_rate*8*4 width @@ -415,7 +415,7 @@ _enabled - 1 + 0 type @@ -451,7 +451,7 @@ samp_rate - samp_rate*10 + samp_rate*8 width @@ -466,7 +466,7 @@ qtgui_sink_x bw - samp_rate*10*4 + samp_rate*8*4 alias @@ -565,7 +565,7 @@ qtgui_sink_x bw - samp_rate*10 + samp_rate*8 alias @@ -680,7 +680,7 @@ _enabled - 0 + 1 fbw @@ -735,11 +735,11 @@ decim - 10 + 8 _enabled - 0 + 1 fbw @@ -2178,7 +2178,7 @@ sample_rate - samp_rate*10*4 + samp_rate*8*4 sync diff --git a/sdr/fm_radio/fm_radio.py b/sdr/fm_radio/fm_radio.py index 7b21c77..be94353 100755 --- a/sdr/fm_radio/fm_radio.py +++ b/sdr/fm_radio/fm_radio.py @@ -3,7 +3,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Fm Radio -# Generated: Tue Apr 11 17:29:18 2017 +# Generated: Thu Apr 27 16:24:59 2017 ################################################## if __name__ == '__main__': @@ -62,16 +62,16 @@ class fm_radio(gr.top_block, Qt.QWidget): # Variables ################################################## self.samp_rate = samp_rate = 48e3 - self.freq = freq = 160011000 + self.freq = freq = 158000000 ################################################## # Blocks ################################################## - self._freq_range = Range(52e6, 2e9, 1e3, 160011000, 200) + self._freq_range = Range(52e6, 2e9, 1e3, 158000000, 200) self._freq_win = RangeWidget(self._freq_range, self.set_freq, "freq", "counter_slider", float) self.top_grid_layout.addWidget(self._freq_win, 0,0) self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + '' ) - self.rtlsdr_source_0.set_sample_rate(samp_rate*10*4) + self.rtlsdr_source_0.set_sample_rate(samp_rate*8*4) self.rtlsdr_source_0.set_center_freq(freq, 0) self.rtlsdr_source_0.set_freq_corr(0, 0) self.rtlsdr_source_0.set_dc_offset_mode(0, 0) @@ -83,11 +83,23 @@ class fm_radio(gr.top_block, Qt.QWidget): self.rtlsdr_source_0.set_antenna('', 0) self.rtlsdr_source_0.set_bandwidth(0, 0) + self.rational_resampler_xxx_0_0 = filter.rational_resampler_ccc( + interpolation=1, + decimation=8, + taps=None, + fractional_bw=None, + ) + self.rational_resampler_xxx_0 = filter.rational_resampler_fff( + interpolation=1, + decimation=4, + taps=None, + fractional_bw=None, + ) self.qtgui_sink_x_1 = qtgui.sink_f( 1024, #fftsize firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc - samp_rate*10, #bw + samp_rate*8, #bw "", #name True, #plotfreq True, #plotwaterfall @@ -106,7 +118,7 @@ class fm_radio(gr.top_block, Qt.QWidget): 1024, #fftsize firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc - samp_rate*10*4, #bw + samp_rate*8*4, #bw "", #name True, #plotfreq True, #plotwaterfall @@ -121,25 +133,21 @@ class fm_radio(gr.top_block, Qt.QWidget): - self.low_pass_filter_0_0 = filter.fir_filter_fff(10, firdes.low_pass( - 1, samp_rate*10, samp_rate*2, 1e4, firdes.WIN_HAMMING, 6.76)) - self.low_pass_filter_0 = filter.fir_filter_ccf(4, firdes.low_pass( - 1, samp_rate*10*4, 500e3, 10e3, firdes.WIN_HAMMING, 6.76)) self.audio_sink_0 = audio.sink(int(samp_rate), '', True) self.analog_wfm_rcv_0 = analog.wfm_rcv( - quad_rate=samp_rate*10, + quad_rate=samp_rate*8, audio_decimation=1, ) ################################################## # Connections ################################################## - self.connect((self.analog_wfm_rcv_0, 0), (self.low_pass_filter_0_0, 0)) self.connect((self.analog_wfm_rcv_0, 0), (self.qtgui_sink_x_1, 0)) - self.connect((self.low_pass_filter_0, 0), (self.analog_wfm_rcv_0, 0)) - self.connect((self.low_pass_filter_0_0, 0), (self.audio_sink_0, 0)) - self.connect((self.rtlsdr_source_0, 0), (self.low_pass_filter_0, 0)) + self.connect((self.analog_wfm_rcv_0, 0), (self.rational_resampler_xxx_0, 0)) + self.connect((self.rational_resampler_xxx_0, 0), (self.audio_sink_0, 0)) + self.connect((self.rational_resampler_xxx_0_0, 0), (self.analog_wfm_rcv_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.qtgui_sink_x_0, 0)) + self.connect((self.rtlsdr_source_0, 0), (self.rational_resampler_xxx_0_0, 0)) def closeEvent(self, event): self.settings = Qt.QSettings("GNU Radio", "fm_radio") @@ -151,11 +159,9 @@ class fm_radio(gr.top_block, Qt.QWidget): def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate - self.rtlsdr_source_0.set_sample_rate(self.samp_rate*10*4) - self.qtgui_sink_x_1.set_frequency_range(0, self.samp_rate*10) - self.qtgui_sink_x_0.set_frequency_range(0, self.samp_rate*10*4) - self.low_pass_filter_0_0.set_taps(firdes.low_pass(1, self.samp_rate*10, self.samp_rate*2, 1e4, firdes.WIN_HAMMING, 6.76)) - self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate*10*4, 500e3, 10e3, firdes.WIN_HAMMING, 6.76)) + self.rtlsdr_source_0.set_sample_rate(self.samp_rate*8*4) + self.qtgui_sink_x_1.set_frequency_range(0, self.samp_rate*8) + self.qtgui_sink_x_0.set_frequency_range(0, self.samp_rate*8*4) def get_freq(self): return self.freq -- 2.16.4