summaryrefslogtreecommitdiff
path: root/gr-noaa/apps/usrp_rx_hrpt.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-noaa/apps/usrp_rx_hrpt.py')
-rwxr-xr-xgr-noaa/apps/usrp_rx_hrpt.py43
1 files changed, 31 insertions, 12 deletions
diff --git a/gr-noaa/apps/usrp_rx_hrpt.py b/gr-noaa/apps/usrp_rx_hrpt.py
index 032db315d..6c50a348a 100755
--- a/gr-noaa/apps/usrp_rx_hrpt.py
+++ b/gr-noaa/apps/usrp_rx_hrpt.py
@@ -2,7 +2,7 @@
##################################################
# Gnuradio Python Flow Graph
# Title: USRP HRPT Receiver
-# Generated: Sun Sep 20 12:45:30 2009
+# Generated: Sun Sep 20 19:09:57 2009
##################################################
from gnuradio import eng_notation
@@ -20,18 +20,23 @@ import wx
class usrp_rx_hrpt(grc_wxgui.top_block_gui):
- def __init__(self):
+ def __init__(self, filename="", decim=16):
grc_wxgui.top_block_gui.__init__(self, title="USRP HRPT Receiver")
##################################################
+ # Parameters
+ ##################################################
+ self.filename = filename
+ self.decim = decim
+
+ ##################################################
# Variables
##################################################
- self.decim = decim = 16
self.sym_rate = sym_rate = 600*1109
self.sample_rate = sample_rate = 64e6/decim
self.sps = sps = sample_rate/sym_rate
- self.sync_alpha = sync_alpha = 0.005
- self.pll_alpha = pll_alpha = 0.001
+ self.sync_alpha = sync_alpha = 0.1
+ self.pll_alpha = pll_alpha = 0.005
self.max_sync_offset = max_sync_offset = 0.01
self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate
self.hs = hs = int(sps/2.0)
@@ -98,7 +103,11 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
# Blocks
##################################################
self.agr = gr.agc_cc(1e-6, 1.0, 1.0, 1.0)
+ self.gr_deinterleave_0 = gr.deinterleave(gr.sizeof_float*1)
self.gr_file_sink_1 = gr.file_sink(gr.sizeof_short*1, "frames.dat")
+ self.gr_file_source_0 = gr.file_source(gr.sizeof_short*1, "filename", False)
+ self.gr_float_to_complex_0 = gr.float_to_complex(1)
+ self.gr_short_to_float_0 = gr.short_to_float()
self.matched_filter = gr.moving_average_cc(hs, 1.0/hs, 4000)
self.noaa_hrpt_deframer_0 = noaa.hrpt_deframer()
self.noaa_hrpt_pll_cf_0 = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset)
@@ -119,7 +128,6 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
peak_hold=False,
)
self.displays.GetPage(0).GridAdd(self.rx_fftsink.win, 0, 0, 1, 1)
- self.src = gr.file_source(gr.sizeof_gr_complex*1, "poes-d16.dat", False)
self.throttle = gr.throttle(gr.sizeof_gr_complex*1, sample_rate)
self.wxgui_scopesink2_0 = scopesink2.scope_sink_c(
self.displays.GetPage(0).GetWin(),
@@ -147,16 +155,23 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
##################################################
# Connections
##################################################
+ self.connect((self.throttle, 0), (self.agr, 0))
self.connect((self.noaa_hrpt_deframer_0, 0), (self.gr_file_sink_1, 0))
self.connect((self.noaa_hrpt_sync_fb_0, 0), (self.noaa_hrpt_deframer_0, 0))
self.connect((self.noaa_hrpt_pll_cf_0, 0), (self.noaa_hrpt_sync_fb_0, 0))
self.connect((self.noaa_hrpt_pll_cf_0, 0), (self.wxgui_scopesink2_0_0, 0))
self.connect((self.agr, 0), (self.wxgui_scopesink2_0, 0))
self.connect((self.agr, 0), (self.rx_fftsink, 0))
- self.connect((self.throttle, 0), (self.agr, 0))
- self.connect((self.src, 0), (self.throttle, 0))
self.connect((self.agr, 0), (self.matched_filter, 0))
self.connect((self.matched_filter, 0), (self.noaa_hrpt_pll_cf_0, 0))
+ self.connect((self.gr_float_to_complex_0, 0), (self.throttle, 0))
+ self.connect((self.gr_short_to_float_0, 0), (self.gr_deinterleave_0, 0))
+ self.connect((self.gr_deinterleave_0, 1), (self.gr_float_to_complex_0, 1))
+ self.connect((self.gr_deinterleave_0, 0), (self.gr_float_to_complex_0, 0))
+ self.connect((self.gr_file_source_0, 0), (self.gr_short_to_float_0, 0))
+
+ def set_filename(self, filename):
+ self.filename = filename
def set_decim(self, decim):
self.decim = decim
@@ -168,11 +183,11 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
def set_sample_rate(self, sample_rate):
self.sample_rate = sample_rate
- self.set_sps(self.sample_rate/self.sym_rate)
- self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate)
self.wxgui_scopesink2_0_0.set_sample_rate(self.sample_rate)
- self.rx_fftsink.set_sample_rate(self.sample_rate)
self.wxgui_scopesink2_0.set_sample_rate(self.sample_rate)
+ self.rx_fftsink.set_sample_rate(self.sample_rate)
+ self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate)
+ self.set_sps(self.sample_rate/self.sym_rate)
def set_sps(self, sps):
self.sps = sps
@@ -206,7 +221,11 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
if __name__ == '__main__':
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
+ parser.add_option("-f", "--filename", dest="filename", type="string", default="",
+ help="Set Filename [default=%default]")
+ parser.add_option("-d", "--decim", dest="decim", type="intx", default=16,
+ help="Set Decimation [default=%default]")
(options, args) = parser.parse_args()
- tb = usrp_rx_hrpt()
+ tb = usrp_rx_hrpt(filename=options.filename, decim=options.decim)
tb.Run(True)