gr-noaa: Combined noaa_hrpt_bit_sync into noaa_hrpt_deframer
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Mon, 2 Nov 2009 17:57:32 +0000 (09:57 -0800)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Mon, 2 Nov 2009 17:57:32 +0000 (09:57 -0800)
Added Octave script to convert from frame data to AVHRR channel images
Removed noaa_hrpt_bit_sync block

18 files changed:
gr-noaa/apps/demod_hrpt_file.grc
gr-noaa/apps/demod_hrpt_file.py
gr-noaa/apps/file_rx_hrpt.grc
gr-noaa/apps/file_rx_hrpt.py
gr-noaa/apps/usrp_rx_hrpt.grc
gr-noaa/apps/usrp_rx_hrpt.py
gr-noaa/apps/usrp_rx_hrpt_nogui.grc
gr-noaa/apps/usrp_rx_hrpt_nogui.py
gr-noaa/grc/Makefile.am
gr-noaa/grc/noaa_hrpt_bit_sync.xml [deleted file]
gr-noaa/lib/Makefile.am
gr-noaa/lib/noaa_hrpt_bit_sync.cc [deleted file]
gr-noaa/lib/noaa_hrpt_bit_sync.h [deleted file]
gr-noaa/lib/noaa_hrpt_deframer.cc
gr-noaa/lib/noaa_hrpt_deframer.h
gr-noaa/swig/Makefile.am
gr-noaa/swig/noaa_hrpt_bit_sync.i [deleted file]
gr-noaa/swig/noaa_swig.i

index a5df8786fbef9f95f990cb9e09e2f77d6f517362..3c5e3efa4ec5dbb0655a598e92d8703d41b38bc7 100644 (file)
@@ -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>
       <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>(112, 537)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
   <block>
     <key>gr_file_sink</key>
     <param>
     </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>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(330, 537)</value>
+      <value>(112, 537)</value>
     </param>
     <param>
       <key>_rotation</key>
     <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>cs2cf</source_block_id>
     <sink_block_id>agc</sink_block_id>
     <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>
index 8467231857a48038e0fe769fe21c3610b4551af9..d866501716ae564b05d3e0573aa8983fac348be7 100755 (executable)
@@ -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
index fea53f8004aaa2dd6108352be0f6e5e1fc25e72a..f34143756996a89cbf56ec0963f18b5537187653 100644 (file)
@@ -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>
       <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>
   <block>
     <key>gr_file_sink</key>
     <param>
       <value>0</value>
     </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>
       <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>
     <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>
index c1491ca0e3c4d8b7b361bb72b45b2fce58393bf1..1513141ec43cacd73aaa1ef4ae75056dafb96902 100755 (executable)
@@ -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
index da2f417802a5779ed6a45ee794e02b139669c596..ac7a87a1608e3d275be08efed4f1f0dc456282d4 100644 (file)
@@ -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>
       <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>
   <block>
     <key>gr_file_sink</key>
     <param>
       <value>0</value>
     </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>
       <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>
     <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>
index c1d0fd6e915afbbc37dbd8b1f4c09dc8fb9549bf..a5f9a8e946148febdbca5407b72e0b754cd39e14 100755 (executable)
@@ -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
index 918a954bd689d3a270a6f2ff179bad195789c982..02d509f08d99bd7b644cbd8a664a3913b2b9264a 100644 (file)
@@ -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>
       <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>(815, 673)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
   <block>
     <key>gr_file_sink</key>
     <param>
     </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>
     </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>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(446, 673)</value>
+      <value>(1027, 623)</value>
     </param>
     <param>
       <key>_rotation</key>
     </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>
     </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>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1027, 623)</value>
+      <value>(815, 673)</value>
     </param>
     <param>
       <key>_rotation</key>
     <source_key>0</source_key>
     <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>
     <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>
index 33259a2313d541016657b32103f80ceeb3006376..4dc32dbda9df8686c3f346ba5a9f124bb73d3643 100755 (executable)
@@ -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
index 800d9ad65c3bd8aa043af95047e70defc65cfcbf..73a0282311649799d710c580c7418758532e43cd 100644 (file)
@@ -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 (file)
index 7dcb827..0000000
+++ /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>
index a4423167ebb8535db508450a7828c265cf151338..4ef4eb87bdaf884ddeb3862a05f17d3fec38be34 100644 (file)
@@ -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 (file)
index 53e47d9..0000000
+++ /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 (file)
index 8b8633c..0000000
+++ /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 */
index 91c94d2a6425540b3df2446f7eace9c4f73fc0b7..e79894869bb7568043a2f1c40ee2e224eaf20393 100644 (file)
@@ -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;
     }
   }
 
index 0aeb16a2db51cc78e263ad2acd4dfb97b5332aa2..43abba0e9152bb383c728d07e1766a14d8870b88 100644 (file)
@@ -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
index 97056811b46d78c0141d0ddd330079aabda801e4..73645e92bf2ee16d5260c6d4cb5f49499ebaafa8 100644 (file)
@@ -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 (file)
index 34b565c..0000000
+++ /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();
-};
index efda4f40336eb32c8e0f0be57690fb2675269788..8fe814a67a2cab6d15cf3694df47147b253281d8 100644 (file)
 %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"