diff options
-rw-r--r-- | gr-noaa/apps/demod_hrpt_file.grc | 35 | ||||
-rwxr-xr-x | gr-noaa/apps/demod_hrpt_file.py | 6 | ||||
-rw-r--r-- | gr-noaa/apps/file_rx_hrpt.grc | 115 | ||||
-rwxr-xr-x | gr-noaa/apps/file_rx_hrpt.py | 6 | ||||
-rw-r--r-- | gr-noaa/apps/usrp_rx_hrpt.grc | 115 | ||||
-rwxr-xr-x | gr-noaa/apps/usrp_rx_hrpt.py | 6 | ||||
-rw-r--r-- | gr-noaa/apps/usrp_rx_hrpt_nogui.grc | 71 | ||||
-rwxr-xr-x | gr-noaa/apps/usrp_rx_hrpt_nogui.py | 6 | ||||
-rw-r--r-- | gr-noaa/grc/Makefile.am | 1 | ||||
-rw-r--r-- | gr-noaa/grc/noaa_hrpt_bit_sync.xml | 16 | ||||
-rw-r--r-- | gr-noaa/lib/Makefile.am | 2 | ||||
-rw-r--r-- | gr-noaa/lib/noaa_hrpt_bit_sync.cc | 72 | ||||
-rw-r--r-- | gr-noaa/lib/noaa_hrpt_bit_sync.h | 49 | ||||
-rw-r--r-- | gr-noaa/lib/noaa_hrpt_deframer.cc | 70 | ||||
-rw-r--r-- | gr-noaa/lib/noaa_hrpt_deframer.h | 2 | ||||
-rw-r--r-- | gr-noaa/swig/Makefile.am | 1 | ||||
-rw-r--r-- | gr-noaa/swig/noaa_hrpt_bit_sync.i | 32 | ||||
-rw-r--r-- | gr-noaa/swig/noaa_swig.i | 2 |
18 files changed, 169 insertions, 438 deletions
diff --git a/gr-noaa/apps/demod_hrpt_file.grc b/gr-noaa/apps/demod_hrpt_file.grc index a5df8786f..3c5e3efa4 100644 --- a/gr-noaa/apps/demod_hrpt_file.grc +++ b/gr-noaa/apps/demod_hrpt_file.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sun Nov 1 18:39:07 2009</timestamp> + <timestamp>Mon Nov 2 07:06:57 2009</timestamp> <block> <key>options</key> <param> @@ -630,25 +630,6 @@ </param> </block> <block> - <key>gr_binary_slicer_fb</key> - <param> - <key>id</key> - <value>gr_binary_slicer_fb_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(112, 537)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>gr_file_sink</key> <param> <key>id</key> @@ -699,10 +680,10 @@ </param> </block> <block> - <key>noaa_hrpt_bit_sync</key> + <key>gr_binary_slicer_fb</key> <param> <key>id</key> - <value>noaa_hrpt_bit_sync_0</value> + <value>gr_binary_slicer_fb_0</value> </param> <param> <key>_enabled</key> @@ -710,7 +691,7 @@ </param> <param> <key>_coordinate</key> - <value>(330, 537)</value> + <value>(112, 537)</value> </param> <param> <key>_rotation</key> @@ -761,12 +742,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_binary_slicer_fb_0</source_block_id> - <sink_block_id>noaa_hrpt_bit_sync_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>cs2cf</source_block_id> <sink_block_id>agc</sink_block_id> <source_key>0</source_key> @@ -791,7 +766,7 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>noaa_hrpt_bit_sync_0</source_block_id> + <source_block_id>gr_binary_slicer_fb_0</source_block_id> <sink_block_id>noaa_hrpt_deframer_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> diff --git a/gr-noaa/apps/demod_hrpt_file.py b/gr-noaa/apps/demod_hrpt_file.py index 846723185..d86650171 100755 --- a/gr-noaa/apps/demod_hrpt_file.py +++ b/gr-noaa/apps/demod_hrpt_file.py @@ -2,7 +2,7 @@ ################################################## # Gnuradio Python Flow Graph # Title: Demod Hrpt File -# Generated: Sun Nov 1 18:39:07 2009 +# Generated: Mon Nov 2 07:06:57 2009 ################################################## from gnuradio import eng_notation @@ -48,7 +48,6 @@ class demod_hrpt_file(gr.top_block): self.gr_clock_recovery_mm_xx_0 = gr.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) self.gr_file_sink_0 = gr.file_sink(gr.sizeof_short*1, output_filename) self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.noaa_hrpt_bit_sync_0 = noaa.hrpt_bit_sync() self.noaa_hrpt_decoder_0 = noaa.hrpt_decoder() self.noaa_hrpt_deframer_0 = noaa.hrpt_deframer() self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) @@ -60,12 +59,11 @@ class demod_hrpt_file(gr.top_block): self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.gr_binary_slicer_fb_0, 0)) self.connect((self.gr_moving_average_xx_0, 0), (self.gr_clock_recovery_mm_xx_0, 0)) self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_bit_sync_0, 0)) self.connect((self.cs2cf, 0), (self.agc, 0)) self.connect((self.agc, 0), (self.pll, 0)) self.connect((self.noaa_hrpt_deframer_0, 0), (self.gr_file_sink_0, 0)) self.connect((self.noaa_hrpt_deframer_0, 0), (self.noaa_hrpt_decoder_0, 0)) - self.connect((self.noaa_hrpt_bit_sync_0, 0), (self.noaa_hrpt_deframer_0, 0)) + self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_deframer_0, 0)) def set_decim(self, decim): self.decim = decim diff --git a/gr-noaa/apps/file_rx_hrpt.grc b/gr-noaa/apps/file_rx_hrpt.grc index fea53f800..f34143756 100644 --- a/gr-noaa/apps/file_rx_hrpt.grc +++ b/gr-noaa/apps/file_rx_hrpt.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sun Nov 1 19:26:11 2009</timestamp> + <timestamp>Mon Nov 2 08:30:47 2009</timestamp> <block> <key>options</key> <param> @@ -238,25 +238,6 @@ </param> </block> <block> - <key>noaa_hrpt_deframer</key> - <param> - <key>id</key> - <value>deframer</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(762, 975)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>gr_file_sink</key> <param> <key>id</key> @@ -288,44 +269,6 @@ </param> </block> <block> - <key>noaa_hrpt_bit_sync</key> - <param> - <key>id</key> - <value>noaa_hrpt_bit_sync_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(571, 975)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_binary_slicer_fb</key> - <param> - <key>id</key> - <value>gr_binary_slicer_fb_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(393, 975)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>virtual_source</key> <param> <key>id</key> @@ -1167,18 +1110,44 @@ <value>0</value> </param> </block> - <connection> - <source_block_id>noaa_hrpt_bit_sync_0</source_block_id> - <sink_block_id>deframer</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_binary_slicer_fb_0</source_block_id> - <sink_block_id>noaa_hrpt_bit_sync_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> + <block> + <key>gr_binary_slicer_fb</key> + <param> + <key>id</key> + <value>gr_binary_slicer_fb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(393, 975)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>noaa_hrpt_deframer</key> + <param> + <key>id</key> + <value>deframer</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(762, 975)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> <source_block_id>virtual_source_0</source_block_id> <sink_block_id>gr_binary_slicer_fb_0</sink_block_id> @@ -1251,4 +1220,10 @@ <source_key>0</source_key> <sink_key>0</sink_key> </connection> + <connection> + <source_block_id>gr_binary_slicer_fb_0</source_block_id> + <sink_block_id>deframer</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> </flow_graph> diff --git a/gr-noaa/apps/file_rx_hrpt.py b/gr-noaa/apps/file_rx_hrpt.py index c1491ca0e..1513141ec 100755 --- a/gr-noaa/apps/file_rx_hrpt.py +++ b/gr-noaa/apps/file_rx_hrpt.py @@ -2,7 +2,7 @@ ################################################## # Gnuradio Python Flow Graph # Title: USRP HRPT Receiver -# Generated: Sun Nov 1 19:26:11 2009 +# Generated: Mon Nov 2 08:30:47 2009 ################################################## from gnuradio import eng_notation @@ -146,7 +146,6 @@ class file_rx_hrpt(grc_wxgui.top_block_gui): self.gr_file_source_0 = gr.file_source(gr.sizeof_short*1, input_filename, False) self.gr_interleaved_short_to_complex_0 = gr.interleaved_short_to_complex() self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.noaa_hrpt_bit_sync_0 = noaa.hrpt_bit_sync() self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) self.rx_fft = fftsink2.fft_sink_c( self.displays.GetPage(0).GetWin(), @@ -170,8 +169,6 @@ class file_rx_hrpt(grc_wxgui.top_block_gui): ################################################## # Connections ################################################## - self.connect((self.noaa_hrpt_bit_sync_0, 0), (self.deframer, 0)) - self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_bit_sync_0, 0)) self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.gr_binary_slicer_fb_0, 0)) self.connect((self.deframer, 0), (self.frame_sink, 0)) self.connect((self.deframer, 0), (self.decoder, 0)) @@ -183,6 +180,7 @@ class file_rx_hrpt(grc_wxgui.top_block_gui): self.connect((self.gr_interleaved_short_to_complex_0, 0), (self.agc, 0)) self.connect((self.throttle, 0), (self.gr_interleaved_short_to_complex_0, 0)) self.connect((self.gr_file_source_0, 0), (self.throttle, 0)) + self.connect((self.gr_binary_slicer_fb_0, 0), (self.deframer, 0)) def set_input_filename(self, input_filename): self.input_filename = input_filename diff --git a/gr-noaa/apps/usrp_rx_hrpt.grc b/gr-noaa/apps/usrp_rx_hrpt.grc index da2f41780..ac7a87a16 100644 --- a/gr-noaa/apps/usrp_rx_hrpt.grc +++ b/gr-noaa/apps/usrp_rx_hrpt.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sun Nov 1 19:28:12 2009</timestamp> + <timestamp>Mon Nov 2 08:31:09 2009</timestamp> <block> <key>options</key> <param> @@ -871,25 +871,6 @@ </param> </block> <block> - <key>noaa_hrpt_deframer</key> - <param> - <key>id</key> - <value>deframer</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(762, 975)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>gr_file_sink</key> <param> <key>id</key> @@ -921,44 +902,6 @@ </param> </block> <block> - <key>noaa_hrpt_bit_sync</key> - <param> - <key>id</key> - <value>noaa_hrpt_bit_sync_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(571, 975)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_binary_slicer_fb</key> - <param> - <key>id</key> - <value>gr_binary_slicer_fb_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(393, 975)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>virtual_source</key> <param> <key>id</key> @@ -1384,18 +1327,44 @@ <value>0</value> </param> </block> - <connection> - <source_block_id>noaa_hrpt_bit_sync_0</source_block_id> - <sink_block_id>deframer</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_binary_slicer_fb_0</source_block_id> - <sink_block_id>noaa_hrpt_bit_sync_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> + <block> + <key>gr_binary_slicer_fb</key> + <param> + <key>id</key> + <value>gr_binary_slicer_fb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(393, 975)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>noaa_hrpt_deframer</key> + <param> + <key>id</key> + <value>deframer</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(762, 975)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> <source_block_id>virtual_source_0</source_block_id> <sink_block_id>gr_binary_slicer_fb_0</sink_block_id> @@ -1456,4 +1425,10 @@ <source_key>0</source_key> <sink_key>0</sink_key> </connection> + <connection> + <source_block_id>gr_binary_slicer_fb_0</source_block_id> + <sink_block_id>deframer</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> </flow_graph> diff --git a/gr-noaa/apps/usrp_rx_hrpt.py b/gr-noaa/apps/usrp_rx_hrpt.py index c1d0fd6e9..a5f9a8e94 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 Nov 1 19:28:13 2009 +# Generated: Mon Nov 2 08:31:10 2009 ################################################## from gnuradio import eng_notation @@ -205,7 +205,6 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): self.gr_binary_slicer_fb_0 = gr.binary_slicer_fb() self.gr_clock_recovery_mm_xx_0 = gr.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.noaa_hrpt_bit_sync_0 = noaa.hrpt_bit_sync() self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) self.rx_fft = fftsink2.fft_sink_c( self.displays.GetPage(0).GetWin(), @@ -232,8 +231,6 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): ################################################## # Connections ################################################## - self.connect((self.noaa_hrpt_bit_sync_0, 0), (self.deframer, 0)) - self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_bit_sync_0, 0)) self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.gr_binary_slicer_fb_0, 0)) self.connect((self.deframer, 0), (self.frame_sink, 0)) self.connect((self.deframer, 0), (self.decoder, 0)) @@ -243,6 +240,7 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): self.connect((self.agc, 0), (self.pll, 0)) self.connect((self.usrp_source, 0), (self.agc, 0)) self.connect((self.agc, 0), (self.rx_fft, 0)) + self.connect((self.gr_binary_slicer_fb_0, 0), (self.deframer, 0)) def set_config_filename(self, config_filename): self.config_filename = config_filename diff --git a/gr-noaa/apps/usrp_rx_hrpt_nogui.grc b/gr-noaa/apps/usrp_rx_hrpt_nogui.grc index 918a954bd..02d509f08 100644 --- a/gr-noaa/apps/usrp_rx_hrpt_nogui.grc +++ b/gr-noaa/apps/usrp_rx_hrpt_nogui.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sun Nov 1 19:32:32 2009</timestamp> + <timestamp>Mon Nov 2 08:31:35 2009</timestamp> <block> <key>options</key> <param> @@ -772,25 +772,6 @@ </param> </block> <block> - <key>noaa_hrpt_deframer</key> - <param> - <key>id</key> - <value>deframer</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(815, 673)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>gr_file_sink</key> <param> <key>id</key> @@ -822,18 +803,22 @@ </param> </block> <block> - <key>noaa_hrpt_bit_sync</key> + <key>virtual_source</key> <param> <key>id</key> - <value>noaa_hrpt_bit_sync_0</value> + <value>virtual_source_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> + <key>stream_id</key> + <value>baseband</value> + </param> + <param> <key>_coordinate</key> - <value>(624, 673)</value> + <value>(226, 669)</value> </param> <param> <key>_rotation</key> @@ -841,10 +826,10 @@ </param> </block> <block> - <key>gr_binary_slicer_fb</key> + <key>noaa_hrpt_decoder</key> <param> <key>id</key> - <value>gr_binary_slicer_fb_0</value> + <value>decoder</value> </param> <param> <key>_enabled</key> @@ -852,7 +837,7 @@ </param> <param> <key>_coordinate</key> - <value>(446, 673)</value> + <value>(1027, 623)</value> </param> <param> <key>_rotation</key> @@ -860,22 +845,18 @@ </param> </block> <block> - <key>virtual_source</key> + <key>gr_binary_slicer_fb</key> <param> <key>id</key> - <value>virtual_source_0</value> + <value>gr_binary_slicer_fb_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>stream_id</key> - <value>baseband</value> - </param> - <param> <key>_coordinate</key> - <value>(226, 669)</value> + <value>(446, 673)</value> </param> <param> <key>_rotation</key> @@ -883,10 +864,10 @@ </param> </block> <block> - <key>noaa_hrpt_decoder</key> + <key>noaa_hrpt_deframer</key> <param> <key>id</key> - <value>decoder</value> + <value>deframer</value> </param> <param> <key>_enabled</key> @@ -894,7 +875,7 @@ </param> <param> <key>_coordinate</key> - <value>(1027, 623)</value> + <value>(815, 673)</value> </param> <param> <key>_rotation</key> @@ -932,18 +913,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>noaa_hrpt_bit_sync_0</source_block_id> - <sink_block_id>deframer</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_binary_slicer_fb_0</source_block_id> - <sink_block_id>noaa_hrpt_bit_sync_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>virtual_source_0</source_block_id> <sink_block_id>gr_binary_slicer_fb_0</sink_block_id> <source_key>0</source_key> @@ -961,4 +930,10 @@ <source_key>0</source_key> <sink_key>0</sink_key> </connection> + <connection> + <source_block_id>gr_binary_slicer_fb_0</source_block_id> + <sink_block_id>deframer</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> </flow_graph> diff --git a/gr-noaa/apps/usrp_rx_hrpt_nogui.py b/gr-noaa/apps/usrp_rx_hrpt_nogui.py index 33259a231..4dc32dbda 100755 --- a/gr-noaa/apps/usrp_rx_hrpt_nogui.py +++ b/gr-noaa/apps/usrp_rx_hrpt_nogui.py @@ -2,7 +2,7 @@ ################################################## # Gnuradio Python Flow Graph # Title: Usrp Rx Hrpt Nogui -# Generated: Sun Nov 1 19:32:32 2009 +# Generated: Mon Nov 2 08:31:35 2009 ################################################## from gnuradio import eng_notation @@ -76,7 +76,6 @@ class usrp_rx_hrpt_nogui(gr.top_block): self.gr_binary_slicer_fb_0 = gr.binary_slicer_fb() self.gr_clock_recovery_mm_xx_0 = gr.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.noaa_hrpt_bit_sync_0 = noaa.hrpt_bit_sync() self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) self.usrp_source = grc_usrp.simple_source_c(which=0, side=side, rx_ant="RXA") self.usrp_source.set_decim_rate(decim) @@ -90,11 +89,10 @@ class usrp_rx_hrpt_nogui(gr.top_block): self.connect((self.agc, 0), (self.pll, 0)) self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) self.connect((self.gr_moving_average_xx_0, 0), (self.gr_clock_recovery_mm_xx_0, 0)) - self.connect((self.noaa_hrpt_bit_sync_0, 0), (self.deframer, 0)) - self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_bit_sync_0, 0)) self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.gr_binary_slicer_fb_0, 0)) self.connect((self.deframer, 0), (self.frame_sink, 0)) self.connect((self.deframer, 0), (self.decoder, 0)) + self.connect((self.gr_binary_slicer_fb_0, 0), (self.deframer, 0)) def set_config_filename(self, config_filename): self.config_filename = config_filename diff --git a/gr-noaa/grc/Makefile.am b/gr-noaa/grc/Makefile.am index 800d9ad65..73a028231 100644 --- a/gr-noaa/grc/Makefile.am +++ b/gr-noaa/grc/Makefile.am @@ -24,7 +24,6 @@ include $(top_srcdir)/Makefile.common grcblocksdir = $(grc_blocksdir) dist_grcblocks_DATA = \ - noaa_hrpt_bit_sync.xml \ noaa_hrpt_decoder.xml \ noaa_hrpt_deframer.xml \ noaa_hrpt_pll_cf.xml diff --git a/gr-noaa/grc/noaa_hrpt_bit_sync.xml b/gr-noaa/grc/noaa_hrpt_bit_sync.xml deleted file mode 100644 index 7dcb82742..000000000 --- a/gr-noaa/grc/noaa_hrpt_bit_sync.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>HRPT Bit Sync</name> - <key>noaa_hrpt_bit_sync</key> - <category>NOAA</category> - <import>from gnuradio import noaa</import> - <make>noaa.hrpt_bit_sync()</make> - <sink> - <name>in</name> - <type>byte</type> - </sink> - <source> - <name>out</name> - <type>byte</type> - </source> -</block> diff --git a/gr-noaa/lib/Makefile.am b/gr-noaa/lib/Makefile.am index a4423167e..4ef4eb87b 100644 --- a/gr-noaa/lib/Makefile.am +++ b/gr-noaa/lib/Makefile.am @@ -29,7 +29,6 @@ lib_LTLIBRARIES = \ libgnuradio-noaa.la libgnuradio_noaa_la_SOURCES = \ - noaa_hrpt_bit_sync.cc \ noaa_hrpt_decoder.cc \ noaa_hrpt_deframer.cc \ noaa_hrpt_pll_cf.cc @@ -40,7 +39,6 @@ libgnuradio_noaa_la_LIBADD = \ libgnuradio_noaa_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0 grinclude_HEADERS = \ - noaa_hrpt_bit_sync.h \ noaa_hrpt_decoder.h \ noaa_hrpt_deframer.h \ noaa_hrpt_pll_cf.h
\ No newline at end of file diff --git a/gr-noaa/lib/noaa_hrpt_bit_sync.cc b/gr-noaa/lib/noaa_hrpt_bit_sync.cc deleted file mode 100644 index 53e47d91e..000000000 --- a/gr-noaa/lib/noaa_hrpt_bit_sync.cc +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <noaa_hrpt_bit_sync.h> -#include <gr_io_signature.h> -#include <iostream> - -noaa_hrpt_bit_sync_sptr -noaa_make_hrpt_bit_sync() -{ - return gnuradio::get_initial_sptr(new noaa_hrpt_bit_sync()); -} - -noaa_hrpt_bit_sync::noaa_hrpt_bit_sync() - : gr_block("noaa_hrpt_bit_sync", - gr_make_io_signature(1, 1, sizeof(char)), - gr_make_io_signature(1, 1, sizeof(char))), - d_mid_bit(true), - d_last_bit(0) -{ -} - -int -noaa_hrpt_bit_sync::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 char *in = (const char *)input_items[0]; - char *out = (char *)output_items[0]; - - int i = 0, j = 0; - while (i < ninputs && j < noutput_items) { - char bit = in[i++]; - char diff = bit^d_last_bit; - d_last_bit = bit; - - if (d_mid_bit && diff) { - out[j++] = bit; - d_mid_bit = false; - } - else - d_mid_bit = true; - } - - consume_each(i); - return j; -} diff --git a/gr-noaa/lib/noaa_hrpt_bit_sync.h b/gr-noaa/lib/noaa_hrpt_bit_sync.h deleted file mode 100644 index 8b8633cdc..000000000 --- a/gr-noaa/lib/noaa_hrpt_bit_sync.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_NOAA_HRPT_BIT_SYNC_H -#define INCLUDED_NOAA_HRPT_BIT_SYNC_H - -#include <gr_block.h> - -class noaa_hrpt_bit_sync; -typedef boost::shared_ptr<noaa_hrpt_bit_sync> noaa_hrpt_bit_sync_sptr; - -noaa_hrpt_bit_sync_sptr -noaa_make_hrpt_bit_sync(); - -class noaa_hrpt_bit_sync : public gr_block -{ - friend noaa_hrpt_bit_sync_sptr noaa_make_hrpt_bit_sync(); - noaa_hrpt_bit_sync(); - - bool d_mid_bit; - unsigned char d_last_bit; - - public: - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_NOAA_HRPT_BIT_SYNC_H */ diff --git a/gr-noaa/lib/noaa_hrpt_deframer.cc b/gr-noaa/lib/noaa_hrpt_deframer.cc index 91c94d2a6..e79894869 100644 --- a/gr-noaa/lib/noaa_hrpt_deframer.cc +++ b/gr-noaa/lib/noaa_hrpt_deframer.cc @@ -55,6 +55,8 @@ noaa_hrpt_deframer::noaa_hrpt_deframer() gr_make_io_signature(1, 1, sizeof(short))) { set_output_multiple(6); // room for writing full sync when received + d_mid_bit = true; + d_last_bit = 0; enter_idle(); } @@ -86,38 +88,48 @@ noaa_hrpt_deframer::general_work(int noutput_items, int i = 0, j = 0; while (i < ninputs && j < noutput_items) { char bit = in[i++]; - - switch (d_state) { - case ST_IDLE: - d_shifter = (d_shifter << 1) | bit; // MSB transmitted first - - if ((d_shifter & 0x0FFFFFFFFFFFFFFFLL) == HRPT_MINOR_FRAME_SYNC) { - fprintf(stderr, "SYNC #%i", frames_seen++); - out[j++] = SYNC1; - out[j++] = SYNC2; - out[j++] = SYNC3; - out[j++] = SYNC4; - out[j++] = SYNC5; - out[j++] = SYNC6; - enter_synced(); - } - break; - - case ST_SYNCED: - d_word = (d_word << 1) | bit; // MSB transmitted first - if (--d_bit_count == 0) { - out[j++] = d_word; - d_word = 0; - d_bit_count = HRPT_BITS_PER_WORD; - if (--d_word_count == 0) { - fprintf(stderr, "...done\n"); - enter_idle(); + char diff = bit^d_last_bit; + d_last_bit = bit; + + // Wait for transition if not synced, otherwise, alternate bits + if (d_mid_bit && (diff | (d_state == ST_SYNCED))) { + switch (d_state) { + case ST_IDLE: + d_shifter = (d_shifter << 1) | bit; // MSB transmitted first + + if ((d_shifter & 0x0FFFFFFFFFFFFFFFLL) == HRPT_MINOR_FRAME_SYNC) { + fprintf(stderr, "SYNC #%i", frames_seen++); + out[j++] = SYNC1; + out[j++] = SYNC2; + out[j++] = SYNC3; + out[j++] = SYNC4; + out[j++] = SYNC5; + out[j++] = SYNC6; + enter_synced(); } + break; + + case ST_SYNCED: + d_word = (d_word << 1) | bit; // MSB transmitted first + if (--d_bit_count == 0) { + out[j++] = d_word; + d_word = 0; + d_bit_count = HRPT_BITS_PER_WORD; + if (--d_word_count == 0) { + fprintf(stderr, "...done\n"); + enter_idle(); + } + } + break; + + default: + throw std::runtime_error("noaa_hrpt_deframer: bad state\n"); } - break; - default: - throw std::runtime_error("noaa_hrpt_deframer: bad state\n"); + d_mid_bit = false; + } + else { + d_mid_bit = true; } } diff --git a/gr-noaa/lib/noaa_hrpt_deframer.h b/gr-noaa/lib/noaa_hrpt_deframer.h index 0aeb16a2d..43abba0e9 100644 --- a/gr-noaa/lib/noaa_hrpt_deframer.h +++ b/gr-noaa/lib/noaa_hrpt_deframer.h @@ -41,6 +41,8 @@ class noaa_hrpt_deframer : public gr_block noaa_hrpt_deframer(); unsigned int d_state; + bool d_mid_bit; + unsigned char d_last_bit; unsigned int d_bit_count; unsigned int d_word_count; unsigned long long d_shifter; // 60 bit sync word diff --git a/gr-noaa/swig/Makefile.am b/gr-noaa/swig/Makefile.am index 97056811b..73645e92b 100644 --- a/gr-noaa/swig/Makefile.am +++ b/gr-noaa/swig/Makefile.am @@ -52,7 +52,6 @@ noaa_swig_python = \ # additional SWIG files to be installed noaa_swig_swiginclude_headers = \ - noaa_hrpt_bit_sync.i \ noaa_hrpt_decoder.i \ noaa_hrpt_deframer.i \ noaa_hrpt_pll_cf.i diff --git a/gr-noaa/swig/noaa_hrpt_bit_sync.i b/gr-noaa/swig/noaa_hrpt_bit_sync.i deleted file mode 100644 index 34b565c23..000000000 --- a/gr-noaa/swig/noaa_hrpt_bit_sync.i +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(noaa,hrpt_bit_sync) - -noaa_hrpt_bit_sync_sptr -noaa_make_hrpt_bit_sync(); - -class noaa_hrpt_bit_sync : public gr_sync_block -{ -private: - noaa_hrpt_bit_sync(); -}; diff --git a/gr-noaa/swig/noaa_swig.i b/gr-noaa/swig/noaa_swig.i index efda4f403..8fe814a67 100644 --- a/gr-noaa/swig/noaa_swig.i +++ b/gr-noaa/swig/noaa_swig.i @@ -23,13 +23,11 @@ %include "gnuradio.i" %{ -#include <noaa_hrpt_bit_sync.h> #include <noaa_hrpt_decoder.h> #include <noaa_hrpt_deframer.h> #include <noaa_hrpt_pll_cf.h> %} -%include "noaa_hrpt_bit_sync.i" %include "noaa_hrpt_decoder.i" %include "noaa_hrpt_deframer.i" %include "noaa_hrpt_pll_cf.i" |