From 65bcd58b65219408268e5db1b8fbafb2d3ccc215 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Mon, 7 Sep 2009 13:22:16 -0700 Subject: [PATCH] Updated HRPT blocks/scripts for testing. Seeing good minor frame sync's. * Change PLL and SYNC blocks to output floats * Correct bit sense * Update RX script to record ascii bits --- gr-noaa/grc/Makefile.am | 4 +- ...a_hrpt_pll_cc.xml => noaa_hrpt_pll_cf.xml} | 6 +- ...hrpt_sync_cc.xml => noaa_hrpt_sync_ff.xml} | 8 +- gr-noaa/grc/usrp_rx_hrpt.grc | 599 ++++++++++-------- gr-noaa/grc/usrp_rx_hrpt.py | 78 +-- gr-noaa/lib/Makefile.am | 8 +- ...oaa_hrpt_pll_cc.cc => noaa_hrpt_pll_cf.cc} | 24 +- ...{noaa_hrpt_pll_cc.h => noaa_hrpt_pll_cf.h} | 20 +- ...a_hrpt_sync_cc.cc => noaa_hrpt_sync_ff.cc} | 32 +- ...oaa_hrpt_sync_cc.h => noaa_hrpt_sync_ff.h} | 20 +- gr-noaa/swig/Makefile.am | 4 +- ...{noaa_hrpt_pll_cc.i => noaa_hrpt_pll_cf.i} | 10 +- ...oaa_hrpt_sync_cc.i => noaa_hrpt_sync_ff.i} | 10 +- gr-noaa/swig/noaa_swig.i | 8 +- 14 files changed, 445 insertions(+), 386 deletions(-) rename gr-noaa/grc/{noaa_hrpt_pll_cc.xml => noaa_hrpt_pll_cf.xml} (84%) rename gr-noaa/grc/{noaa_hrpt_sync_cc.xml => noaa_hrpt_sync_ff.xml} (83%) rename gr-noaa/lib/{noaa_hrpt_pll_cc.cc => noaa_hrpt_pll_cf.cc} (76%) rename gr-noaa/lib/{noaa_hrpt_pll_cc.h => noaa_hrpt_pll_cf.h} (76%) rename gr-noaa/lib/{noaa_hrpt_sync_cc.cc => noaa_hrpt_sync_ff.cc} (70%) rename gr-noaa/lib/{noaa_hrpt_sync_cc.h => noaa_hrpt_sync_ff.h} (78%) rename gr-noaa/swig/{noaa_hrpt_pll_cc.i => noaa_hrpt_pll_cf.i} (83%) rename gr-noaa/swig/{noaa_hrpt_sync_cc.i => noaa_hrpt_sync_ff.i} (83%) diff --git a/gr-noaa/grc/Makefile.am b/gr-noaa/grc/Makefile.am index c7552977..fa2c40c8 100644 --- a/gr-noaa/grc/Makefile.am +++ b/gr-noaa/grc/Makefile.am @@ -28,8 +28,8 @@ dist_bin_SCRIPTS = \ usrp_rx_lrit.py dist_grcblocks_DATA = \ - noaa_hrpt_pll_cc.xml \ - noaa_hrpt_sync_cc.xml + noaa_hrpt_pll_cf.xml \ + noaa_hrpt_sync_ff.xml EXTRA_DIST = \ usrp_rx_hrpt.grc \ diff --git a/gr-noaa/grc/noaa_hrpt_pll_cc.xml b/gr-noaa/grc/noaa_hrpt_pll_cf.xml similarity index 84% rename from gr-noaa/grc/noaa_hrpt_pll_cc.xml rename to gr-noaa/grc/noaa_hrpt_pll_cf.xml index e56e0b05..bbe15e8c 100644 --- a/gr-noaa/grc/noaa_hrpt_pll_cc.xml +++ b/gr-noaa/grc/noaa_hrpt_pll_cf.xml @@ -1,10 +1,10 @@ HRPT PLL - noaa_hrpt_pll_cc + noaa_hrpt_pll_cf NOAA from gnuradio import noaa - noaa.hrpt_pll_cc($alpha, $beta, $max_offset) + noaa.hrpt_pll_cf($alpha, $beta, $max_offset) set_alpha($alpha) set_beta($beta) set_max_offset($max_offset) @@ -29,6 +29,6 @@ out - complex + float diff --git a/gr-noaa/grc/noaa_hrpt_sync_cc.xml b/gr-noaa/grc/noaa_hrpt_sync_ff.xml similarity index 83% rename from gr-noaa/grc/noaa_hrpt_sync_cc.xml rename to gr-noaa/grc/noaa_hrpt_sync_ff.xml index d311aa94..91b83ad5 100644 --- a/gr-noaa/grc/noaa_hrpt_sync_cc.xml +++ b/gr-noaa/grc/noaa_hrpt_sync_ff.xml @@ -1,10 +1,10 @@ HRPT SYNC - noaa_hrpt_sync_cc + noaa_hrpt_sync_ff NOAA from gnuradio import noaa - noaa.hrpt_sync_cc($alpha, $beta, $sps, $max_offset) + noaa.hrpt_sync_ff($alpha, $beta, $sps, $max_offset) set_alpha($alpha) set_beta($beta) set_max_offset($max_offset) @@ -30,10 +30,10 @@ in - complex + float out - complex + float diff --git a/gr-noaa/grc/usrp_rx_hrpt.grc b/gr-noaa/grc/usrp_rx_hrpt.grc index b304bd35..41aa1958 100644 --- a/gr-noaa/grc/usrp_rx_hrpt.grc +++ b/gr-noaa/grc/usrp_rx_hrpt.grc @@ -1,6 +1,6 @@ - Sat Aug 29 13:16:19 2009 + Mon Sep 7 13:05:09 2009 options @@ -106,41 +106,6 @@ 0 - - gr_file_source - - id - src - - - _enabled - True - - - file - poes-d16.dat - - - type - complex - - - repeat - True - - - vlen - 1 - - - _coordinate - (34, 423) - - - _rotation - 0 - - variable @@ -257,45 +222,78 @@ - variable + wxgui_fftsink2 id - max_carrier_offset + rx_fftsink _enabled True - value - 2*math.pi*100e3/sample_rate + type + complex - _coordinate - (668, 107) + title + RX Spectrum - _rotation - 0 + samp_rate + sample_rate - - - variable - id - max_sync_offset + baseband_freq + 1698e6 - _enabled + y_per_div + 5 + + + y_divs + 8 + + + ref_level + 20 + + + ref_scale + 2.0 + + + fft_size + 1024 + + + fft_rate + 30 + + + peak_hold + False + + + average True - value - 0.01 + avg_alpha + 0.1 + + + grid_pos + 0, 0, 1, 1 + + + notebook + displays, 0 _coordinate - (665, 173) + (433, 297) _rotation @@ -306,7 +304,7 @@ wxgui_scopesink2 id - wxgui_scopesink2_0_0 + wxgui_scopesink2_0 _enabled @@ -318,7 +316,7 @@ title - Post-PLL + RX Waveform samp_rate @@ -326,7 +324,7 @@ v_scale - 0.5 + 0 t_scale @@ -346,42 +344,62 @@ grid_pos - 0, 0, 1, 1 + 1, 0, 1, 1 notebook - displays, 1 + displays, 0 _coordinate - (618, 335) + (434, 603) _rotation - 180 + 0 - notebook + variable_slider id - displays + pll_alpha _enabled True + + label + PLL Alpha + + + value + 0.001 + + + min + 0.0 + + + max + 0.5 + + + num_steps + 500 + style - wx.NB_TOP + wx.SL_HORIZONTAL - labels - ['RX','PLL','SYNC'] + converver + float_converter grid_pos - 1, 0, 1, 2 + 0, 0, 1, 1 notebook @@ -389,7 +407,7 @@ _coordinate - (9, 99) + (192, 100) _rotation @@ -397,93 +415,100 @@ - wxgui_scopesink2 + variable_slider id - wxgui_scopesink2_0_0_0 + sync_alpha _enabled True - type - complex + label + SYNC Alpha - title - Post-PLL + value + 0.001 - samp_rate - sample_rate + min + 0.0 - v_scale + max 0.5 - t_scale - 20.0/sample_rate - - - ac_couple - False + num_steps + 500 - xy_mode - True + style + wx.SL_HORIZONTAL - num_inputs - 1 + converver + float_converter grid_pos - 1, 0, 1, 1 + 0, 1, 1, 1 notebook - displays, 1 + _coordinate - (618, 614) + (344, 101) _rotation - 180 + 0 - noaa_hrpt_sync_cc + variable id - sync + max_carrier_offset _enabled True - alpha - sync_alpha + value + 2*math.pi*100e3/sample_rate - beta - sync_alpha**2/4.0 + _coordinate + (671, 14) - sps - sps + _rotation + 0 + + + variable - max_offset + id max_sync_offset + + _enabled + True + + + value + 0.01 + _coordinate - (865, 494) + (805, 13) _rotation @@ -491,69 +516,84 @@ - wxgui_scopesink2 + gr_file_source id - wxgui_scopesink2_0_0_0_0 + src _enabled True + + file + poes-d16.dat + type complex - title - Post-SYNC + repeat + False - samp_rate - sym_rate + vlen + 1 - v_scale - 0.5 + _coordinate + (34, 423) - t_scale - 20.0/sym_rate + _rotation + 0 + + + gr_agc_xx - ac_couple - False + id + agr - xy_mode + _enabled True - num_inputs - 1 + type + complex - grid_pos - 1, 0, 1, 1 + rate + 1e-6 - notebook - displays, 2 + reference + 1.0 + + + gain + 1.0 + + + max_gain + 1.0 _coordinate - (872, 607) + (261, 494) _rotation - 180 + 0 wxgui_scopesink2 id - wxgui_scopesink2_0_0_1 + wxgui_scopesink2_0_0 _enabled @@ -561,15 +601,15 @@ type - complex + float title - Post-SYNC + Post-PLL samp_rate - sym_rate + sample_rate v_scale @@ -577,7 +617,7 @@ t_scale - 20.0/sym_rate + 20.0/sample_rate ac_couple @@ -597,11 +637,11 @@ notebook - displays, 2 + displays, 1 _coordinate - (872, 341) + (618, 335) _rotation @@ -609,38 +649,30 @@ - gr_agc_xx + noaa_hrpt_pll_cf id - agr + noaa_hrpt_pll_cf_0 _enabled True - type - complex - - - rate - 1e-6 - - - reference - 1.0 + alpha + pll_alpha - gain - 1.0 + beta + pll_alpha**2/4.0 - max_gain - 1.0 + max_offset + max_carrier_offset _coordinate - (261, 494) + (639, 502) _rotation @@ -648,10 +680,10 @@ - noaa_hrpt_pll_cc + noaa_hrpt_sync_ff id - noaa_hrpt_pll_cc_0 + noaa_hrpt_sync_ff_0 _enabled @@ -659,19 +691,23 @@ alpha - pll_alpha + .005 beta - pll_alpha**2/4.0 + .005*.005/4.0 + + + sps + sps max_offset - max_carrier_offset + max_sync_offset _coordinate - (628, 502) + (876, 494) _rotation @@ -679,74 +715,91 @@ - wxgui_fftsink2 + gr_binary_slicer_fb id - rx_fftsink + gr_binary_slicer_fb_0 _enabled True - type - complex + _coordinate + (1108, 522) - title - RX Spectrum + _rotation + 0 + + + virtual_sink - samp_rate - sample_rate + id + virtual_sink_1 - baseband_freq - 1698e6 + _enabled + True - y_per_div - 5 + stream_id + bits - y_divs - 8 + _coordinate + (1289, 518) - ref_level - 20 + _rotation + 0 + + + gr_file_sink - fft_size - 1024 + id + gr_file_sink_0 - fft_rate - 30 + _enabled + True - peak_hold - False + file + bits.dat - average - True + type + byte - avg_alpha - 0.1 + vlen + 1 - grid_pos - 0, 0, 1, 1 + _coordinate + (981, 919) - notebook - displays, 0 + _rotation + 0 + + + + gr_char_to_float + + id + gr_char_to_float_0 + + + _enabled + True _coordinate - (433, 297) + (477, 923) _rotation @@ -754,58 +807,72 @@ - wxgui_scopesink2 + gr_float_to_char id - wxgui_scopesink2_0 + gr_float_to_char_0 _enabled True - type - complex + _coordinate + (809, 923) - title - RX Waveform + _rotation + 0 + + + gr_add_const_vxx - samp_rate - sample_rate + id + gr_add_const_vxx_0 - v_scale - 0 + _enabled + True - t_scale - 20.0/sample_rate + type + float - ac_couple - False + const + 48.0 - xy_mode - False + vlen + 1 - num_inputs - 1 + _coordinate + (653, 919) - grid_pos - 1, 0, 1, 1 + _rotation + 0 + + + virtual_source - notebook - displays, 0 + id + virtual_source_0 + + + _enabled + True + + + stream_id + bits _coordinate - (434, 603) + (283, 919) _rotation @@ -813,101 +880,85 @@ - variable_slider + wxgui_scopesink2 id - pll_alpha + wxgui_scopesink2_0_0_0_0 _enabled True - label - PLL Alpha + type + float - value - 0.001 + title + Post-SYNC - min - 0.0 + samp_rate + sym_rate - max + v_scale 0.5 - num_steps - 500 + t_scale + 20.0/sym_rate - style - wx.SL_HORIZONTAL + ac_couple + False - converver - float_converter + xy_mode + False + + + num_inputs + 1 grid_pos - 0, 0, 1, 1 + 1, 0, 1, 1 notebook - + displays, 1 _coordinate - (192, 100) + (872, 607) _rotation - 0 + 180 - variable_slider + notebook id - sync_alpha + displays _enabled True - - label - SYNC Alpha - - - value - 0.001 - - - min - 0.0 - - - max - 0.5 - - - num_steps - 500 - style - wx.SL_HORIZONTAL + wx.NB_TOP - converver - float_converter + labels + ['RX','PLL/SYNC'] grid_pos - 0, 1, 1, 1 + 1, 0, 1, 2 notebook @@ -915,7 +966,7 @@ _coordinate - (344, 101) + (9, 99) _rotation @@ -947,38 +998,62 @@ 0 - noaa_hrpt_pll_cc_0 - wxgui_scopesink2_0_0 + gr_binary_slicer_fb_0 + virtual_sink_1 0 0 - noaa_hrpt_pll_cc_0 - wxgui_scopesink2_0_0_0 + agr + noaa_hrpt_pll_cf_0 0 0 - noaa_hrpt_pll_cc_0 - sync + noaa_hrpt_pll_cf_0 + wxgui_scopesink2_0_0 0 0 - sync - wxgui_scopesink2_0_0_1 + noaa_hrpt_pll_cf_0 + noaa_hrpt_sync_ff_0 0 0 - sync + noaa_hrpt_sync_ff_0 + gr_binary_slicer_fb_0 + 0 + 0 + + + noaa_hrpt_sync_ff_0 wxgui_scopesink2_0_0_0_0 0 0 - agr - noaa_hrpt_pll_cc_0 + virtual_source_0 + gr_char_to_float_0 + 0 + 0 + + + gr_float_to_char_0 + gr_file_sink_0 + 0 + 0 + + + gr_add_const_vxx_0 + gr_float_to_char_0 + 0 + 0 + + + gr_char_to_float_0 + gr_add_const_vxx_0 0 0 diff --git a/gr-noaa/grc/usrp_rx_hrpt.py b/gr-noaa/grc/usrp_rx_hrpt.py index 5cfaf784..74e35267 100755 --- a/gr-noaa/grc/usrp_rx_hrpt.py +++ b/gr-noaa/grc/usrp_rx_hrpt.py @@ -2,12 +2,14 @@ ################################################## # Gnuradio Python Flow Graph # Title: USRP HRPT Receiver -# Generated: Sat Aug 29 13:16:19 2009 +# Generated: Mon Sep 7 13:05:09 2009 ################################################## +from gnuradio import eng_notation from gnuradio import gr from gnuradio import noaa from gnuradio.eng_option import eng_option +from gnuradio.gr import firdes from gnuradio.wxgui import fftsink2 from gnuradio.wxgui import forms from gnuradio.wxgui import scopesink2 @@ -39,8 +41,7 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): ################################################## self.displays = wx.Notebook(self.GetWin(), style=wx.NB_TOP) self.displays.AddPage(grc_wxgui.Panel(self.displays), "RX") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "PLL") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "SYNC") + self.displays.AddPage(grc_wxgui.Panel(self.displays), "PLL/SYNC") self.GridAdd(self.displays, 1, 0, 1, 2) ################################################## @@ -97,13 +98,20 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): # Blocks ################################################## self.agr = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - self.noaa_hrpt_pll_cc_0 = noaa.hrpt_pll_cc(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) + self.gr_add_const_vxx_0 = gr.add_const_vff((48.0, )) + self.gr_binary_slicer_fb_0 = gr.binary_slicer_fb() + self.gr_char_to_float_0 = gr.char_to_float() + self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, "bits.dat") + self.gr_float_to_char_0 = gr.float_to_char() + self.noaa_hrpt_pll_cf_0 = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) + self.noaa_hrpt_sync_ff_0 = noaa.hrpt_sync_ff(.005, .005*.005/4.0, sps, max_sync_offset) self.rx_fftsink = fftsink2.fft_sink_c( self.displays.GetPage(0).GetWin(), baseband_freq=1698e6, y_per_div=5, y_divs=8, ref_level=20, + ref_scale=2.0, sample_rate=sample_rate, fft_size=1024, fft_rate=30, @@ -113,8 +121,7 @@ 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", True) - self.sync = noaa.hrpt_sync_cc(sync_alpha, sync_alpha**2/4.0, sps, max_sync_offset) + 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(), @@ -127,7 +134,7 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): num_inputs=1, ) self.displays.GetPage(0).GridAdd(self.wxgui_scopesink2_0.win, 1, 0, 1, 1) - self.wxgui_scopesink2_0_0 = scopesink2.scope_sink_c( + self.wxgui_scopesink2_0_0 = scopesink2.scope_sink_f( self.displays.GetPage(1).GetWin(), title="Post-PLL", sample_rate=sample_rate, @@ -138,30 +145,8 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): num_inputs=1, ) self.displays.GetPage(1).GridAdd(self.wxgui_scopesink2_0_0.win, 0, 0, 1, 1) - self.wxgui_scopesink2_0_0_0 = scopesink2.scope_sink_c( + self.wxgui_scopesink2_0_0_0_0 = scopesink2.scope_sink_f( self.displays.GetPage(1).GetWin(), - title="Post-PLL", - sample_rate=sample_rate, - v_scale=0.5, - t_scale=20.0/sample_rate, - ac_couple=False, - xy_mode=True, - num_inputs=1, - ) - self.displays.GetPage(1).GridAdd(self.wxgui_scopesink2_0_0_0.win, 1, 0, 1, 1) - self.wxgui_scopesink2_0_0_0_0 = scopesink2.scope_sink_c( - self.displays.GetPage(2).GetWin(), - title="Post-SYNC", - sample_rate=sym_rate, - v_scale=0.5, - t_scale=20.0/sym_rate, - ac_couple=False, - xy_mode=True, - num_inputs=1, - ) - self.displays.GetPage(2).GridAdd(self.wxgui_scopesink2_0_0_0_0.win, 1, 0, 1, 1) - self.wxgui_scopesink2_0_0_1 = scopesink2.scope_sink_c( - self.displays.GetPage(2).GetWin(), title="Post-SYNC", sample_rate=sym_rate, v_scale=0.5, @@ -170,7 +155,7 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): xy_mode=False, num_inputs=1, ) - self.displays.GetPage(2).GridAdd(self.wxgui_scopesink2_0_0_1.win, 0, 0, 1, 1) + self.displays.GetPage(1).GridAdd(self.wxgui_scopesink2_0_0_0_0.win, 1, 0, 1, 1) ################################################## # Connections @@ -179,12 +164,15 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): self.connect((self.throttle, 0), (self.agr, 0)) self.connect((self.agr, 0), (self.rx_fftsink, 0)) self.connect((self.agr, 0), (self.wxgui_scopesink2_0, 0)) - self.connect((self.noaa_hrpt_pll_cc_0, 0), (self.wxgui_scopesink2_0_0, 0)) - self.connect((self.noaa_hrpt_pll_cc_0, 0), (self.wxgui_scopesink2_0_0_0, 0)) - self.connect((self.noaa_hrpt_pll_cc_0, 0), (self.sync, 0)) - self.connect((self.sync, 0), (self.wxgui_scopesink2_0_0_1, 0)) - self.connect((self.sync, 0), (self.wxgui_scopesink2_0_0_0_0, 0)) - self.connect((self.agr, 0), (self.noaa_hrpt_pll_cc_0, 0)) + self.connect((self.agr, 0), (self.noaa_hrpt_pll_cf_0, 0)) + self.connect((self.noaa_hrpt_pll_cf_0, 0), (self.wxgui_scopesink2_0_0, 0)) + self.connect((self.noaa_hrpt_pll_cf_0, 0), (self.noaa_hrpt_sync_ff_0, 0)) + self.connect((self.noaa_hrpt_sync_ff_0, 0), (self.gr_binary_slicer_fb_0, 0)) + self.connect((self.noaa_hrpt_sync_ff_0, 0), (self.wxgui_scopesink2_0_0_0_0, 0)) + self.connect((self.gr_binary_slicer_fb_0, 0), (self.gr_char_to_float_0, 0)) + self.connect((self.gr_float_to_char_0, 0), (self.gr_file_sink_0, 0)) + self.connect((self.gr_add_const_vxx_0, 0), (self.gr_float_to_char_0, 0)) + self.connect((self.gr_char_to_float_0, 0), (self.gr_add_const_vxx_0, 0)) def set_decim(self, decim): self.decim = decim @@ -194,16 +182,14 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): self.sym_rate = sym_rate self.set_sps(self.sample_rate/self.sym_rate) self.wxgui_scopesink2_0_0_0_0.set_sample_rate(self.sym_rate) - self.wxgui_scopesink2_0_0_1.set_sample_rate(self.sym_rate) 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.wxgui_scopesink2_0_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.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) + self.wxgui_scopesink2_0_0.set_sample_rate(self.sample_rate) def set_sps(self, sps): self.sps = sps @@ -211,25 +197,23 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): def set_sync_alpha(self, sync_alpha): self.sync_alpha = sync_alpha - self.sync.set_alpha(self.sync_alpha) - self.sync.set_beta(self.sync_alpha**2/4.0) self._sync_alpha_slider.set_value(self.sync_alpha) self._sync_alpha_text_box.set_value(self.sync_alpha) def set_pll_alpha(self, pll_alpha): self.pll_alpha = pll_alpha - self.noaa_hrpt_pll_cc_0.set_alpha(self.pll_alpha) - self.noaa_hrpt_pll_cc_0.set_beta(self.pll_alpha**2/4.0) self._pll_alpha_slider.set_value(self.pll_alpha) self._pll_alpha_text_box.set_value(self.pll_alpha) + self.noaa_hrpt_pll_cf_0.set_alpha(self.pll_alpha) + self.noaa_hrpt_pll_cf_0.set_beta(self.pll_alpha**2/4.0) def set_max_sync_offset(self, max_sync_offset): self.max_sync_offset = max_sync_offset - self.sync.set_max_offset(self.max_sync_offset) + self.noaa_hrpt_sync_ff_0.set_max_offset(self.max_sync_offset) def set_max_carrier_offset(self, max_carrier_offset): self.max_carrier_offset = max_carrier_offset - self.noaa_hrpt_pll_cc_0.set_max_offset(self.max_carrier_offset) + self.noaa_hrpt_pll_cf_0.set_max_offset(self.max_carrier_offset) def set_hs(self, hs): self.hs = hs diff --git a/gr-noaa/lib/Makefile.am b/gr-noaa/lib/Makefile.am index 2690ddb5..91363878 100644 --- a/gr-noaa/lib/Makefile.am +++ b/gr-noaa/lib/Makefile.am @@ -29,8 +29,8 @@ lib_LTLIBRARIES = \ libgnuradio-noaa.la libgnuradio_noaa_la_SOURCES = \ - noaa_hrpt_pll_cc.cc \ - noaa_hrpt_sync_cc.cc + noaa_hrpt_pll_cf.cc \ + noaa_hrpt_sync_ff.cc libgnuradio_noaa_la_LIBADD = \ $(GNURADIO_CORE_LA) @@ -38,5 +38,5 @@ libgnuradio_noaa_la_LIBADD = \ libgnuradio_noaa_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0 grinclude_HEADERS = \ - noaa_hrpt_pll_cc.h \ - noaa_hrpt_sync_cc.h + noaa_hrpt_pll_cf.h \ + noaa_hrpt_sync_ff.h diff --git a/gr-noaa/lib/noaa_hrpt_pll_cc.cc b/gr-noaa/lib/noaa_hrpt_pll_cf.cc similarity index 76% rename from gr-noaa/lib/noaa_hrpt_pll_cc.cc rename to gr-noaa/lib/noaa_hrpt_pll_cf.cc index 46fe24da..08ab1d15 100644 --- a/gr-noaa/lib/noaa_hrpt_pll_cc.cc +++ b/gr-noaa/lib/noaa_hrpt_pll_cf.cc @@ -24,23 +24,23 @@ #include "config.h" #endif -#include +#include #include #include #include #define M_TWOPI (2*M_PI) -noaa_hrpt_pll_cc_sptr -noaa_make_hrpt_pll_cc(float alpha, float beta, float max_offset) +noaa_hrpt_pll_cf_sptr +noaa_make_hrpt_pll_cf(float alpha, float beta, float max_offset) { - return gnuradio::get_initial_sptr(new noaa_hrpt_pll_cc(alpha, beta, max_offset)); + return gnuradio::get_initial_sptr(new noaa_hrpt_pll_cf(alpha, beta, max_offset)); } -noaa_hrpt_pll_cc::noaa_hrpt_pll_cc(float alpha, float beta, float max_offset) - : gr_sync_block("noaa_hrpt_pll_cc", +noaa_hrpt_pll_cf::noaa_hrpt_pll_cf(float alpha, float beta, float max_offset) + : gr_sync_block("noaa_hrpt_pll_cf", gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(1, 1, sizeof(gr_complex))), + gr_make_io_signature(1, 1, sizeof(float))), d_alpha(alpha), d_beta(beta), d_max_offset(max_offset), d_phase(0.0), d_freq(0.0) { @@ -58,12 +58,12 @@ phase_wrap(float phase) } int -noaa_hrpt_pll_cc::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +noaa_hrpt_pll_cf::work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; + float *out = (float *) output_items[0]; for (int i = 0; i < noutput_items; i++) { @@ -75,7 +75,7 @@ noaa_hrpt_pll_cc::work(int noutput_items, // Generate and mix out carrier float re, im; gr_sincosf(d_phase, &im, &re); - out[i] = in[i]*gr_complex(re, -im); + out[i] = (in[i]*gr_complex(re, -im)).imag(); } return noutput_items; diff --git a/gr-noaa/lib/noaa_hrpt_pll_cc.h b/gr-noaa/lib/noaa_hrpt_pll_cf.h similarity index 76% rename from gr-noaa/lib/noaa_hrpt_pll_cc.h rename to gr-noaa/lib/noaa_hrpt_pll_cf.h index 81045440..507d47fe 100644 --- a/gr-noaa/lib/noaa_hrpt_pll_cc.h +++ b/gr-noaa/lib/noaa_hrpt_pll_cf.h @@ -20,21 +20,21 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_NOAA_HRPT_PLL_CC_H -#define INCLUDED_NOAA_HRPT_PLL_CC_H +#ifndef INCLUDED_NOAA_HRPT_PLL_CF_H +#define INCLUDED_NOAA_HRPT_PLL_CF_H #include -class noaa_hrpt_pll_cc; -typedef boost::shared_ptr noaa_hrpt_pll_cc_sptr; +class noaa_hrpt_pll_cf; +typedef boost::shared_ptr noaa_hrpt_pll_cf_sptr; -noaa_hrpt_pll_cc_sptr -noaa_make_hrpt_pll_cc(float alpha, float beta, float max_offset); +noaa_hrpt_pll_cf_sptr +noaa_make_hrpt_pll_cf(float alpha, float beta, float max_offset); -class noaa_hrpt_pll_cc : public gr_sync_block +class noaa_hrpt_pll_cf : public gr_sync_block { - friend noaa_hrpt_pll_cc_sptr noaa_make_hrpt_pll_cc(float alpha, float beta, float max_offset); - noaa_hrpt_pll_cc(float alpha, float beta, float max_offset); + friend noaa_hrpt_pll_cf_sptr noaa_make_hrpt_pll_cf(float alpha, float beta, float max_offset); + noaa_hrpt_pll_cf(float alpha, float beta, float max_offset); float d_alpha; // 1st order loop constant float d_beta; // 2nd order loop constant @@ -52,4 +52,4 @@ class noaa_hrpt_pll_cc : public gr_sync_block void set_max_offset(float max_offset) { d_max_offset = max_offset; } }; -#endif /* INCLUDED_NOAA_HRPT_PLL_CC_H */ +#endif /* INCLUDED_NOAA_HRPT_PLL_CF_H */ diff --git a/gr-noaa/lib/noaa_hrpt_sync_cc.cc b/gr-noaa/lib/noaa_hrpt_sync_ff.cc similarity index 70% rename from gr-noaa/lib/noaa_hrpt_sync_cc.cc rename to gr-noaa/lib/noaa_hrpt_sync_ff.cc index 46cc277b..f17ad54d 100644 --- a/gr-noaa/lib/noaa_hrpt_sync_cc.cc +++ b/gr-noaa/lib/noaa_hrpt_sync_ff.cc @@ -24,7 +24,7 @@ #include "config.h" #endif -#include +#include #include inline int signum(float f) @@ -32,16 +32,16 @@ inline int signum(float f) return f >= 0.0 ? 1 : -1; } -noaa_hrpt_sync_cc_sptr -noaa_make_hrpt_sync_cc(float alpha, float beta, float sps, float max_offset) +noaa_hrpt_sync_ff_sptr +noaa_make_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset) { - return gnuradio::get_initial_sptr(new noaa_hrpt_sync_cc(alpha, beta, sps, max_offset)); + return gnuradio::get_initial_sptr(new noaa_hrpt_sync_ff(alpha, beta, sps, max_offset)); } -noaa_hrpt_sync_cc::noaa_hrpt_sync_cc(float alpha, float beta, float sps, float max_offset) - : gr_block("noaa_hrpt_sync_cc", - gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(1, 1, sizeof(gr_complex))), +noaa_hrpt_sync_ff::noaa_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset) + : gr_block("noaa_hrpt_sync_ff", + gr_make_io_signature(1, 1, sizeof(float)), + gr_make_io_signature(1, 1, sizeof(float))), d_alpha(alpha), d_beta(beta), d_sps(sps), d_max_offset(max_offset), d_phase(0.0), d_freq(1.0/sps), @@ -50,18 +50,18 @@ noaa_hrpt_sync_cc::noaa_hrpt_sync_cc(float alpha, float beta, float sps, float m } int -noaa_hrpt_sync_cc::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +noaa_hrpt_sync_ff::general_work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { int ninputs = ninput_items[0]; - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; + const float *in = (const float *) input_items[0]; + float *out = (float *) output_items[0]; int i = 0, j = 0; while (i < ninputs && j < noutput_items) { - float sample = in[i++].imag(); + float sample = in[i++]; int sign = signum(sample); d_phase += d_freq; @@ -77,7 +77,7 @@ noaa_hrpt_sync_cc::general_work(int noutput_items, } if (d_phase > 1.0) { - out[j++] = in[i]; + out[j++] = -sample; // Invert sense, -68 degrees=1 d_phase -= 1.0; } } diff --git a/gr-noaa/lib/noaa_hrpt_sync_cc.h b/gr-noaa/lib/noaa_hrpt_sync_ff.h similarity index 78% rename from gr-noaa/lib/noaa_hrpt_sync_cc.h rename to gr-noaa/lib/noaa_hrpt_sync_ff.h index 6abbcad4..51502698 100644 --- a/gr-noaa/lib/noaa_hrpt_sync_cc.h +++ b/gr-noaa/lib/noaa_hrpt_sync_ff.h @@ -20,21 +20,21 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_NOAA_HRPT_SYNC_CC_H -#define INCLUDED_NOAA_HRPT_SYNC_CC_H +#ifndef INCLUDED_NOAA_HRPT_SYNC_FF_H +#define INCLUDED_NOAA_HRPT_SYNC_FF_H #include -class noaa_hrpt_sync_cc; -typedef boost::shared_ptr noaa_hrpt_sync_cc_sptr; +class noaa_hrpt_sync_ff; +typedef boost::shared_ptr noaa_hrpt_sync_ff_sptr; -noaa_hrpt_sync_cc_sptr -noaa_make_hrpt_sync_cc(float alpha, float beta, float sps, float max_offset); +noaa_hrpt_sync_ff_sptr +noaa_make_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset); -class noaa_hrpt_sync_cc : public gr_block +class noaa_hrpt_sync_ff : public gr_block { - friend noaa_hrpt_sync_cc_sptr noaa_make_hrpt_sync_cc(float alpha, float beta, float sps, float max_offset); - noaa_hrpt_sync_cc(float alpha, float beta, float sps, float max_offset); + friend noaa_hrpt_sync_ff_sptr noaa_make_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset); + noaa_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset); float d_alpha; // 1st order loop constant float d_beta; // 2nd order loop constant @@ -55,4 +55,4 @@ class noaa_hrpt_sync_cc : public gr_block void set_max_offset(float max_offset) { d_max_offset = max_offset; } }; -#endif /* INCLUDED_NOAA_HRPT_SYNC_CC_H */ +#endif /* INCLUDED_NOAA_HRPT_SYNC_FF_H */ diff --git a/gr-noaa/swig/Makefile.am b/gr-noaa/swig/Makefile.am index 18cb5920..2f98738c 100644 --- a/gr-noaa/swig/Makefile.am +++ b/gr-noaa/swig/Makefile.am @@ -53,8 +53,8 @@ noaa_swig_python = \ # additional SWIG files to be installed noaa_swig_swiginclude_headers = \ noaa_swig.i \ - noaa_hrpt_pll_cc.i \ - noaa_hrpt_sync_cc.i + noaa_hrpt_pll_cf.i \ + noaa_hrpt_sync_ff.i include $(top_srcdir)/Makefile.swig diff --git a/gr-noaa/swig/noaa_hrpt_pll_cc.i b/gr-noaa/swig/noaa_hrpt_pll_cf.i similarity index 83% rename from gr-noaa/swig/noaa_hrpt_pll_cc.i rename to gr-noaa/swig/noaa_hrpt_pll_cf.i index a29eaa38..859548a2 100644 --- a/gr-noaa/swig/noaa_hrpt_pll_cc.i +++ b/gr-noaa/swig/noaa_hrpt_pll_cf.i @@ -20,15 +20,15 @@ * Boston, MA 02110-1301, USA. */ -GR_SWIG_BLOCK_MAGIC(noaa,hrpt_pll_cc) +GR_SWIG_BLOCK_MAGIC(noaa,hrpt_pll_cf) -noaa_hrpt_pll_cc_sptr -noaa_make_hrpt_pll_cc(float alpha, float beta, float max_offset); +noaa_hrpt_pll_cf_sptr +noaa_make_hrpt_pll_cf(float alpha, float beta, float max_offset); -class noaa_hrpt_pll_cc : public gr_sync_block +class noaa_hrpt_pll_cf : public gr_sync_block { private: - noaa_hrpt_pll_cc(); + noaa_hrpt_pll_cf(); public: void set_alpha(float alpha); diff --git a/gr-noaa/swig/noaa_hrpt_sync_cc.i b/gr-noaa/swig/noaa_hrpt_sync_ff.i similarity index 83% rename from gr-noaa/swig/noaa_hrpt_sync_cc.i rename to gr-noaa/swig/noaa_hrpt_sync_ff.i index 6dcfa57d..f3b1594b 100644 --- a/gr-noaa/swig/noaa_hrpt_sync_cc.i +++ b/gr-noaa/swig/noaa_hrpt_sync_ff.i @@ -20,15 +20,15 @@ * Boston, MA 02110-1301, USA. */ -GR_SWIG_BLOCK_MAGIC(noaa,hrpt_sync_cc) +GR_SWIG_BLOCK_MAGIC(noaa,hrpt_sync_ff) -noaa_hrpt_sync_cc_sptr -noaa_make_hrpt_sync_cc(float alpha, float beta, float sps, float max_offset); +noaa_hrpt_sync_ff_sptr +noaa_make_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset); -class noaa_hrpt_sync_cc : public gr_sync_block +class noaa_hrpt_sync_ff : public gr_sync_block { private: - noaa_hrpt_sync_cc(); + noaa_hrpt_sync_ff(); public: void set_alpha(float alpha); diff --git a/gr-noaa/swig/noaa_swig.i b/gr-noaa/swig/noaa_swig.i index 470f5f96..a3e5dd78 100644 --- a/gr-noaa/swig/noaa_swig.i +++ b/gr-noaa/swig/noaa_swig.i @@ -23,9 +23,9 @@ %include "gnuradio.i" %{ -#include -#include +#include +#include %} -%include "noaa_hrpt_pll_cc.i" -%include "noaa_hrpt_sync_cc.i" +%include "noaa_hrpt_pll_cf.i" +%include "noaa_hrpt_sync_ff.i" -- 2.30.2