From: Johnathan Corgan Date: Thu, 29 Oct 2009 15:10:20 +0000 (-0700) Subject: Added resampler and pushed matched filter into it. X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=2e9af20a77f56263255c4e2395953aec8573fcb1;p=debian%2Fgnuradio Added resampler and pushed matched filter into it. --- diff --git a/gr-pager/apps/usrp_rx_flex.grc b/gr-pager/apps/usrp_rx_flex.grc index 2d16e1cd..bf3d9abc 100644 --- a/gr-pager/apps/usrp_rx_flex.grc +++ b/gr-pager/apps/usrp_rx_flex.grc @@ -1,6 +1,6 @@ - Sat Oct 17 11:46:38 2009 + Thu Oct 29 08:08:45 2009 options @@ -187,6 +187,10 @@ avg_alpha 0 + + win + None + win_size @@ -325,29 +329,6 @@ 0 - - gr_quadrature_demod_cf - - id - fm_demod - - - _enabled - True - - - gain - demod_k - - - _coordinate - (599, 774) - - - _rotation - 0 - - gr_freq_xlating_fir_filter_xxx @@ -413,6 +394,10 @@ v_scale 8e3 + + v_offset + 0 + t_scale 20.0/channel_rate @@ -512,6 +497,10 @@ avg_alpha 0 + + win + None + win_size @@ -556,64 +545,6 @@ 0 - - gr_moving_average_xx - - id - gr_moving_average_xx_0 - - - _enabled - True - - - type - float - - - length - 8 - - - scale - 1.0/8.0 - - - max_iter - 4000 - - - _coordinate - (831, 758) - - - _rotation - 0 - - - - variable - - id - ma_ntaps - - - _enabled - True - - - value - channel_rate/symbol_rate - - - _coordinate - (833, 851) - - - _rotation - 0 - - variable @@ -637,29 +568,6 @@ 0 - - variable - - id - nchan_taps - - - _enabled - True - - - value - len(channel_taps) - - - _coordinate - (328, 1009) - - - _rotation - 0 - - variable @@ -990,61 +898,6 @@ 0 - - variable_slider - - id - offset - - - _enabled - True - - - label - Freq. Offset - - - value - saved_offset - - - min - -10e3 - - - max - 10e3 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - 0, 3, 1, 1 - - - notebook - - - - _coordinate - (518, 118) - - - _rotation - 0 - - variable_static_text @@ -1244,6 +1097,84 @@ 0 + + variable_slider + + id + offset + + + _enabled + True + + + label + Freq. Offset + + + value + saved_offset + + + min + -12.5e3 + + + max + 12.5e3 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + 0, 3, 1, 1 + + + notebook + + + + _coordinate + (518, 118) + + + _rotation + 0 + + + + variable + + id + ma_ntaps + + + _enabled + True + + + value + channel_rate/symbol_rate + + + _coordinate + (833, 851) + + + _rotation + 0 + + wxgui_scopesink2 @@ -1264,15 +1195,19 @@ samp_rate - channel_rate + 16e3 v_scale 1 + + v_offset + 0 + t_scale - 40.0/channel_rate + 40.0/16e3 ac_couple @@ -1300,13 +1235,179 @@ _coordinate - (797, 601) + (1029, 586) _rotation 180 + + gr_quadrature_demod_cf + + id + fm_demod + + + _enabled + True + + + gain + demod_k + + + _coordinate + (599, 774) + + + _rotation + 0 + + + + gr_moving_average_xx + + id + gr_moving_average_xx_0 + + + _enabled + False + + + type + float + + + length + 8 + + + scale + 1.0/8.0 + + + max_iter + 4000 + + + _coordinate + (815, 676) + + + _rotation + 0 + + + + blks2_rational_resampler_xxx + + id + blks2_rational_resampler_xxx_0 + + + _enabled + True + + + type + fff + + + decim + 8 + + + interp + 5 + + + taps + [1.0/8.0,]*40 + + + fractional_bw + 0 + + + _coordinate + (1029, 750) + + + _rotation + 0 + + + + virtual_sink + + id + virtual_sink_0 + + + _enabled + True + + + stream_id + baseband + + + _coordinate + (1260, 774) + + + _rotation + 0 + + + + variable + + id + baseband_rate + + + _enabled + True + + + value + 16000 + + + _coordinate + (1019, 17) + + + _rotation + 0 + + + + variable + + id + nchan_taps + + + _enabled + True + + + value + len(channel_taps) + + + _coordinate + (412, 931) + + + _rotation + 0 + + gr_freq_xlating_fir_filter_xxx_0 wxgui_fftsink2_1 @@ -1345,8 +1446,26 @@ gr_moving_average_xx_0 + blks2_rational_resampler_xxx_0 + 0 + 0 + + + blks2_rational_resampler_xxx_0 wxgui_scopesink2_0_0 0 0 + + fm_demod + blks2_rational_resampler_xxx_0 + 0 + 0 + + + blks2_rational_resampler_xxx_0 + virtual_sink_0 + 0 + 0 + diff --git a/gr-pager/apps/usrp_rx_flex.py b/gr-pager/apps/usrp_rx_flex.py index 73b11f90..cdc5da20 100755 --- a/gr-pager/apps/usrp_rx_flex.py +++ b/gr-pager/apps/usrp_rx_flex.py @@ -2,11 +2,13 @@ ################################################## # Gnuradio Python Flow Graph # Title: USRP FLEX Pager Receiver (Single Channel) -# Generated: Sat Oct 17 11:46:38 2009 +# Generated: Thu Oct 29 08:04:51 2009 ################################################## +from gnuradio import blks2 from gnuradio import eng_notation from gnuradio import gr +from gnuradio import window from gnuradio.eng_option import eng_option from gnuradio.gr import firdes from gnuradio.wxgui import fftsink2 @@ -147,8 +149,8 @@ class usrp_rx_flex(grc_wxgui.top_block_gui): sizer=_offset_sizer, value=self.offset, callback=self.set_offset, - minimum=-10e3, - maximum=10e3, + minimum=-12.5e3, + maximum=12.5e3, num_steps=100, style=wx.SL_HORIZONTAL, cast=float, @@ -167,9 +169,14 @@ class usrp_rx_flex(grc_wxgui.top_block_gui): ################################################## # Blocks ################################################## + self.blks2_rational_resampler_xxx_0 = blks2.rational_resampler_fff( + interpolation=5, + decimation=8, + taps=([1.0/8.0,]*40), + fractional_bw=None, + ) self.fm_demod = gr.quadrature_demod_cf(demod_k) self.gr_freq_xlating_fir_filter_xxx_0 = gr.freq_xlating_fir_filter_ccc(channel_decim, (channel_taps), band_freq-freq+offset, sample_rate) - self.gr_moving_average_xx_0 = gr.moving_average_ff(8, 1.0/8.0, 4000) self.usrp_source = grc_usrp.simple_source_c(which=0, side="A", rx_ant="RXA") self.usrp_source.set_decim_rate(decim) self.usrp_source.set_frequency(band_freq, verbose=True) @@ -211,6 +218,7 @@ class usrp_rx_flex(grc_wxgui.top_block_gui): title="Channel Waveform", sample_rate=channel_rate, v_scale=8e3, + v_offset=0, t_scale=20.0/channel_rate, ac_couple=False, xy_mode=False, @@ -220,9 +228,10 @@ class usrp_rx_flex(grc_wxgui.top_block_gui): self.wxgui_scopesink2_0_0 = scopesink2.scope_sink_f( self.displays.GetPage(1).GetWin(), title="Baseband", - sample_rate=channel_rate, + sample_rate=16e3, v_scale=1, - t_scale=40.0/channel_rate, + v_offset=0, + t_scale=40.0/16e3, ac_couple=False, xy_mode=False, num_inputs=1, @@ -237,8 +246,8 @@ class usrp_rx_flex(grc_wxgui.top_block_gui): self.connect((self.usrp_source, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.wxgui_scopesink2_0, 0)) self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.fm_demod, 0)) - self.connect((self.fm_demod, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.gr_moving_average_xx_0, 0), (self.wxgui_scopesink2_0_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_0, 0), (self.wxgui_scopesink2_0_0, 0)) + self.connect((self.fm_demod, 0), (self.blks2_rational_resampler_xxx_0, 0)) def set_config_filename(self, config_filename): self.config_filename = config_filename @@ -269,8 +278,8 @@ class usrp_rx_flex(grc_wxgui.top_block_gui): def set_symbol_rate(self, symbol_rate): self.symbol_rate = symbol_rate - self.set_ma_ntaps(self.channel_rate/self.symbol_rate) self.set_passband(2*(self.deviation+self.symbol_rate)) + self.set_ma_ntaps(self.channel_rate/self.symbol_rate) def set_saved_channel(self, saved_channel): self.saved_channel = saved_channel @@ -308,11 +317,10 @@ class usrp_rx_flex(grc_wxgui.top_block_gui): self.channel_rate = channel_rate self.wxgui_scopesink2_0.set_sample_rate(self.channel_rate) self.wxgui_fftsink2_1.set_sample_rate(self.channel_rate) - self.set_ma_ntaps(self.channel_rate/self.symbol_rate) self.set_channel_decim(int(self.sample_rate/self.channel_rate)) self.set_demod_k(3*self.channel_rate/(2*math.pi*self.deviation)) self.set_channel_taps(firdes.low_pass(10, self.sample_rate, self.passband/2.0, (self.channel_rate-self.passband)/2.0)) - self.wxgui_scopesink2_0_0.set_sample_rate(self.channel_rate) + self.set_ma_ntaps(self.channel_rate/self.symbol_rate) def set_channel(self, channel): self.channel = channel