gr-noaa: Switched to 'double rate BPSK' HRPT synchronization
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Sat, 31 Oct 2009 16:28:44 +0000 (09:28 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Mon, 2 Nov 2009 03:45:34 +0000 (19:45 -0800)
Added hrpt_bit_sync block
Using MM clock sync at double data rate
Created file_rx_hrpt GRC app
Updated demod_rx_hrpt GRC app
Updated usrp_rx_hrpt GRC
Updated usrp_rx_hrpt_nogui app
Deleted usrp_rx_hrpt2 GRC app
Deleted hrpt_sync_fb block

26 files changed:
gr-noaa/README
gr-noaa/apps/.gitignore
gr-noaa/apps/Makefile.am
gr-noaa/apps/demod_hrpt_file.grc
gr-noaa/apps/demod_hrpt_file.py
gr-noaa/apps/file_rx_hrpt.grc [new file with mode: 0644]
gr-noaa/apps/file_rx_hrpt.py [new file with mode: 0755]
gr-noaa/apps/usrp_rx_hrpt.cfg [deleted file]
gr-noaa/apps/usrp_rx_hrpt.grc
gr-noaa/apps/usrp_rx_hrpt.py
gr-noaa/apps/usrp_rx_hrpt2.grc [deleted file]
gr-noaa/apps/usrp_rx_hrpt2.py [deleted file]
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 [new file with mode: 0644]
gr-noaa/grc/noaa_hrpt_sync_fb.xml [deleted file]
gr-noaa/lib/Makefile.am
gr-noaa/lib/noaa_hrpt_bit_sync.cc [new file with mode: 0644]
gr-noaa/lib/noaa_hrpt_bit_sync.h [new file with mode: 0644]
gr-noaa/lib/noaa_hrpt_sync_fb.cc [deleted file]
gr-noaa/lib/noaa_hrpt_sync_fb.h [deleted file]
gr-noaa/swig/Makefile.am
gr-noaa/swig/noaa_hrpt_bit_sync.i [new file with mode: 0644]
gr-noaa/swig/noaa_hrpt_sync_fb.i [deleted file]
gr-noaa/swig/noaa_swig.i

index fada3550a314818ba7abc56038610e78838643c3..29d11f59349ac5d6f19e1e77d96a5c45a7f10b4f 100644 (file)
@@ -15,20 +15,22 @@ HRPT minor frames into a file.  The file stores a series of 11090 word,
 16-bits per word corresponding to the HRPT minor frame format (only the
 lower 10-bits per word are significant.)
 
-The script file by default uses USRP side A, 1698 MHz, at decimation 16. A
-configuration file 'usrp_rx_hrpt.cfg' in the current working directory will
-allow changing this, as well as implementing persistent storage of GUI
+The script file by default uses USRP side A, 1698 MHz, at decimation 16. The
+gnuradio configuration file ~/.gnuradio/config.conf, section 'usrp_rx_hrpt.cfg',
+will allow changing this, as well as implementing persistent storage of GUI
 entered parameters from invocation to invocation.
 
 The present HRPT demodulator is only tested at decimation 16.  The only other
-valid decimation rates are 24 and 32, which may word but with more bit
+valid decimation rates are 24 and 32, which may work but with more bit
 errors.  No other decimation rates will work.
 
-usrp_rx_hrpt2.py
-----------------
 
-This GUI script uses fewer graphical displays to reduce CPU consumption on
-slower machines, but otherwise operates identically to userp_rx_hrpt.py.
+file_rx_hrpt.py
+---------------
+
+This GUI script operates like usrp_rx_hrpt.py, but reads from a pre-captured
+data file supplied by -F on the command line.
+
 
 usrp_rx_hrpt_nogui.py
 ---------------------
@@ -37,6 +39,7 @@ This non-GUI script operates without a display and requires that all parameters
 be set in the configuration file prior to running.  It has no command-line
 parameters, and works identically to the GUI scripts.
 
+
 demod_hrpt_file.py
 ------------------
 
@@ -53,11 +56,11 @@ Options:
                         Set Decimation [default=16]
   -p PLL_ALPHA, --pll-alpha=PLL_ALPHA
                         Set pll_alpha [default=50m]
-  -s SYNC_ALPHA, --sync-alpha=SYNC_ALPHA
-                        Set sync_alpha [default=50m]
-  -F FILENAME, --filename=FILENAME
+  -s CLOCK_ALPHA, --clock-alpha=CLOCK_ALPHA
+                        Set clock_alpha [default=50m]
+  -F INPUT_FILENAME, --input-filename=INPUT_FILENAME
                         Set Filename [default=usrp.dat]
-  -o OUTPUT, --output=OUTPUT
+  -o OUTPUT_FILENAME, --output-filename=OUTPUT_FILENAME
                         Set Output [default=frames.dat]
 
 
index 773a6df9baff964b04b810b12fd29d8339efc790..6bd1ab99593a948cca795ade1958a165d832b87a 100644 (file)
@@ -1 +1,2 @@
 *.dat
+*.txt
\ No newline at end of file
index b9787a92c48859c27fcacbdd64257b17480263f0..961b09afabe5fa9e243867393fd7ec0c2d2e189d 100644 (file)
@@ -25,15 +25,15 @@ if PYTHON
 
 dist_bin_SCRIPTS = \
        demod_hrpt_file.py \
+       file_rx_hrpt.py \
        usrp_rx_hrpt.py \
-       usrp_rx_hrpt2.py \
        usrp_rx_hrpt_nogui.py \
        usrp_rx_lrit.py
 
 EXTRA_DIST = \
+       file_rx_hrpt.grc \
        demod_hrpt_file.grc \
        usrp_rx_hrpt.grc \
-       usrp_rx_hrpt2.grc \
        usrp_rx_hrpt_nogui.grc \
        usrp_rx_lrit.grc
 endif
index 7a0bbe892e915d0ad3a9fa16efd400af9c141e14..a5df8786fbef9f95f990cb9e09e2f77d6f517362 100644 (file)
@@ -1,23 +1,55 @@
 <?xml version='1.0' encoding='ASCII'?>
 <flow_graph>
-  <timestamp>Sun Oct  4 08:40:03 2009</timestamp>
+  <timestamp>Sun Nov  1 18:39:07 2009</timestamp>
   <block>
-    <key>variable</key>
+    <key>options</key>
     <param>
       <key>id</key>
-      <value>max_sync_offset</value>
+      <value>demod_hrpt_file</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>value</key>
-      <value>0.01</value>
+      <key>title</key>
+      <value></value>
+    </param>
+    <param>
+      <key>author</key>
+      <value></value>
+    </param>
+    <param>
+      <key>description</key>
+      <value></value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>4096,4096</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>no_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
+      <key>run_options</key>
+      <value>run</value>
+    </param>
+    <param>
+      <key>run</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>realtime_scheduling</key>
+      <value></value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(705, 19)</value>
+      <value>(10, 10)</value>
     </param>
     <param>
       <key>_rotation</key>
@@ -51,7 +83,7 @@
     <key>variable</key>
     <param>
       <key>id</key>
-      <value>hs</value>
+      <value>sym_rate</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>int(sps/2.0)</value>
+      <value>600*1109</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(499, 19)</value>
+      <value>(301, 19)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable</key>
     <param>
       <key>id</key>
-      <value>sym_rate</value>
+      <value>hs</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>600*1109</value>
+      <value>int(sps/2.0)</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(301, 19)</value>
+      <value>(499, 19)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>parameter</key>
+    <key>variable</key>
     <param>
       <key>id</key>
-      <value>filename</value>
+      <value>max_clock_offset</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>label</key>
-      <value>Filename</value>
+      <key>value</key>
+      <value>0.1</value>
     </param>
     <param>
-      <key>value</key>
-      <value>usrp.dat</value>
+      <key>_coordinate</key>
+      <value>(710, 17)</value>
     </param>
     <param>
-      <key>type</key>
-      <value>string</value>
+      <key>_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>import</key>
     <param>
-      <key>short_id</key>
-      <value>F</value>
+      <key>id</key>
+      <value>import_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>import</key>
+      <value>import math, os</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(200, 101)</value>
+      <value>(11, 103)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>parameter</key>
     <param>
       <key>id</key>
-      <value>output</value>
+      <value>decim</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>label</key>
-      <value>Output</value>
+      <value>decim</value>
     </param>
     <param>
       <key>value</key>
-      <value>frames.dat</value>
+      <value>16</value>
     </param>
     <param>
       <key>type</key>
-      <value>string</value>
+      <value>intx</value>
     </param>
     <param>
       <key>short_id</key>
-      <value>o</value>
+      <value>d</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(302, 101)</value>
+      <value>(202, 102)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>gr_float_to_complex</key>
+    <key>parameter</key>
     <param>
       <key>id</key>
-      <value>f2c</value>
+      <value>pll_alpha</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>vlen</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(832, 363)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
+      <key>label</key>
+      <value>pll_alpha</value>
     </param>
-  </block>
-  <block>
-    <key>virtual_sink</key>
     <param>
-      <key>id</key>
-      <value>samples_sink</value>
+      <key>value</key>
+      <value>0.05</value>
     </param>
     <param>
-      <key>_enabled</key>
-      <value>True</value>
+      <key>type</key>
+      <value>eng_float</value>
     </param>
     <param>
-      <key>stream_id</key>
-      <value>samples</value>
+      <key>short_id</key>
+      <value>p</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1070, 376)</value>
+      <value>(294, 101)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_sync_fb</key>
+    <key>parameter</key>
     <param>
       <key>id</key>
-      <value>sync</value>
+      <value>clock_alpha</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>alpha</key>
-      <value>sync_alpha</value>
+      <key>label</key>
+      <value>clock_alpha</value>
     </param>
     <param>
-      <key>beta</key>
-      <value>sync_alpha**2/4.0</value>
+      <key>value</key>
+      <value>0.05</value>
     </param>
     <param>
-      <key>sps</key>
-      <value>sps</value>
+      <key>type</key>
+      <value>eng_float</value>
     </param>
     <param>
-      <key>max_offset</key>
-      <value>max_sync_offset</value>
+      <key>short_id</key>
+      <value>a</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(813, 455)</value>
+      <value>(395, 101)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_deframer</key>
+    <key>parameter</key>
     <param>
       <key>id</key>
-      <value>deframer</value>
+      <value>sync_alpha</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>_coordinate</key>
-      <value>(1037, 483)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>gr_file_sink</key>
-    <param>
-      <key>id</key>
-      <value>file_sink</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
+      <key>label</key>
+      <value>sync_alpha</value>
     </param>
     <param>
-      <key>file</key>
-      <value>output</value>
+      <key>value</key>
+      <value>0.05</value>
     </param>
     <param>
       <key>type</key>
-      <value>short</value>
+      <value>eng_float</value>
     </param>
     <param>
-      <key>vlen</key>
-      <value>1</value>
+      <key>short_id</key>
+      <value>s</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1238, 479)</value>
+      <value>(508, 102)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_decoder</key>
+    <key>parameter</key>
     <param>
       <key>id</key>
-      <value>decoder</value>
+      <value>input_filename</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>_coordinate</key>
-      <value>(1237, 542)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>gr_deinterleave</key>
-    <param>
-      <key>id</key>
-      <value>deinterleave</value>
+      <key>label</key>
+      <value>input_filename</value>
     </param>
     <param>
-      <key>_enabled</key>
-      <value>True</value>
+      <key>value</key>
+      <value>usrp.dat</value>
     </param>
     <param>
       <key>type</key>
-      <value>float</value>
-    </param>
-    <param>
-      <key>num_streams</key>
-      <value>2</value>
+      <value>string</value>
     </param>
     <param>
-      <key>vlen</key>
-      <value>1</value>
+      <key>short_id</key>
+      <value>F</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(628, 363)</value>
+      <value>(618, 102)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>parameter</key>
     <param>
       <key>id</key>
-      <value>decim</value>
+      <value>output_filename</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>label</key>
-      <value>Decimation</value>
+      <value>output_filename</value>
     </param>
     <param>
       <key>value</key>
-      <value>16</value>
+      <value>frames.dat</value>
     </param>
     <param>
       <key>type</key>
-      <value>intx</value>
+      <value>string</value>
     </param>
     <param>
       <key>short_id</key>
-      <value>d</value>
+      <value>o</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(415, 101)</value>
+      <value>(726, 102)</value>
     </param>
     <param>
       <key>_rotation</key>
-      <value>0</value>
+      <value>180</value>
     </param>
   </block>
   <block>
-    <key>parameter</key>
+    <key>gr_file_source</key>
     <param>
       <key>id</key>
-      <value>pll_alpha</value>
+      <value>file_source</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>label</key>
-      <value></value>
+      <key>file</key>
+      <value>input_filename</value>
     </param>
     <param>
-      <key>value</key>
-      <value>0.05</value>
+      <key>type</key>
+      <value>short</value>
     </param>
     <param>
-      <key>type</key>
-      <value>eng_float</value>
+      <key>repeat</key>
+      <value>False</value>
     </param>
     <param>
-      <key>short_id</key>
-      <value>p</value>
+      <key>vlen</key>
+      <value>1</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(527, 101)</value>
+      <value>(62, 306)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>parameter</key>
+    <key>gr_interleaved_short_to_complex</key>
     <param>
       <key>id</key>
-      <value>sync_alpha</value>
+      <value>cs2cf</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>label</key>
-      <value></value>
+      <key>_coordinate</key>
+      <value>(297, 318)</value>
     </param>
     <param>
-      <key>value</key>
-      <value>0.05</value>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_agc_xx</key>
+    <param>
+      <key>id</key>
+      <value>agc</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
       <key>type</key>
-      <value>eng_float</value>
+      <value>complex</value>
     </param>
     <param>
-      <key>short_id</key>
-      <value>s</value>
+      <key>rate</key>
+      <value>1e-5</value>
+    </param>
+    <param>
+      <key>reference</key>
+      <value>1.0</value>
+    </param>
+    <param>
+      <key>gain</key>
+      <value>1.0/32768.0</value>
+    </param>
+    <param>
+      <key>max_gain</key>
+      <value>1.0</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(615, 99)</value>
+      <value>(538, 290)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(606, 463)</value>
+      <value>(720, 297)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>virtual_source</key>
+    <key>gr_moving_average_xx</key>
     <param>
       <key>id</key>
-      <value>samples_source</value>
+      <value>gr_moving_average_xx_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>stream_id</key>
-      <value>samples</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(164, 479)</value>
+      <key>type</key>
+      <value>float</value>
     </param>
     <param>
-      <key>_rotation</key>
-      <value>0</value>
+      <key>length</key>
+      <value>hs</value>
     </param>
-  </block>
-  <block>
-    <key>gr_short_to_float</key>
     <param>
-      <key>id</key>
-      <value>s2f</value>
+      <key>scale</key>
+      <value>1.0/hs</value>
     </param>
     <param>
-      <key>_enabled</key>
-      <value>True</value>
+      <key>max_iter</key>
+      <value>4000</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(365, 380)</value>
+      <value>(949, 297)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>gr_file_source</key>
+    <key>gr_clock_recovery_mm_xx</key>
     <param>
       <key>id</key>
-      <value>file_source</value>
+      <value>gr_clock_recovery_mm_xx_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>file</key>
-      <value>filename</value>
+      <key>type</key>
+      <value>float</value>
     </param>
     <param>
-      <key>type</key>
-      <value>short</value>
+      <key>omega</key>
+      <value>sps/2.0</value>
     </param>
     <param>
-      <key>repeat</key>
-      <value>False</value>
+      <key>gain_omega</key>
+      <value>clock_alpha**2/4.0</value>
     </param>
     <param>
-      <key>vlen</key>
-      <value>1</value>
+      <key>mu</key>
+      <value>0.5</value>
+    </param>
+    <param>
+      <key>gain_mu</key>
+      <value>clock_alpha</value>
+    </param>
+    <param>
+      <key>omega_relative_limit</key>
+      <value>max_clock_offset</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(162, 368)</value>
+      <value>(1158, 281)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>variable</key>
+    <key>gr_binary_slicer_fb</key>
     <param>
       <key>id</key>
-      <value>mf_taps</value>
+      <value>gr_binary_slicer_fb_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
-    <param>
-      <key>value</key>
-      <value>[-0.5/hs,]*hs+[0.5/hs,]*hs</value>
-    </param>
     <param>
       <key>_coordinate</key>
-      <value>(829, 21)</value>
+      <value>(112, 537)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>gr_fir_filter_xxx</key>
+    <key>gr_file_sink</key>
     <param>
       <key>id</key>
-      <value>gr_fir_filter_xxx_0</value>
+      <value>gr_file_sink_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>type</key>
-      <value>ccc</value>
+      <key>file</key>
+      <value>output_filename</value>
     </param>
     <param>
-      <key>decim</key>
-      <value>1</value>
+      <key>type</key>
+      <value>short</value>
     </param>
     <param>
-      <key>taps</key>
-      <value>mf_taps</value>
+      <key>vlen</key>
+      <value>1</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(359, 471)</value>
+      <value>(732, 615)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>import</key>
+    <key>noaa_hrpt_decoder</key>
     <param>
       <key>id</key>
-      <value>import_0</value>
+      <value>noaa_hrpt_decoder_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
-    <param>
-      <key>import</key>
-      <value>import math</value>
-    </param>
     <param>
       <key>_coordinate</key>
-      <value>(11, 111)</value>
+      <value>(730, 537)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>options</key>
+    <key>noaa_hrpt_bit_sync</key>
     <param>
       <key>id</key>
-      <value>demod_hrpt_file</value>
+      <value>noaa_hrpt_bit_sync_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>title</key>
-      <value>USRP HRPT Receiver</value>
-    </param>
-    <param>
-      <key>author</key>
-      <value></value>
-    </param>
-    <param>
-      <key>description</key>
-      <value></value>
-    </param>
-    <param>
-      <key>window_size</key>
-      <value>4096,4096</value>
-    </param>
-    <param>
-      <key>generate_options</key>
-      <value>no_gui</value>
+      <key>_coordinate</key>
+      <value>(330, 537)</value>
     </param>
     <param>
-      <key>category</key>
-      <value>Custom</value>
+      <key>_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>noaa_hrpt_deframer</key>
     <param>
-      <key>run_options</key>
-      <value>run</value>
+      <key>id</key>
+      <value>noaa_hrpt_deframer_0</value>
     </param>
     <param>
-      <key>run</key>
+      <key>_enabled</key>
       <value>True</value>
     </param>
-    <param>
-      <key>realtime_scheduling</key>
-      <value></value>
-    </param>
     <param>
       <key>_coordinate</key>
-      <value>(10, 10)</value>
+      <value>(536, 537)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <connection>
-    <source_block_id>deframer</source_block_id>
-    <sink_block_id>file_sink</sink_block_id>
+    <source_block_id>file_source</source_block_id>
+    <sink_block_id>cs2cf</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>sync</source_block_id>
-    <sink_block_id>deframer</sink_block_id>
+    <source_block_id>gr_clock_recovery_mm_xx_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>pll</source_block_id>
-    <sink_block_id>sync</sink_block_id>
+    <source_block_id>gr_moving_average_xx_0</source_block_id>
+    <sink_block_id>gr_clock_recovery_mm_xx_0</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>deinterleave</source_block_id>
-    <sink_block_id>f2c</sink_block_id>
-    <source_key>1</source_key>
-    <sink_key>1</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>deinterleave</source_block_id>
-    <sink_block_id>f2c</sink_block_id>
+    <source_block_id>pll</source_block_id>
+    <sink_block_id>gr_moving_average_xx_0</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>deframer</source_block_id>
-    <sink_block_id>decoder</sink_block_id>
+    <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>f2c</source_block_id>
-    <sink_block_id>samples_sink</sink_block_id>
+    <source_block_id>cs2cf</source_block_id>
+    <sink_block_id>agc</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>gr_fir_filter_xxx_0</source_block_id>
+    <source_block_id>agc</source_block_id>
     <sink_block_id>pll</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>samples_source</source_block_id>
-    <sink_block_id>gr_fir_filter_xxx_0</sink_block_id>
+    <source_block_id>noaa_hrpt_deframer_0</source_block_id>
+    <sink_block_id>gr_file_sink_0</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>s2f</source_block_id>
-    <sink_block_id>deinterleave</sink_block_id>
+    <source_block_id>noaa_hrpt_deframer_0</source_block_id>
+    <sink_block_id>noaa_hrpt_decoder_0</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>file_source</source_block_id>
-    <sink_block_id>s2f</sink_block_id>
+    <source_block_id>noaa_hrpt_bit_sync_0</source_block_id>
+    <sink_block_id>noaa_hrpt_deframer_0</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
index d5535186839d37ddbe62ef31fb4561e1daa22a21..8467231857a48038e0fe769fe21c3610b4551af9 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/env python
 ##################################################
 # Gnuradio Python Flow Graph
-# Title: USRP HRPT Receiver
-# Generated: Sun Oct  4 08:40:03 2009
+# Title: Demod Hrpt File
+# Generated: Sun Nov  1 18:39:07 2009
 ##################################################
 
 from gnuradio import eng_notation
@@ -11,21 +11,22 @@ from gnuradio import noaa
 from gnuradio.eng_option import eng_option
 from gnuradio.gr import firdes
 from optparse import OptionParser
-import math
+import math, os
 
 class demod_hrpt_file(gr.top_block):
 
-       def __init__(self, filename="usrp.dat", output="frames.dat", decim=16, pll_alpha=0.05, sync_alpha=0.05):
-               gr.top_block.__init__(self, "USRP HRPT Receiver")
+       def __init__(self, decim=16, pll_alpha=0.05, clock_alpha=0.05, sync_alpha=0.05, input_filename="usrp.dat", output_filename="frames.dat"):
+               gr.top_block.__init__(self, "Demod Hrpt File")
 
                ##################################################
                # Parameters
                ##################################################
-               self.filename = filename
-               self.output = output
                self.decim = decim
                self.pll_alpha = pll_alpha
+               self.clock_alpha = clock_alpha
                self.sync_alpha = sync_alpha
+               self.input_filename = input_filename
+               self.output_filename = output_filename
 
                ##################################################
                # Variables
@@ -33,44 +34,38 @@ class demod_hrpt_file(gr.top_block):
                self.sym_rate = sym_rate = 600*1109
                self.sample_rate = sample_rate = 64e6/decim
                self.sps = sps = sample_rate/sym_rate
-               self.hs = hs = int(sps/2.0)
-               self.mf_taps = mf_taps = [-0.5/hs,]*hs+[0.5/hs,]*hs
-               self.max_sync_offset = max_sync_offset = 0.01
+               self.max_clock_offset = max_clock_offset = 0.1
                self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate
+               self.hs = hs = int(sps/2.0)
 
                ##################################################
                # Blocks
                ##################################################
-               self.decoder = noaa.hrpt_decoder()
-               self.deframer = noaa.hrpt_deframer()
-               self.deinterleave = gr.deinterleave(gr.sizeof_float*1)
-               self.f2c = gr.float_to_complex(1)
-               self.file_sink = gr.file_sink(gr.sizeof_short*1, output)
-               self.file_source = gr.file_source(gr.sizeof_short*1, filename, False)
-               self.gr_fir_filter_xxx_0 = gr.fir_filter_ccc(1, (mf_taps))
+               self.agc = gr.agc_cc(1e-5, 1.0, 1.0/32768.0, 1.0)
+               self.cs2cf = gr.interleaved_short_to_complex()
+               self.file_source = gr.file_source(gr.sizeof_short*1, input_filename, False)
+               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_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)
-               self.s2f = gr.short_to_float()
-               self.sync = noaa.hrpt_sync_fb(sync_alpha, sync_alpha**2/4.0, sps, max_sync_offset)
 
                ##################################################
                # Connections
                ##################################################
-               self.connect((self.deframer, 0), (self.file_sink, 0))
-               self.connect((self.sync, 0), (self.deframer, 0))
-               self.connect((self.pll, 0), (self.sync, 0))
-               self.connect((self.deinterleave, 1), (self.f2c, 1))
-               self.connect((self.deinterleave, 0), (self.f2c, 0))
-               self.connect((self.deframer, 0), (self.decoder, 0))
-               self.connect((self.gr_fir_filter_xxx_0, 0), (self.pll, 0))
-               self.connect((self.f2c, 0), (self.gr_fir_filter_xxx_0, 0))
-               self.connect((self.s2f, 0), (self.deinterleave, 0))
-               self.connect((self.file_source, 0), (self.s2f, 0))
-
-       def set_filename(self, filename):
-               self.filename = filename
-
-       def set_output(self, output):
-               self.output = output
+               self.connect((self.file_source, 0), (self.cs2cf, 0))
+               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))
 
        def set_decim(self, decim):
                self.decim = decim
@@ -81,10 +76,19 @@ class demod_hrpt_file(gr.top_block):
                self.pll.set_alpha(self.pll_alpha)
                self.pll.set_beta(self.pll_alpha**2/4.0)
 
+       def set_clock_alpha(self, clock_alpha):
+               self.clock_alpha = clock_alpha
+               self.gr_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0)
+               self.gr_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha)
+
        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)
+
+       def set_input_filename(self, input_filename):
+               self.input_filename = input_filename
+
+       def set_output_filename(self, output_filename):
+               self.output_filename = output_filename
 
        def set_sym_rate(self, sym_rate):
                self.sym_rate = sym_rate
@@ -98,36 +102,34 @@ class demod_hrpt_file(gr.top_block):
        def set_sps(self, sps):
                self.sps = sps
                self.set_hs(int(self.sps/2.0))
+               self.gr_clock_recovery_mm_xx_0.set_omega(self.sps/2.0)
 
-       def set_hs(self, hs):
-               self.hs = hs
-               self.set_mf_taps([-0.5/self.hs,]*self.hs+[0.5/self.hs,]*self.hs)
-
-       def set_mf_taps(self, mf_taps):
-               self.mf_taps = mf_taps
-               self.gr_fir_filter_xxx_0.set_taps((self.mf_taps))
-
-       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)
+       def set_max_clock_offset(self, max_clock_offset):
+               self.max_clock_offset = max_clock_offset
 
        def set_max_carrier_offset(self, max_carrier_offset):
                self.max_carrier_offset = max_carrier_offset
                self.pll.set_max_offset(self.max_carrier_offset)
 
+       def set_hs(self, hs):
+               self.hs = hs
+               self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs)
+
 if __name__ == '__main__':
        parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
-       parser.add_option("-F", "--filename", dest="filename", type="string", default="usrp.dat",
-               help="Set Filename [default=%default]")
-       parser.add_option("-o", "--output", dest="output", type="string", default="frames.dat",
-               help="Set Output [default=%default]")
        parser.add_option("-d", "--decim", dest="decim", type="intx", default=16,
-               help="Set Decimation [default=%default]")
+               help="Set decim [default=%default]")
        parser.add_option("-p", "--pll-alpha", dest="pll_alpha", type="eng_float", default=eng_notation.num_to_str(0.05),
                help="Set pll_alpha [default=%default]")
+       parser.add_option("-a", "--clock-alpha", dest="clock_alpha", type="eng_float", default=eng_notation.num_to_str(0.05),
+               help="Set clock_alpha [default=%default]")
        parser.add_option("-s", "--sync-alpha", dest="sync_alpha", type="eng_float", default=eng_notation.num_to_str(0.05),
                help="Set sync_alpha [default=%default]")
+       parser.add_option("-F", "--input-filename", dest="input_filename", type="string", default="usrp.dat",
+               help="Set usrp.dat [default=%default]")
+       parser.add_option("-o", "--output-filename", dest="output_filename", type="string", default="frames.dat",
+               help="Set frames.dat [default=%default]")
        (options, args) = parser.parse_args()
-       tb = demod_hrpt_file(filename=options.filename, output=options.output, decim=options.decim, pll_alpha=options.pll_alpha, sync_alpha=options.sync_alpha)
+       tb = demod_hrpt_file(decim=options.decim, pll_alpha=options.pll_alpha, clock_alpha=options.clock_alpha, sync_alpha=options.sync_alpha, input_filename=options.input_filename, output_filename=options.output_filename)
        tb.run()
 
diff --git a/gr-noaa/apps/file_rx_hrpt.grc b/gr-noaa/apps/file_rx_hrpt.grc
new file mode 100644 (file)
index 0000000..fea53f8
--- /dev/null
@@ -0,0 +1,1254 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+  <timestamp>Sun Nov  1 19:26:11 2009</timestamp>
+  <block>
+    <key>options</key>
+    <param>
+      <key>id</key>
+      <value>file_rx_hrpt</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>USRP HRPT Receiver</value>
+    </param>
+    <param>
+      <key>author</key>
+      <value></value>
+    </param>
+    <param>
+      <key>description</key>
+      <value></value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>4096,4096</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>wx_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
+      <key>run_options</key>
+      <value>run</value>
+    </param>
+    <param>
+      <key>run</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>realtime_scheduling</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(10, 10)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>max_carrier_offset</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>2*math.pi*100e3/sample_rate</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(575, 19)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>sym_rate</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>600*1109</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(301, 19)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>sps</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>sample_rate/sym_rate</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(397, 19)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>hs</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>int(sps/2.0)</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(499, 19)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>sample_rate</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>64e6/decim</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(198, 17)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>max_clock_offset</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>0.1</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(705, 19)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_config</key>
+    <param>
+      <key>id</key>
+      <value>side</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>'A'</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>string</value>
+    </param>
+    <param>
+      <key>config_file</key>
+      <value>config_filename</value>
+    </param>
+    <param>
+      <key>section</key>
+      <value>'usrp_rx_hrpt'</value>
+    </param>
+    <param>
+      <key>option</key>
+      <value>'side'</value>
+    </param>
+    <param>
+      <key>writeback</key>
+      <value>side</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(194, 253)</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>
+  <block>
+    <key>gr_file_sink</key>
+    <param>
+      <key>id</key>
+      <value>frame_sink</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>file</key>
+      <value>output_filename</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>short</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(973, 1024)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <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>
+      <key>id</key>
+      <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>(173, 971)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>wxgui_scopesink2</key>
+    <param>
+      <key>id</key>
+      <value>demod_scope</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>Post-Demod</value>
+    </param>
+    <param>
+      <key>samp_rate</key>
+      <value>sym_rate*2.0</value>
+    </param>
+    <param>
+      <key>v_scale</key>
+      <value>0.5</value>
+    </param>
+    <param>
+      <key>v_offset</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>t_scale</key>
+      <value>10.0/sym_rate</value>
+    </param>
+    <param>
+      <key>ac_couple</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>xy_mode</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>num_inputs</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>win_size</key>
+      <value></value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value>0, 0, 1, 1</value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value>displays, 1</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(666, 542)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>180</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_clock_recovery_mm_xx</key>
+    <param>
+      <key>id</key>
+      <value>gr_clock_recovery_mm_xx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>omega</key>
+      <value>sps/2.0</value>
+    </param>
+    <param>
+      <key>gain_omega</key>
+      <value>clock_alpha**2/4.0</value>
+    </param>
+    <param>
+      <key>mu</key>
+      <value>0.5</value>
+    </param>
+    <param>
+      <key>gain_mu</key>
+      <value>clock_alpha</value>
+    </param>
+    <param>
+      <key>omega_relative_limit</key>
+      <value>max_clock_offset</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(873, 696)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_moving_average_xx</key>
+    <param>
+      <key>id</key>
+      <value>gr_moving_average_xx_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>length</key>
+      <value>hs</value>
+    </param>
+    <param>
+      <key>scale</key>
+      <value>1.0/hs</value>
+    </param>
+    <param>
+      <key>max_iter</key>
+      <value>4000</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(682, 713)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>noaa_hrpt_pll_cf</key>
+    <param>
+      <key>id</key>
+      <value>pll</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>alpha</key>
+      <value>pll_alpha</value>
+    </param>
+    <param>
+      <key>beta</key>
+      <value>pll_alpha**2/4.0</value>
+    </param>
+    <param>
+      <key>max_offset</key>
+      <value>max_carrier_offset</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(469, 713)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>virtual_sink</key>
+    <param>
+      <key>id</key>
+      <value>virtual_sink_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>(1142, 728)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>noaa_hrpt_decoder</key>
+    <param>
+      <key>id</key>
+      <value>decoder</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(974, 925)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>config_filename</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>os.environ['HOME']+'/.gnuradio/config.conf'</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(13, 159)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>import</key>
+    <param>
+      <key>id</key>
+      <value>import_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>import</key>
+      <value>import math, os</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(11, 110)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_agc_xx</key>
+    <param>
+      <key>id</key>
+      <value>agc</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>rate</key>
+      <value>1e-6</value>
+    </param>
+    <param>
+      <key>reference</key>
+      <value>1.0</value>
+    </param>
+    <param>
+      <key>gain</key>
+      <value>1.0</value>
+    </param>
+    <param>
+      <key>max_gain</key>
+      <value>1.0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(301, 705)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_interleaved_short_to_complex</key>
+    <param>
+      <key>id</key>
+      <value>gr_interleaved_short_to_complex_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(73, 733)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_throttle</key>
+    <param>
+      <key>id</key>
+      <value>throttle</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>short</value>
+    </param>
+    <param>
+      <key>samples_per_second</key>
+      <value>sample_rate</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(75, 679)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>180</value>
+    </param>
+  </block>
+  <block>
+    <key>gr_file_source</key>
+    <param>
+      <key>id</key>
+      <value>gr_file_source_0</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>file</key>
+      <value>input_filename</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>short</value>
+    </param>
+    <param>
+      <key>repeat</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(76, 613)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>parameter</key>
+    <param>
+      <key>id</key>
+      <value>input_filename</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>input_filename</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>'usrp.dat'</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>string</value>
+    </param>
+    <param>
+      <key>short_id</key>
+      <value>F</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(198, 107)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>parameter</key>
+    <param>
+      <key>id</key>
+      <value>decim</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>decim</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>16</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>intx</value>
+    </param>
+    <param>
+      <key>short_id</key>
+      <value>d</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(308, 107)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_slider</key>
+    <param>
+      <key>id</key>
+      <value>pll_alpha</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>PLL Alpha</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>saved_pll_alpha</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>0.0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>0.5</value>
+    </param>
+    <param>
+      <key>num_steps</key>
+      <value>100</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.SL_HORIZONTAL</value>
+    </param>
+    <param>
+      <key>converver</key>
+      <value>float_converter</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value>0, 0, 1, 1</value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(397, 108)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_slider</key>
+    <param>
+      <key>id</key>
+      <value>clock_alpha</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>label</key>
+      <value>Clock Alpha</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>saved_clock_alpha</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>0.0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>0.5</value>
+    </param>
+    <param>
+      <key>num_steps</key>
+      <value>100</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.SL_HORIZONTAL</value>
+    </param>
+    <param>
+      <key>converver</key>
+      <value>float_converter</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value>0, 1, 1, 1</value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(539, 105)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_config</key>
+    <param>
+      <key>id</key>
+      <value>saved_pll_alpha</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>0.05</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>real</value>
+    </param>
+    <param>
+      <key>config_file</key>
+      <value>config_filename</value>
+    </param>
+    <param>
+      <key>section</key>
+      <value>'usrp_rx_hrpt'</value>
+    </param>
+    <param>
+      <key>option</key>
+      <value>'pll_alpha'</value>
+    </param>
+    <param>
+      <key>writeback</key>
+      <value>pll_alpha</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(363, 254)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_config</key>
+    <param>
+      <key>id</key>
+      <value>saved_clock_alpha</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>0.05</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>real</value>
+    </param>
+    <param>
+      <key>config_file</key>
+      <value>config_filename</value>
+    </param>
+    <param>
+      <key>section</key>
+      <value>'usrp_rx_hrpt'</value>
+    </param>
+    <param>
+      <key>option</key>
+      <value>'clock_alpha'</value>
+    </param>
+    <param>
+      <key>writeback</key>
+      <value>clock_alpha</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(527, 256)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable_config</key>
+    <param>
+      <key>id</key>
+      <value>output_filename</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>'frames.dat'</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>string</value>
+    </param>
+    <param>
+      <key>config_file</key>
+      <value>config_filename</value>
+    </param>
+    <param>
+      <key>section</key>
+      <value>'usrp_rx_hrpt'</value>
+    </param>
+    <param>
+      <key>option</key>
+      <value>'filename'</value>
+    </param>
+    <param>
+      <key>writeback</key>
+      <value>output_filename</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(689, 257)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>notebook</key>
+    <param>
+      <key>id</key>
+      <value>displays</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.NB_TOP</value>
+    </param>
+    <param>
+      <key>labels</key>
+      <value>['Spectrum','Demod']</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value>1,0,1,2</value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(12, 249)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>wxgui_fftsink2</key>
+    <param>
+      <key>id</key>
+      <value>rx_fft</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>RX Spectrum</value>
+    </param>
+    <param>
+      <key>samp_rate</key>
+      <value>sample_rate</value>
+    </param>
+    <param>
+      <key>baseband_freq</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>y_per_div</key>
+      <value>5</value>
+    </param>
+    <param>
+      <key>y_divs</key>
+      <value>8</value>
+    </param>
+    <param>
+      <key>ref_level</key>
+      <value>-5</value>
+    </param>
+    <param>
+      <key>ref_scale</key>
+      <value>2.0</value>
+    </param>
+    <param>
+      <key>fft_size</key>
+      <value>1024</value>
+    </param>
+    <param>
+      <key>fft_rate</key>
+      <value>15</value>
+    </param>
+    <param>
+      <key>peak_hold</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>average</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>avg_alpha</key>
+      <value>0.1</value>
+    </param>
+    <param>
+      <key>win</key>
+      <value>None</value>
+    </param>
+    <param>
+      <key>win_size</key>
+      <value>640, 360</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value>0, 0, 1, 1</value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value>displays, 0</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(471, 450)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <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>
+  <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>deframer</source_block_id>
+    <sink_block_id>frame_sink</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>deframer</source_block_id>
+    <sink_block_id>decoder</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_clock_recovery_mm_xx_0</source_block_id>
+    <sink_block_id>virtual_sink_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_clock_recovery_mm_xx_0</source_block_id>
+    <sink_block_id>demod_scope</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_moving_average_xx_0</source_block_id>
+    <sink_block_id>gr_clock_recovery_mm_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>pll</source_block_id>
+    <sink_block_id>gr_moving_average_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>agc</source_block_id>
+    <sink_block_id>pll</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>agc</source_block_id>
+    <sink_block_id>rx_fft</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_interleaved_short_to_complex_0</source_block_id>
+    <sink_block_id>agc</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>throttle</source_block_id>
+    <sink_block_id>gr_interleaved_short_to_complex_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_file_source_0</source_block_id>
+    <sink_block_id>throttle</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
new file mode 100755 (executable)
index 0000000..c1491ca
--- /dev/null
@@ -0,0 +1,309 @@
+#!/usr/bin/env python
+##################################################
+# Gnuradio Python Flow Graph
+# Title: USRP HRPT Receiver
+# Generated: Sun Nov  1 19:26:11 2009
+##################################################
+
+from gnuradio import eng_notation
+from gnuradio import gr
+from gnuradio import noaa
+from gnuradio import window
+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
+from grc_gnuradio import wxgui as grc_wxgui
+from optparse import OptionParser
+import ConfigParser
+import math, os
+import wx
+
+class file_rx_hrpt(grc_wxgui.top_block_gui):
+
+       def __init__(self, input_filename='usrp.dat', decim=16):
+               grc_wxgui.top_block_gui.__init__(self, title="USRP HRPT Receiver")
+
+               ##################################################
+               # Parameters
+               ##################################################
+               self.input_filename = input_filename
+               self.decim = decim
+
+               ##################################################
+               # Variables
+               ##################################################
+               self.sym_rate = sym_rate = 600*1109
+               self.sample_rate = sample_rate = 64e6/decim
+               self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf'
+               self.sps = sps = sample_rate/sym_rate
+               self._saved_pll_alpha_config = ConfigParser.ConfigParser()
+               self._saved_pll_alpha_config.read(config_filename)
+               try: saved_pll_alpha = self._saved_pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha')
+               except: saved_pll_alpha = 0.05
+               self.saved_pll_alpha = saved_pll_alpha
+               self._saved_clock_alpha_config = ConfigParser.ConfigParser()
+               self._saved_clock_alpha_config.read(config_filename)
+               try: saved_clock_alpha = self._saved_clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha')
+               except: saved_clock_alpha = 0.05
+               self.saved_clock_alpha = saved_clock_alpha
+               self._side_config = ConfigParser.ConfigParser()
+               self._side_config.read(config_filename)
+               try: side = self._side_config.get('usrp_rx_hrpt', 'side')
+               except: side = 'A'
+               self.side = side
+               self.pll_alpha = pll_alpha = saved_pll_alpha
+               self._output_filename_config = ConfigParser.ConfigParser()
+               self._output_filename_config.read(config_filename)
+               try: output_filename = self._output_filename_config.get('usrp_rx_hrpt', 'filename')
+               except: output_filename = 'frames.dat'
+               self.output_filename = output_filename
+               self.max_clock_offset = max_clock_offset = 0.1
+               self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate
+               self.hs = hs = int(sps/2.0)
+               self.clock_alpha = clock_alpha = saved_clock_alpha
+
+               ##################################################
+               # Notebooks
+               ##################################################
+               self.displays = wx.Notebook(self.GetWin(), style=wx.NB_TOP)
+               self.displays.AddPage(grc_wxgui.Panel(self.displays), "Spectrum")
+               self.displays.AddPage(grc_wxgui.Panel(self.displays), "Demod")
+               self.GridAdd(self.displays, 1, 0, 1, 2)
+
+               ##################################################
+               # Controls
+               ##################################################
+               _pll_alpha_sizer = wx.BoxSizer(wx.VERTICAL)
+               self._pll_alpha_text_box = forms.text_box(
+                       parent=self.GetWin(),
+                       sizer=_pll_alpha_sizer,
+                       value=self.pll_alpha,
+                       callback=self.set_pll_alpha,
+                       label="PLL Alpha",
+                       converter=forms.float_converter(),
+                       proportion=0,
+               )
+               self._pll_alpha_slider = forms.slider(
+                       parent=self.GetWin(),
+                       sizer=_pll_alpha_sizer,
+                       value=self.pll_alpha,
+                       callback=self.set_pll_alpha,
+                       minimum=0.0,
+                       maximum=0.5,
+                       num_steps=100,
+                       style=wx.SL_HORIZONTAL,
+                       cast=float,
+                       proportion=1,
+               )
+               self.GridAdd(_pll_alpha_sizer, 0, 0, 1, 1)
+               _clock_alpha_sizer = wx.BoxSizer(wx.VERTICAL)
+               self._clock_alpha_text_box = forms.text_box(
+                       parent=self.GetWin(),
+                       sizer=_clock_alpha_sizer,
+                       value=self.clock_alpha,
+                       callback=self.set_clock_alpha,
+                       label="Clock Alpha",
+                       converter=forms.float_converter(),
+                       proportion=0,
+               )
+               self._clock_alpha_slider = forms.slider(
+                       parent=self.GetWin(),
+                       sizer=_clock_alpha_sizer,
+                       value=self.clock_alpha,
+                       callback=self.set_clock_alpha,
+                       minimum=0.0,
+                       maximum=0.5,
+                       num_steps=100,
+                       style=wx.SL_HORIZONTAL,
+                       cast=float,
+                       proportion=1,
+               )
+               self.GridAdd(_clock_alpha_sizer, 0, 1, 1, 1)
+
+               ##################################################
+               # Blocks
+               ##################################################
+               self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0)
+               self.decoder = noaa.hrpt_decoder()
+               self.deframer = noaa.hrpt_deframer()
+               self.demod_scope = scopesink2.scope_sink_f(
+                       self.displays.GetPage(1).GetWin(),
+                       title="Post-Demod",
+                       sample_rate=sym_rate*2.0,
+                       v_scale=0.5,
+                       v_offset=0,
+                       t_scale=10.0/sym_rate,
+                       ac_couple=False,
+                       xy_mode=False,
+                       num_inputs=1,
+               )
+               self.displays.GetPage(1).GridAdd(self.demod_scope.win, 0, 0, 1, 1)
+               self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename)
+               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_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(),
+                       baseband_freq=0,
+                       y_per_div=5,
+                       y_divs=8,
+                       ref_level=-5,
+                       ref_scale=2.0,
+                       sample_rate=sample_rate,
+                       fft_size=1024,
+                       fft_rate=15,
+                       average=True,
+                       avg_alpha=0.1,
+                       title="RX Spectrum",
+                       peak_hold=False,
+                       size=(640, 360),
+               )
+               self.displays.GetPage(0).GridAdd(self.rx_fft.win, 0, 0, 1, 1)
+               self.throttle = gr.throttle(gr.sizeof_short*1, sample_rate)
+
+               ##################################################
+               # 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))
+               self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.demod_scope, 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.agc, 0), (self.pll, 0))
+               self.connect((self.agc, 0), (self.rx_fft, 0))
+               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))
+
+       def set_input_filename(self, input_filename):
+               self.input_filename = input_filename
+
+       def set_decim(self, decim):
+               self.decim = decim
+               self.set_sample_rate(64e6/self.decim)
+
+       def set_sym_rate(self, sym_rate):
+               self.sym_rate = sym_rate
+               self.set_sps(self.sample_rate/self.sym_rate)
+               self.demod_scope.set_sample_rate(self.sym_rate*2.0)
+
+       def set_sample_rate(self, sample_rate):
+               self.sample_rate = sample_rate
+               self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate)
+               self.set_sps(self.sample_rate/self.sym_rate)
+               self.rx_fft.set_sample_rate(self.sample_rate)
+
+       def set_config_filename(self, config_filename):
+               self.config_filename = config_filename
+               self._side_config = ConfigParser.ConfigParser()
+               self._side_config.read(self.config_filename)
+               if not self._side_config.has_section('usrp_rx_hrpt'):
+                       self._side_config.add_section('usrp_rx_hrpt')
+               self._side_config.set('usrp_rx_hrpt', 'side', str(self.side))
+               self._side_config.write(open(self.config_filename, 'w'))
+               self._saved_pll_alpha_config = ConfigParser.ConfigParser()
+               self._saved_pll_alpha_config.read(self.config_filename)
+               if not self._saved_pll_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._saved_pll_alpha_config.add_section('usrp_rx_hrpt')
+               self._saved_pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha))
+               self._saved_pll_alpha_config.write(open(self.config_filename, 'w'))
+               self._saved_clock_alpha_config = ConfigParser.ConfigParser()
+               self._saved_clock_alpha_config.read(self.config_filename)
+               if not self._saved_clock_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._saved_clock_alpha_config.add_section('usrp_rx_hrpt')
+               self._saved_clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha))
+               self._saved_clock_alpha_config.write(open(self.config_filename, 'w'))
+               self._output_filename_config = ConfigParser.ConfigParser()
+               self._output_filename_config.read(self.config_filename)
+               if not self._output_filename_config.has_section('usrp_rx_hrpt'):
+                       self._output_filename_config.add_section('usrp_rx_hrpt')
+               self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename))
+               self._output_filename_config.write(open(self.config_filename, 'w'))
+
+       def set_sps(self, sps):
+               self.sps = sps
+               self.set_hs(int(self.sps/2.0))
+               self.gr_clock_recovery_mm_xx_0.set_omega(self.sps/2.0)
+
+       def set_saved_pll_alpha(self, saved_pll_alpha):
+               self.saved_pll_alpha = saved_pll_alpha
+               self.set_pll_alpha(self.saved_pll_alpha)
+
+       def set_saved_clock_alpha(self, saved_clock_alpha):
+               self.saved_clock_alpha = saved_clock_alpha
+               self.set_clock_alpha(self.saved_clock_alpha)
+
+       def set_side(self, side):
+               self.side = side
+               self._side_config = ConfigParser.ConfigParser()
+               self._side_config.read(self.config_filename)
+               if not self._side_config.has_section('usrp_rx_hrpt'):
+                       self._side_config.add_section('usrp_rx_hrpt')
+               self._side_config.set('usrp_rx_hrpt', 'side', str(self.side))
+               self._side_config.write(open(self.config_filename, 'w'))
+
+       def set_pll_alpha(self, pll_alpha):
+               self.pll_alpha = pll_alpha
+               self.pll.set_alpha(self.pll_alpha)
+               self.pll.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._saved_pll_alpha_config = ConfigParser.ConfigParser()
+               self._saved_pll_alpha_config.read(self.config_filename)
+               if not self._saved_pll_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._saved_pll_alpha_config.add_section('usrp_rx_hrpt')
+               self._saved_pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha))
+               self._saved_pll_alpha_config.write(open(self.config_filename, 'w'))
+
+       def set_output_filename(self, output_filename):
+               self.output_filename = output_filename
+               self._output_filename_config = ConfigParser.ConfigParser()
+               self._output_filename_config.read(self.config_filename)
+               if not self._output_filename_config.has_section('usrp_rx_hrpt'):
+                       self._output_filename_config.add_section('usrp_rx_hrpt')
+               self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename))
+               self._output_filename_config.write(open(self.config_filename, 'w'))
+
+       def set_max_clock_offset(self, max_clock_offset):
+               self.max_clock_offset = max_clock_offset
+
+       def set_max_carrier_offset(self, max_carrier_offset):
+               self.max_carrier_offset = max_carrier_offset
+               self.pll.set_max_offset(self.max_carrier_offset)
+
+       def set_hs(self, hs):
+               self.hs = hs
+               self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs)
+
+       def set_clock_alpha(self, clock_alpha):
+               self.clock_alpha = clock_alpha
+               self.gr_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0)
+               self.gr_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha)
+               self._clock_alpha_slider.set_value(self.clock_alpha)
+               self._clock_alpha_text_box.set_value(self.clock_alpha)
+               self._saved_clock_alpha_config = ConfigParser.ConfigParser()
+               self._saved_clock_alpha_config.read(self.config_filename)
+               if not self._saved_clock_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._saved_clock_alpha_config.add_section('usrp_rx_hrpt')
+               self._saved_clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha))
+               self._saved_clock_alpha_config.write(open(self.config_filename, 'w'))
+
+if __name__ == '__main__':
+       parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
+       parser.add_option("-F", "--input-filename", dest="input_filename", type="string", default='usrp.dat',
+               help="Set usrp.dat [default=%default]")
+       parser.add_option("-d", "--decim", dest="decim", type="intx", default=16,
+               help="Set decim [default=%default]")
+       (options, args) = parser.parse_args()
+       tb = file_rx_hrpt(input_filename=options.input_filename, decim=options.decim)
+       tb.Run(True)
+
diff --git a/gr-noaa/apps/usrp_rx_hrpt.cfg b/gr-noaa/apps/usrp_rx_hrpt.cfg
deleted file mode 100644 (file)
index 69f3c0b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-[output]
-filename = frames.dat
-
-[demod]
-pll_alpha = 0.05
-sync_alpha = 0.05
-
-[usrp]
-freq = 1698000000.0
-decim = 16
-side = A
-gain = 35.0
-
index d0687971617cb7683ac64d177f9fc232e4f34645..da2f417802a5779ed6a45ee794e02b139669c596 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='ASCII'?>
 <flow_graph>
-  <timestamp>Sun Sep 27 13:37:22 2009</timestamp>
+  <timestamp>Sun Nov  1 19:28:12 2009</timestamp>
   <block>
     <key>options</key>
     <param>
       <key>category</key>
       <value>Custom</value>
     </param>
+    <param>
+      <key>run_options</key>
+      <value>prompt</value>
+    </param>
     <param>
       <key>run</key>
       <value>True</value>
       <value>0</value>
     </param>
   </block>
-  <block>
-    <key>import</key>
-    <param>
-      <key>id</key>
-      <value>import_0</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>import</key>
-      <value>import math</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(11, 76)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>config_filename</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>'usrp_rx_hrpt.cfg'</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(12, 129)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
   <block>
     <key>variable</key>
     <param>
     </param>
   </block>
   <block>
-    <key>variable_slider</key>
+    <key>variable_static_text</key>
     <param>
       <key>id</key>
-      <value>sync_alpha</value>
+      <value>side_text</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>label</key>
-      <value>SYNC Alpha</value>
+      <value>USRP Side</value>
     </param>
     <param>
       <key>value</key>
-      <value>saved_sync_alpha</value>
-    </param>
-    <param>
-      <key>min</key>
-      <value>0.0</value>
-    </param>
-    <param>
-      <key>max</key>
-      <value>0.5</value>
-    </param>
-    <param>
-      <key>num_steps</key>
-      <value>100</value>
+      <value>side</value>
     </param>
     <param>
-      <key>style</key>
-      <value>wx.SL_HORIZONTAL</value>
+      <key>converver</key>
+      <value>str_converter</value>
     </param>
     <param>
-      <key>converver</key>
-      <value>float_converter</value>
+      <key>formatter</key>
+      <value>None</value>
     </param>
     <param>
       <key>grid_pos</key>
-      <value>0, 3, 1, 1</value>
+      <value>1, 0, 1, 1</value>
     </param>
     <param>
       <key>notebook</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(618, 106)</value>
+      <value>(828, 20)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_static_text</key>
     <param>
       <key>id</key>
-      <value>side_text</value>
+      <value>decim_text</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>label</key>
-      <value>USRP Side</value>
+      <value>Decimation</value>
     </param>
     <param>
       <key>value</key>
-      <value>side</value>
+      <value>decim</value>
     </param>
     <param>
       <key>converver</key>
-      <value>str_converter</value>
+      <value>float_converter</value>
     </param>
     <param>
       <key>formatter</key>
     </param>
     <param>
       <key>grid_pos</key>
-      <value>1, 0, 1, 1</value>
+      <value>1, 1, 1, 1</value>
     </param>
     <param>
       <key>notebook</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(828, 20)</value>
+      <value>(973, 20)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>variable_config</key>
+    <key>variable</key>
     <param>
       <key>id</key>
-      <value>side</value>
+      <value>config_filename</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>'A'</value>
+      <value>os.environ['HOME']+'/.gnuradio/config.conf'</value>
     </param>
     <param>
-      <key>type</key>
-      <value>string</value>
+      <key>_coordinate</key>
+      <value>(12, 129)</value>
     </param>
     <param>
-      <key>config_file</key>
-      <value>config_filename</value>
+      <key>_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>import</key>
     <param>
-      <key>section</key>
-      <value>'usrp'</value>
+      <key>id</key>
+      <value>import_0</value>
     </param>
     <param>
-      <key>option</key>
-      <value>'side'</value>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
-      <key>writeback</key>
-      <value>side</value>
+      <key>import</key>
+      <value>import math, os</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(194, 253)</value>
+      <value>(11, 76)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>decim</value>
+      <value>saved_freq</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>16</value>
+      <value>1698e6</value>
     </param>
     <param>
       <key>type</key>
     </param>
     <param>
       <key>section</key>
-      <value>'usrp'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'decim'</value>
+      <value>'freq'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>decim</value>
+      <value>freq</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(351, 255)</value>
+      <value>(507, 258)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>saved_freq</value>
+      <value>saved_gain</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>1698e6</value>
+      <value>35</value>
     </param>
     <param>
       <key>type</key>
     </param>
     <param>
       <key>section</key>
-      <value>'usrp'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'freq'</value>
+      <value>'gain'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>freq</value>
+      <value>gain</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(507, 258)</value>
+      <value>(664, 259)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>saved_gain</value>
+      <value>output_filename</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>35</value>
+      <value>'frames.dat'</value>
     </param>
     <param>
       <key>type</key>
-      <value>real</value>
+      <value>string</value>
     </param>
     <param>
       <key>config_file</key>
     </param>
     <param>
       <key>section</key>
-      <value>'usrp'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'gain'</value>
+      <value>'filename'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>gain</value>
+      <value>output_filename</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(664, 259)</value>
+      <value>(1139, 259)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>variable_config</key>
+    <key>variable</key>
     <param>
       <key>id</key>
-      <value>saved_pll_alpha</value>
+      <value>max_clock_offset</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>0.05</value>
+      <value>0.1</value>
     </param>
     <param>
-      <key>type</key>
-      <value>real</value>
+      <key>_coordinate</key>
+      <value>(705, 19)</value>
     </param>
     <param>
-      <key>config_file</key>
-      <value>config_filename</value>
+      <key>_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>variable_slider</key>
     <param>
-      <key>section</key>
-      <value>'demod'</value>
+      <key>id</key>
+      <value>clock_alpha</value>
     </param>
     <param>
-      <key>option</key>
-      <value>'pll_alpha'</value>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
-      <key>writeback</key>
-      <value>pll_alpha</value>
+      <key>label</key>
+      <value>Clock Alpha</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>saved_clock_alpha</value>
+    </param>
+    <param>
+      <key>min</key>
+      <value>0.0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>0.5</value>
+    </param>
+    <param>
+      <key>num_steps</key>
+      <value>100</value>
+    </param>
+    <param>
+      <key>style</key>
+      <value>wx.SL_HORIZONTAL</value>
+    </param>
+    <param>
+      <key>converver</key>
+      <value>float_converter</value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value>0, 3, 1, 1</value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value></value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(823, 258)</value>
+      <value>(618, 106)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>saved_sync_alpha</value>
+      <value>saved_pll_alpha</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>section</key>
-      <value>'demod'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'sync_alpha'</value>
+      <value>'pll_alpha'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>sync_alpha</value>
+      <value>pll_alpha</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(981, 258)</value>
+      <value>(823, 258)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>output_filename</value>
+      <value>saved_clock_alpha</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>'frames.dat'</value>
+      <value>0.05</value>
     </param>
     <param>
       <key>type</key>
-      <value>string</value>
+      <value>real</value>
     </param>
     <param>
       <key>config_file</key>
     </param>
     <param>
       <key>section</key>
-      <value>'output'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'filename'</value>
+      <value>'clock_alpha'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>output_filename</value>
+      <value>clock_alpha</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1139, 259)</value>
+      <value>(981, 258)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>variable_static_text</key>
+    <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>decim_text</value>
+      <value>decim</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>label</key>
-      <value>Decimation</value>
+      <key>value</key>
+      <value>16</value>
     </param>
     <param>
-      <key>value</key>
-      <value>decim</value>
+      <key>type</key>
+      <value>real</value>
     </param>
     <param>
-      <key>converver</key>
-      <value>float_converter</value>
+      <key>config_file</key>
+      <value>config_filename</value>
     </param>
     <param>
-      <key>formatter</key>
-      <value>None</value>
+      <key>section</key>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
-      <key>grid_pos</key>
-      <value>1, 1, 1, 1</value>
+      <key>option</key>
+      <value>'decim'</value>
     </param>
     <param>
-      <key>notebook</key>
-      <value></value>
+      <key>writeback</key>
+      <value>decim</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(973, 20)</value>
+      <value>(351, 255)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>variable</key>
+    <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>max_sync_offset</value>
+      <value>side</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>0.01</value>
+      <value>'A'</value>
     </param>
     <param>
-      <key>_coordinate</key>
-      <value>(705, 19)</value>
+      <key>type</key>
+      <value>string</value>
+    </param>
+    <param>
+      <key>config_file</key>
+      <value>config_filename</value>
+    </param>
+    <param>
+      <key>section</key>
+      <value>'usrp_rx_hrpt'</value>
+    </param>
+    <param>
+      <key>option</key>
+      <value>'side'</value>
+    </param>
+    <param>
+      <key>writeback</key>
+      <value>side</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(194, 253)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
     <param>
       <key>labels</key>
-      <value>['RX','Demod']</value>
+      <value>['Spectrum','Demod']</value>
     </param>
     <param>
       <key>grid_pos</key>
-      <value>2, 0, 1, 4</value>
+      <value>2,0,1,4</value>
     </param>
     <param>
       <key>notebook</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(15, 237)</value>
+      <value>(12, 249)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_sync_fb</key>
+    <key>noaa_hrpt_deframer</key>
     <param>
       <key>id</key>
-      <value>sync</value>
+      <value>deframer</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>alpha</key>
-      <value>sync_alpha</value>
+      <key>_coordinate</key>
+      <value>(762, 975)</value>
     </param>
     <param>
-      <key>beta</key>
-      <value>sync_alpha**2/4.0</value>
+      <key>_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>gr_file_sink</key>
     <param>
-      <key>sps</key>
-      <value>sps</value>
+      <key>id</key>
+      <value>frame_sink</value>
     </param>
     <param>
-      <key>max_offset</key>
-      <value>max_sync_offset</value>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>file</key>
+      <value>output_filename</value>
+    </param>
+    <param>
+      <key>type</key>
+      <value>short</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(840, 715)</value>
+      <value>(973, 1024)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_deframer</key>
+    <key>noaa_hrpt_bit_sync</key>
     <param>
       <key>id</key>
-      <value>deframer</value>
+      <value>noaa_hrpt_bit_sync_0</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1071, 743)</value>
+      <value>(571, 975)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_decoder</key>
+    <key>gr_binary_slicer_fb</key>
     <param>
       <key>id</key>
-      <value>decoder</value>
+      <value>gr_binary_slicer_fb_0</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1274, 743)</value>
+      <value>(393, 975)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>gr_file_sink</key>
+    <key>virtual_source</key>
     <param>
       <key>id</key>
-      <value>frame_sink</value>
+      <value>virtual_source_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>file</key>
-      <value>output_filename</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>short</value>
-    </param>
-    <param>
-      <key>vlen</key>
-      <value>1</value>
+      <key>stream_id</key>
+      <value>baseband</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1273, 851)</value>
+      <value>(173, 971)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>variable</key>
+    <key>wxgui_scopesink2</key>
     <param>
       <key>id</key>
-      <value>mf_taps</value>
+      <value>demod_scope</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>value</key>
-      <value>[-0.5/hs,]*hs+[0.5/hs]*hs</value>
+      <key>type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>title</key>
+      <value>Post-Demod</value>
+    </param>
+    <param>
+      <key>samp_rate</key>
+      <value>sym_rate*2.0</value>
+    </param>
+    <param>
+      <key>v_scale</key>
+      <value>0.5</value>
+    </param>
+    <param>
+      <key>v_offset</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>t_scale</key>
+      <value>10.0/sym_rate</value>
+    </param>
+    <param>
+      <key>ac_couple</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>xy_mode</key>
+      <value>False</value>
+    </param>
+    <param>
+      <key>num_inputs</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>win_size</key>
+      <value></value>
+    </param>
+    <param>
+      <key>grid_pos</key>
+      <value>0, 0, 1, 1</value>
+    </param>
+    <param>
+      <key>notebook</key>
+      <value>displays, 1</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(792, 158)</value>
+      <value>(666, 542)</value>
     </param>
     <param>
       <key>_rotation</key>
-      <value>0</value>
+      <value>180</value>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_pll_cf</key>
+    <key>gr_clock_recovery_mm_xx</key>
     <param>
       <key>id</key>
-      <value>pll</value>
+      <value>gr_clock_recovery_mm_xx_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>alpha</key>
-      <value>pll_alpha</value>
+      <key>type</key>
+      <value>float</value>
     </param>
     <param>
-      <key>beta</key>
-      <value>pll_alpha**2/4.0</value>
+      <key>omega</key>
+      <value>sps/2.0</value>
     </param>
     <param>
-      <key>max_offset</key>
-      <value>max_carrier_offset</value>
+      <key>gain_omega</key>
+      <value>clock_alpha**2/4.0</value>
+    </param>
+    <param>
+      <key>mu</key>
+      <value>0.5</value>
+    </param>
+    <param>
+      <key>gain_mu</key>
+      <value>clock_alpha</value>
+    </param>
+    <param>
+      <key>omega_relative_limit</key>
+      <value>max_clock_offset</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(632, 723)</value>
+      <value>(873, 696)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>gr_fir_filter_xxx</key>
+    <key>gr_moving_average_xx</key>
     <param>
       <key>id</key>
-      <value>gr_fir_filter_xxx_0</value>
+      <value>gr_moving_average_xx_0</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>type</key>
-      <value>ccc</value>
+      <value>float</value>
     </param>
     <param>
-      <key>decim</key>
-      <value>1</value>
+      <key>length</key>
+      <value>hs</value>
     </param>
     <param>
-      <key>taps</key>
-      <value>mf_taps</value>
+      <key>scale</key>
+      <value>1.0/hs</value>
+    </param>
+    <param>
+      <key>max_iter</key>
+      <value>4000</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(400, 731)</value>
+      <value>(682, 713)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>usrp_simple_source_x</key>
+    <key>noaa_hrpt_pll_cf</key>
     <param>
       <key>id</key>
-      <value>usrp_source</value>
+      <value>pll</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>type</key>
-      <value>complex</value>
+      <key>alpha</key>
+      <value>pll_alpha</value>
     </param>
     <param>
-      <key>format</key>
-      <value></value>
+      <key>beta</key>
+      <value>pll_alpha**2/4.0</value>
     </param>
     <param>
-      <key>which</key>
+      <key>max_offset</key>
+      <value>max_carrier_offset</value>
+    </param>
+    <param>
+      <key>_coordinate</key>
+      <value>(469, 713)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
       <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>virtual_sink</key>
     <param>
-      <key>decimation</key>
-      <value>decim</value>
+      <key>id</key>
+      <value>virtual_sink_0</value>
     </param>
     <param>
-      <key>frequency</key>
-      <value>freq</value>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
-      <key>lo_offset</key>
-      <value>float('inf')</value>
+      <key>stream_id</key>
+      <value>baseband</value>
     </param>
     <param>
-      <key>gain</key>
-      <value>gain</value>
+      <key>_coordinate</key>
+      <value>(1142, 728)</value>
     </param>
     <param>
-      <key>side</key>
-      <value>side</value>
+      <key>_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>noaa_hrpt_decoder</key>
     <param>
-      <key>rx_ant</key>
-      <value>RXA</value>
+      <key>id</key>
+      <value>decoder</value>
     </param>
     <param>
-      <key>hb_filters</key>
-      <value></value>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(28, 699)</value>
+      <value>(974, 925)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(240, 715)</value>
+      <value>(301, 705)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>wxgui_scopesink2</key>
+    <key>usrp_simple_source_x</key>
     <param>
       <key>id</key>
-      <value>rx_scope</value>
+      <value>usrp_source</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>complex</value>
     </param>
     <param>
-      <key>title</key>
-      <value>RX Waveform</value>
+      <key>format</key>
+      <value></value>
     </param>
     <param>
-      <key>samp_rate</key>
-      <value>sample_rate</value>
+      <key>which</key>
+      <value>0</value>
     </param>
     <param>
-      <key>v_scale</key>
-      <value>0</value>
+      <key>decimation</key>
+      <value>decim</value>
     </param>
     <param>
-      <key>t_scale</key>
-      <value>20.0/sample_rate</value>
+      <key>frequency</key>
+      <value>freq</value>
     </param>
     <param>
-      <key>ac_couple</key>
-      <value>False</value>
+      <key>lo_offset</key>
+      <value>float('inf')</value>
     </param>
     <param>
-      <key>xy_mode</key>
-      <value>False</value>
+      <key>gain</key>
+      <value>gain</value>
     </param>
     <param>
-      <key>num_inputs</key>
-      <value>1</value>
+      <key>side</key>
+      <value>side</value>
     </param>
     <param>
-      <key>grid_pos</key>
-      <value>1, 0, 1, 1</value>
+      <key>rx_ant</key>
+      <value>RXA</value>
     </param>
     <param>
-      <key>notebook</key>
-      <value>displays, 0</value>
+      <key>hb_filters</key>
+      <value></value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(406, 838)</value>
+      <value>(89, 689)</value>
     </param>
     <param>
       <key>_rotation</key>
       <value>0.1</value>
     </param>
     <param>
-      <key>grid_pos</key>
-      <value>0, 0, 1, 1</value>
-    </param>
-    <param>
-      <key>notebook</key>
-      <value>displays, 0</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(406, 466)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>wxgui_scopesink2</key>
-    <param>
-      <key>id</key>
-      <value>pll_scope</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>float</value>
-    </param>
-    <param>
-      <key>title</key>
-      <value>Demod Waveform</value>
-    </param>
-    <param>
-      <key>samp_rate</key>
-      <value>sample_rate</value>
-    </param>
-    <param>
-      <key>v_scale</key>
-      <value>0.5</value>
-    </param>
-    <param>
-      <key>t_scale</key>
-      <value>20.0/sample_rate</value>
-    </param>
-    <param>
-      <key>ac_couple</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>xy_mode</key>
-      <value>False</value>
+      <key>win</key>
+      <value>None</value>
     </param>
     <param>
-      <key>num_inputs</key>
-      <value>1</value>
+      <key>win_size</key>
+      <value>640, 360</value>
     </param>
     <param>
       <key>grid_pos</key>
     </param>
     <param>
       <key>notebook</key>
-      <value>displays, 1</value>
+      <value>displays, 0</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(605, 552)</value>
+      <value>(477, 457)</value>
     </param>
     <param>
       <key>_rotation</key>
-      <value>180</value>
+      <value>0</value>
     </param>
   </block>
   <connection>
-    <source_block_id>deframer</source_block_id>
-    <sink_block_id>frame_sink</sink_block_id>
+    <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>sync</source_block_id>
-    <sink_block_id>deframer</sink_block_id>
+    <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>pll</source_block_id>
-    <sink_block_id>sync</sink_block_id>
+    <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>pll</source_block_id>
-    <sink_block_id>pll_scope</sink_block_id>
+    <source_block_id>deframer</source_block_id>
+    <sink_block_id>frame_sink</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>agc</source_block_id>
-    <sink_block_id>rx_scope</sink_block_id>
+    <source_block_id>deframer</source_block_id>
+    <sink_block_id>decoder</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>agc</source_block_id>
-    <sink_block_id>rx_fft</sink_block_id>
+    <source_block_id>gr_clock_recovery_mm_xx_0</source_block_id>
+    <sink_block_id>virtual_sink_0</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>deframer</source_block_id>
-    <sink_block_id>decoder</sink_block_id>
+    <source_block_id>gr_clock_recovery_mm_xx_0</source_block_id>
+    <sink_block_id>demod_scope</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>agc</source_block_id>
-    <sink_block_id>gr_fir_filter_xxx_0</sink_block_id>
+    <source_block_id>gr_moving_average_xx_0</source_block_id>
+    <sink_block_id>gr_clock_recovery_mm_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>pll</source_block_id>
+    <sink_block_id>gr_moving_average_xx_0</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>gr_fir_filter_xxx_0</source_block_id>
+    <source_block_id>agc</source_block_id>
     <sink_block_id>pll</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
+  <connection>
+    <source_block_id>agc</source_block_id>
+    <sink_block_id>rx_fft</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
 </flow_graph>
index ae70f25c8ce0d3733b2a10ca392207d323d4185f..c1d0fd6e915afbbc37dbd8b1f4c09dc8fb9549bf 100755 (executable)
@@ -2,12 +2,13 @@
 ##################################################
 # Gnuradio Python Flow Graph
 # Title: USRP HRPT Receiver
-# Generated: Sun Sep 27 13:37:23 2009
+# Generated: Sun Nov  1 19:28:13 2009
 ##################################################
 
 from gnuradio import eng_notation
 from gnuradio import gr
 from gnuradio import noaa
+from gnuradio import window
 from gnuradio.eng_option import eng_option
 from gnuradio.gr import firdes
 from gnuradio.wxgui import fftsink2
@@ -17,7 +18,7 @@ from grc_gnuradio import usrp as grc_usrp
 from grc_gnuradio import wxgui as grc_wxgui
 from optparse import OptionParser
 import ConfigParser
-import math
+import math, os
 import wx
 
 class usrp_rx_hrpt(grc_wxgui.top_block_gui):
@@ -28,10 +29,10 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                ##################################################
                # Variables
                ##################################################
-               self.config_filename = config_filename = 'usrp_rx_hrpt.cfg'
+               self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf'
                self._decim_config = ConfigParser.ConfigParser()
                self._decim_config.read(config_filename)
-               try: decim = self._decim_config.getfloat('usrp', 'decim')
+               try: decim = self._decim_config.getfloat('usrp_rx_hrpt', 'decim')
                except: decim = 16
                self.decim = decim
                self.sym_rate = sym_rate = 600*1109
@@ -39,79 +40,55 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                self.sps = sps = sample_rate/sym_rate
                self._side_config = ConfigParser.ConfigParser()
                self._side_config.read(config_filename)
-               try: side = self._side_config.get('usrp', 'side')
+               try: side = self._side_config.get('usrp_rx_hrpt', 'side')
                except: side = 'A'
                self.side = side
-               self._saved_sync_alpha_config = ConfigParser.ConfigParser()
-               self._saved_sync_alpha_config.read(config_filename)
-               try: saved_sync_alpha = self._saved_sync_alpha_config.getfloat('demod', 'sync_alpha')
-               except: saved_sync_alpha = 0.05
-               self.saved_sync_alpha = saved_sync_alpha
                self._saved_pll_alpha_config = ConfigParser.ConfigParser()
                self._saved_pll_alpha_config.read(config_filename)
-               try: saved_pll_alpha = self._saved_pll_alpha_config.getfloat('demod', 'pll_alpha')
+               try: saved_pll_alpha = self._saved_pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha')
                except: saved_pll_alpha = 0.05
                self.saved_pll_alpha = saved_pll_alpha
                self._saved_gain_config = ConfigParser.ConfigParser()
                self._saved_gain_config.read(config_filename)
-               try: saved_gain = self._saved_gain_config.getfloat('usrp', 'gain')
+               try: saved_gain = self._saved_gain_config.getfloat('usrp_rx_hrpt', 'gain')
                except: saved_gain = 35
                self.saved_gain = saved_gain
                self._saved_freq_config = ConfigParser.ConfigParser()
                self._saved_freq_config.read(config_filename)
-               try: saved_freq = self._saved_freq_config.getfloat('usrp', 'freq')
+               try: saved_freq = self._saved_freq_config.getfloat('usrp_rx_hrpt', 'freq')
                except: saved_freq = 1698e6
                self.saved_freq = saved_freq
-               self.hs = hs = int(sps/2.0)
-               self.sync_alpha = sync_alpha = saved_sync_alpha
+               self._saved_clock_alpha_config = ConfigParser.ConfigParser()
+               self._saved_clock_alpha_config.read(config_filename)
+               try: saved_clock_alpha = self._saved_clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha')
+               except: saved_clock_alpha = 0.05
+               self.saved_clock_alpha = saved_clock_alpha
                self.side_text = side_text = side
                self.pll_alpha = pll_alpha = saved_pll_alpha
                self._output_filename_config = ConfigParser.ConfigParser()
                self._output_filename_config.read(config_filename)
-               try: output_filename = self._output_filename_config.get('output', 'filename')
+               try: output_filename = self._output_filename_config.get('usrp_rx_hrpt', 'filename')
                except: output_filename = 'frames.dat'
                self.output_filename = output_filename
-               self.mf_taps = mf_taps = [-0.5/hs,]*hs+[0.5/hs]*hs
-               self.max_sync_offset = max_sync_offset = 0.01
+               self.max_clock_offset = max_clock_offset = 0.1
                self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate
+               self.hs = hs = int(sps/2.0)
                self.gain = gain = saved_gain
                self.freq = freq = saved_freq
                self.decim_text = decim_text = decim
+               self.clock_alpha = clock_alpha = saved_clock_alpha
 
                ##################################################
                # Notebooks
                ##################################################
                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), "Spectrum")
                self.displays.AddPage(grc_wxgui.Panel(self.displays), "Demod")
                self.GridAdd(self.displays, 2, 0, 1, 4)
 
                ##################################################
                # Controls
                ##################################################
-               _sync_alpha_sizer = wx.BoxSizer(wx.VERTICAL)
-               self._sync_alpha_text_box = forms.text_box(
-                       parent=self.GetWin(),
-                       sizer=_sync_alpha_sizer,
-                       value=self.sync_alpha,
-                       callback=self.set_sync_alpha,
-                       label="SYNC Alpha",
-                       converter=forms.float_converter(),
-                       proportion=0,
-               )
-               self._sync_alpha_slider = forms.slider(
-                       parent=self.GetWin(),
-                       sizer=_sync_alpha_sizer,
-                       value=self.sync_alpha,
-                       callback=self.set_sync_alpha,
-                       minimum=0.0,
-                       maximum=0.5,
-                       num_steps=100,
-                       style=wx.SL_HORIZONTAL,
-                       cast=float,
-                       proportion=1,
-               )
-               self.GridAdd(_sync_alpha_sizer, 0, 3, 1, 1)
                self._side_text_static_text = forms.static_text(
                        parent=self.GetWin(),
                        value=self.side_text,
@@ -182,6 +159,29 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                        converter=forms.float_converter(),
                )
                self.GridAdd(self._decim_text_static_text, 1, 1, 1, 1)
+               _clock_alpha_sizer = wx.BoxSizer(wx.VERTICAL)
+               self._clock_alpha_text_box = forms.text_box(
+                       parent=self.GetWin(),
+                       sizer=_clock_alpha_sizer,
+                       value=self.clock_alpha,
+                       callback=self.set_clock_alpha,
+                       label="Clock Alpha",
+                       converter=forms.float_converter(),
+                       proportion=0,
+               )
+               self._clock_alpha_slider = forms.slider(
+                       parent=self.GetWin(),
+                       sizer=_clock_alpha_sizer,
+                       value=self.clock_alpha,
+                       callback=self.set_clock_alpha,
+                       minimum=0.0,
+                       maximum=0.5,
+                       num_steps=100,
+                       style=wx.SL_HORIZONTAL,
+                       cast=float,
+                       proportion=1,
+               )
+               self.GridAdd(_clock_alpha_sizer, 0, 3, 1, 1)
 
                ##################################################
                # Blocks
@@ -189,20 +189,24 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0)
                self.decoder = noaa.hrpt_decoder()
                self.deframer = noaa.hrpt_deframer()
-               self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename)
-               self.gr_fir_filter_xxx_0 = gr.fir_filter_ccc(1, (mf_taps))
-               self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset)
-               self.pll_scope = scopesink2.scope_sink_f(
+               self.demod_scope = scopesink2.scope_sink_f(
                        self.displays.GetPage(1).GetWin(),
-                       title="Demod Waveform",
-                       sample_rate=sample_rate,
+                       title="Post-Demod",
+                       sample_rate=sym_rate*2.0,
                        v_scale=0.5,
-                       t_scale=20.0/sample_rate,
+                       v_offset=0,
+                       t_scale=10.0/sym_rate,
                        ac_couple=False,
                        xy_mode=False,
                        num_inputs=1,
                )
-               self.displays.GetPage(1).GridAdd(self.pll_scope.win, 0, 0, 1, 1)
+               self.displays.GetPage(1).GridAdd(self.demod_scope.win, 0, 0, 1, 1)
+               self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename)
+               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(),
                        baseband_freq=freq,
@@ -217,20 +221,9 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                        avg_alpha=0.1,
                        title="RX Spectrum",
                        peak_hold=False,
+                       size=(640, 360),
                )
                self.displays.GetPage(0).GridAdd(self.rx_fft.win, 0, 0, 1, 1)
-               self.rx_scope = scopesink2.scope_sink_c(
-                       self.displays.GetPage(0).GetWin(),
-                       title="RX Waveform",
-                       sample_rate=sample_rate,
-                       v_scale=0,
-                       t_scale=20.0/sample_rate,
-                       ac_couple=False,
-                       xy_mode=False,
-                       num_inputs=1,
-               )
-               self.displays.GetPage(0).GridAdd(self.rx_scope.win, 1, 0, 1, 1)
-               self.sync = noaa.hrpt_sync_fb(sync_alpha, sync_alpha**2/4.0, sps, max_sync_offset)
                self.usrp_source = grc_usrp.simple_source_c(which=0, side=side, rx_ant="RXA")
                self.usrp_source.set_decim_rate(decim)
                self.usrp_source.set_frequency(freq, verbose=True)
@@ -239,104 +232,101 @@ 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.sync, 0), (self.deframer, 0))
-               self.connect((self.pll, 0), (self.sync, 0))
-               self.connect((self.pll, 0), (self.pll_scope, 0))
-               self.connect((self.agc, 0), (self.rx_scope, 0))
-               self.connect((self.agc, 0), (self.rx_fft, 0))
                self.connect((self.deframer, 0), (self.decoder, 0))
-               self.connect((self.agc, 0), (self.gr_fir_filter_xxx_0, 0))
-               self.connect((self.gr_fir_filter_xxx_0, 0), (self.pll, 0))
+               self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.demod_scope, 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.agc, 0), (self.pll, 0))
                self.connect((self.usrp_source, 0), (self.agc, 0))
+               self.connect((self.agc, 0), (self.rx_fft, 0))
 
        def set_config_filename(self, config_filename):
                self.config_filename = config_filename
-               self._side_config = ConfigParser.ConfigParser()
-               self._side_config.read(self.config_filename)
-               if not self._side_config.has_section('usrp'):
-                       self._side_config.add_section('usrp')
-               self._side_config.set('usrp', 'side', str(self.side))
-               self._side_config.write(open(self.config_filename, 'w'))
-               self._decim_config = ConfigParser.ConfigParser()
-               self._decim_config.read(self.config_filename)
-               if not self._decim_config.has_section('usrp'):
-                       self._decim_config.add_section('usrp')
-               self._decim_config.set('usrp', 'decim', str(self.decim))
-               self._decim_config.write(open(self.config_filename, 'w'))
                self._saved_freq_config = ConfigParser.ConfigParser()
                self._saved_freq_config.read(self.config_filename)
-               if not self._saved_freq_config.has_section('usrp'):
-                       self._saved_freq_config.add_section('usrp')
-               self._saved_freq_config.set('usrp', 'freq', str(self.freq))
+               if not self._saved_freq_config.has_section('usrp_rx_hrpt'):
+                       self._saved_freq_config.add_section('usrp_rx_hrpt')
+               self._saved_freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq))
                self._saved_freq_config.write(open(self.config_filename, 'w'))
                self._saved_gain_config = ConfigParser.ConfigParser()
                self._saved_gain_config.read(self.config_filename)
-               if not self._saved_gain_config.has_section('usrp'):
-                       self._saved_gain_config.add_section('usrp')
-               self._saved_gain_config.set('usrp', 'gain', str(self.gain))
+               if not self._saved_gain_config.has_section('usrp_rx_hrpt'):
+                       self._saved_gain_config.add_section('usrp_rx_hrpt')
+               self._saved_gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain))
                self._saved_gain_config.write(open(self.config_filename, 'w'))
-               self._saved_pll_alpha_config = ConfigParser.ConfigParser()
-               self._saved_pll_alpha_config.read(self.config_filename)
-               if not self._saved_pll_alpha_config.has_section('demod'):
-                       self._saved_pll_alpha_config.add_section('demod')
-               self._saved_pll_alpha_config.set('demod', 'pll_alpha', str(self.pll_alpha))
-               self._saved_pll_alpha_config.write(open(self.config_filename, 'w'))
-               self._saved_sync_alpha_config = ConfigParser.ConfigParser()
-               self._saved_sync_alpha_config.read(self.config_filename)
-               if not self._saved_sync_alpha_config.has_section('demod'):
-                       self._saved_sync_alpha_config.add_section('demod')
-               self._saved_sync_alpha_config.set('demod', 'sync_alpha', str(self.sync_alpha))
-               self._saved_sync_alpha_config.write(open(self.config_filename, 'w'))
                self._output_filename_config = ConfigParser.ConfigParser()
                self._output_filename_config.read(self.config_filename)
-               if not self._output_filename_config.has_section('output'):
-                       self._output_filename_config.add_section('output')
-               self._output_filename_config.set('output', 'filename', str(self.output_filename))
+               if not self._output_filename_config.has_section('usrp_rx_hrpt'):
+                       self._output_filename_config.add_section('usrp_rx_hrpt')
+               self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename))
                self._output_filename_config.write(open(self.config_filename, 'w'))
+               self._saved_pll_alpha_config = ConfigParser.ConfigParser()
+               self._saved_pll_alpha_config.read(self.config_filename)
+               if not self._saved_pll_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._saved_pll_alpha_config.add_section('usrp_rx_hrpt')
+               self._saved_pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha))
+               self._saved_pll_alpha_config.write(open(self.config_filename, 'w'))
+               self._saved_clock_alpha_config = ConfigParser.ConfigParser()
+               self._saved_clock_alpha_config.read(self.config_filename)
+               if not self._saved_clock_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._saved_clock_alpha_config.add_section('usrp_rx_hrpt')
+               self._saved_clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha))
+               self._saved_clock_alpha_config.write(open(self.config_filename, 'w'))
+               self._decim_config = ConfigParser.ConfigParser()
+               self._decim_config.read(self.config_filename)
+               if not self._decim_config.has_section('usrp_rx_hrpt'):
+                       self._decim_config.add_section('usrp_rx_hrpt')
+               self._decim_config.set('usrp_rx_hrpt', 'decim', str(self.decim))
+               self._decim_config.write(open(self.config_filename, 'w'))
+               self._side_config = ConfigParser.ConfigParser()
+               self._side_config.read(self.config_filename)
+               if not self._side_config.has_section('usrp_rx_hrpt'):
+                       self._side_config.add_section('usrp_rx_hrpt')
+               self._side_config.set('usrp_rx_hrpt', 'side', str(self.side))
+               self._side_config.write(open(self.config_filename, 'w'))
 
        def set_decim(self, decim):
                self.decim = decim
                self.set_sample_rate(64e6/self.decim)
+               self.set_decim_text(self.decim)
                self._decim_config = ConfigParser.ConfigParser()
                self._decim_config.read(self.config_filename)
-               if not self._decim_config.has_section('usrp'):
-                       self._decim_config.add_section('usrp')
-               self._decim_config.set('usrp', 'decim', str(self.decim))
+               if not self._decim_config.has_section('usrp_rx_hrpt'):
+                       self._decim_config.add_section('usrp_rx_hrpt')
+               self._decim_config.set('usrp_rx_hrpt', 'decim', str(self.decim))
                self._decim_config.write(open(self.config_filename, 'w'))
-               self.set_decim_text(self.decim)
                self.usrp_source.set_decim_rate(self.decim)
 
        def set_sym_rate(self, sym_rate):
                self.sym_rate = sym_rate
                self.set_sps(self.sample_rate/self.sym_rate)
+               self.demod_scope.set_sample_rate(self.sym_rate*2.0)
 
        def set_sample_rate(self, sample_rate):
                self.sample_rate = sample_rate
                self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate)
                self.set_sps(self.sample_rate/self.sym_rate)
-               self.rx_scope.set_sample_rate(self.sample_rate)
                self.rx_fft.set_sample_rate(self.sample_rate)
-               self.pll_scope.set_sample_rate(self.sample_rate)
 
        def set_sps(self, sps):
                self.sps = sps
                self.set_hs(int(self.sps/2.0))
+               self.gr_clock_recovery_mm_xx_0.set_omega(self.sps/2.0)
 
        def set_side(self, side):
                self.side = side
                self.set_side_text(self.side)
                self._side_config = ConfigParser.ConfigParser()
                self._side_config.read(self.config_filename)
-               if not self._side_config.has_section('usrp'):
-                       self._side_config.add_section('usrp')
-               self._side_config.set('usrp', 'side', str(self.side))
+               if not self._side_config.has_section('usrp_rx_hrpt'):
+                       self._side_config.add_section('usrp_rx_hrpt')
+               self._side_config.set('usrp_rx_hrpt', 'side', str(self.side))
                self._side_config.write(open(self.config_filename, 'w'))
 
-       def set_saved_sync_alpha(self, saved_sync_alpha):
-               self.saved_sync_alpha = saved_sync_alpha
-               self.set_sync_alpha(self.saved_sync_alpha)
-
        def set_saved_pll_alpha(self, saved_pll_alpha):
                self.saved_pll_alpha = saved_pll_alpha
                self.set_pll_alpha(self.saved_pll_alpha)
@@ -349,22 +339,9 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                self.saved_freq = saved_freq
                self.set_freq(self.saved_freq)
 
-       def set_hs(self, hs):
-               self.hs = hs
-               self.set_mf_taps([-0.5/self.hs,]*self.hs+[0.5/self.hs]*self.hs)
-
-       def set_sync_alpha(self, sync_alpha):
-               self.sync_alpha = sync_alpha
-               self._sync_alpha_slider.set_value(self.sync_alpha)
-               self._sync_alpha_text_box.set_value(self.sync_alpha)
-               self._saved_sync_alpha_config = ConfigParser.ConfigParser()
-               self._saved_sync_alpha_config.read(self.config_filename)
-               if not self._saved_sync_alpha_config.has_section('demod'):
-                       self._saved_sync_alpha_config.add_section('demod')
-               self._saved_sync_alpha_config.set('demod', 'sync_alpha', str(self.sync_alpha))
-               self._saved_sync_alpha_config.write(open(self.config_filename, 'w'))
-               self.sync.set_alpha(self.sync_alpha)
-               self.sync.set_beta(self.sync_alpha**2/4.0)
+       def set_saved_clock_alpha(self, saved_clock_alpha):
+               self.saved_clock_alpha = saved_clock_alpha
+               self.set_clock_alpha(self.saved_clock_alpha)
 
        def set_side_text(self, side_text):
                self.side_text = side_text
@@ -376,9 +353,9 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                self._pll_alpha_text_box.set_value(self.pll_alpha)
                self._saved_pll_alpha_config = ConfigParser.ConfigParser()
                self._saved_pll_alpha_config.read(self.config_filename)
-               if not self._saved_pll_alpha_config.has_section('demod'):
-                       self._saved_pll_alpha_config.add_section('demod')
-               self._saved_pll_alpha_config.set('demod', 'pll_alpha', str(self.pll_alpha))
+               if not self._saved_pll_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._saved_pll_alpha_config.add_section('usrp_rx_hrpt')
+               self._saved_pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha))
                self._saved_pll_alpha_config.write(open(self.config_filename, 'w'))
                self.pll.set_alpha(self.pll_alpha)
                self.pll.set_beta(self.pll_alpha**2/4.0)
@@ -387,32 +364,31 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                self.output_filename = output_filename
                self._output_filename_config = ConfigParser.ConfigParser()
                self._output_filename_config.read(self.config_filename)
-               if not self._output_filename_config.has_section('output'):
-                       self._output_filename_config.add_section('output')
-               self._output_filename_config.set('output', 'filename', str(self.output_filename))
+               if not self._output_filename_config.has_section('usrp_rx_hrpt'):
+                       self._output_filename_config.add_section('usrp_rx_hrpt')
+               self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename))
                self._output_filename_config.write(open(self.config_filename, 'w'))
 
-       def set_mf_taps(self, mf_taps):
-               self.mf_taps = mf_taps
-               self.gr_fir_filter_xxx_0.set_taps((self.mf_taps))
-
-       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)
+       def set_max_clock_offset(self, max_clock_offset):
+               self.max_clock_offset = max_clock_offset
 
        def set_max_carrier_offset(self, max_carrier_offset):
                self.max_carrier_offset = max_carrier_offset
                self.pll.set_max_offset(self.max_carrier_offset)
 
+       def set_hs(self, hs):
+               self.hs = hs
+               self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs)
+
        def set_gain(self, gain):
                self.gain = gain
                self._gain_slider.set_value(self.gain)
                self._gain_text_box.set_value(self.gain)
                self._saved_gain_config = ConfigParser.ConfigParser()
                self._saved_gain_config.read(self.config_filename)
-               if not self._saved_gain_config.has_section('usrp'):
-                       self._saved_gain_config.add_section('usrp')
-               self._saved_gain_config.set('usrp', 'gain', str(self.gain))
+               if not self._saved_gain_config.has_section('usrp_rx_hrpt'):
+                       self._saved_gain_config.add_section('usrp_rx_hrpt')
+               self._saved_gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain))
                self._saved_gain_config.write(open(self.config_filename, 'w'))
                self.usrp_source.set_gain(self.gain)
 
@@ -421,9 +397,9 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                self._freq_text_box.set_value(self.freq)
                self._saved_freq_config = ConfigParser.ConfigParser()
                self._saved_freq_config.read(self.config_filename)
-               if not self._saved_freq_config.has_section('usrp'):
-                       self._saved_freq_config.add_section('usrp')
-               self._saved_freq_config.set('usrp', 'freq', str(self.freq))
+               if not self._saved_freq_config.has_section('usrp_rx_hrpt'):
+                       self._saved_freq_config.add_section('usrp_rx_hrpt')
+               self._saved_freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq))
                self._saved_freq_config.write(open(self.config_filename, 'w'))
                self.usrp_source.set_frequency(self.freq)
                self.rx_fft.set_baseband_freq(self.freq)
@@ -432,6 +408,19 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
                self.decim_text = decim_text
                self._decim_text_static_text.set_value(self.decim_text)
 
+       def set_clock_alpha(self, clock_alpha):
+               self.clock_alpha = clock_alpha
+               self._clock_alpha_slider.set_value(self.clock_alpha)
+               self._clock_alpha_text_box.set_value(self.clock_alpha)
+               self._saved_clock_alpha_config = ConfigParser.ConfigParser()
+               self._saved_clock_alpha_config.read(self.config_filename)
+               if not self._saved_clock_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._saved_clock_alpha_config.add_section('usrp_rx_hrpt')
+               self._saved_clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha))
+               self._saved_clock_alpha_config.write(open(self.config_filename, 'w'))
+               self.gr_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0)
+               self.gr_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha)
+
 if __name__ == '__main__':
        parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
        (options, args) = parser.parse_args()
diff --git a/gr-noaa/apps/usrp_rx_hrpt2.grc b/gr-noaa/apps/usrp_rx_hrpt2.grc
deleted file mode 100644 (file)
index d42a9ea..0000000
+++ /dev/null
@@ -1,1418 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
-  <timestamp>Sun Sep 27 13:32:47 2009</timestamp>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>max_carrier_offset</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>2*math.pi*100e3/sample_rate</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(575, 19)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>sym_rate</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>600*1109</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(301, 19)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>sps</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>sample_rate/sym_rate</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(397, 19)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>hs</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>int(sps/2.0)</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(499, 19)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>sample_rate</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>64e6/decim</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(198, 17)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_slider</key>
-    <param>
-      <key>id</key>
-      <value>gain</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>label</key>
-      <value>RX Gain</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>saved_gain</value>
-    </param>
-    <param>
-      <key>min</key>
-      <value>0</value>
-    </param>
-    <param>
-      <key>max</key>
-      <value>100</value>
-    </param>
-    <param>
-      <key>num_steps</key>
-      <value>100</value>
-    </param>
-    <param>
-      <key>style</key>
-      <value>wx.SL_HORIZONTAL</value>
-    </param>
-    <param>
-      <key>converver</key>
-      <value>float_converter</value>
-    </param>
-    <param>
-      <key>grid_pos</key>
-      <value>0, 1, 1, 1</value>
-    </param>
-    <param>
-      <key>notebook</key>
-      <value></value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(340, 106)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_text_box</key>
-    <param>
-      <key>id</key>
-      <value>freq</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>label</key>
-      <value>Frequency</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>saved_freq</value>
-    </param>
-    <param>
-      <key>converver</key>
-      <value>float_converter</value>
-    </param>
-    <param>
-      <key>formatter</key>
-      <value>None</value>
-    </param>
-    <param>
-      <key>grid_pos</key>
-      <value>0, 0, 1, 1</value>
-    </param>
-    <param>
-      <key>notebook</key>
-      <value></value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(199, 106)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_slider</key>
-    <param>
-      <key>id</key>
-      <value>pll_alpha</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>label</key>
-      <value>PLL Alpha</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>saved_pll_alpha</value>
-    </param>
-    <param>
-      <key>min</key>
-      <value>0.0</value>
-    </param>
-    <param>
-      <key>max</key>
-      <value>0.5</value>
-    </param>
-    <param>
-      <key>num_steps</key>
-      <value>100</value>
-    </param>
-    <param>
-      <key>style</key>
-      <value>wx.SL_HORIZONTAL</value>
-    </param>
-    <param>
-      <key>converver</key>
-      <value>float_converter</value>
-    </param>
-    <param>
-      <key>grid_pos</key>
-      <value>0, 2, 1, 1</value>
-    </param>
-    <param>
-      <key>notebook</key>
-      <value></value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(479, 106)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_slider</key>
-    <param>
-      <key>id</key>
-      <value>sync_alpha</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>label</key>
-      <value>SYNC Alpha</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>saved_sync_alpha</value>
-    </param>
-    <param>
-      <key>min</key>
-      <value>0.0</value>
-    </param>
-    <param>
-      <key>max</key>
-      <value>0.5</value>
-    </param>
-    <param>
-      <key>num_steps</key>
-      <value>100</value>
-    </param>
-    <param>
-      <key>style</key>
-      <value>wx.SL_HORIZONTAL</value>
-    </param>
-    <param>
-      <key>converver</key>
-      <value>float_converter</value>
-    </param>
-    <param>
-      <key>grid_pos</key>
-      <value>0, 3, 1, 1</value>
-    </param>
-    <param>
-      <key>notebook</key>
-      <value></value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(618, 106)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_static_text</key>
-    <param>
-      <key>id</key>
-      <value>side_text</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>label</key>
-      <value>USRP Side</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>side</value>
-    </param>
-    <param>
-      <key>converver</key>
-      <value>str_converter</value>
-    </param>
-    <param>
-      <key>formatter</key>
-      <value>None</value>
-    </param>
-    <param>
-      <key>grid_pos</key>
-      <value>1, 0, 1, 1</value>
-    </param>
-    <param>
-      <key>notebook</key>
-      <value></value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(828, 20)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_config</key>
-    <param>
-      <key>id</key>
-      <value>side</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>'A'</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>string</value>
-    </param>
-    <param>
-      <key>config_file</key>
-      <value>config_filename</value>
-    </param>
-    <param>
-      <key>section</key>
-      <value>'usrp'</value>
-    </param>
-    <param>
-      <key>option</key>
-      <value>'side'</value>
-    </param>
-    <param>
-      <key>writeback</key>
-      <value>side</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(194, 253)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_config</key>
-    <param>
-      <key>id</key>
-      <value>decim</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>16</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>real</value>
-    </param>
-    <param>
-      <key>config_file</key>
-      <value>config_filename</value>
-    </param>
-    <param>
-      <key>section</key>
-      <value>'usrp'</value>
-    </param>
-    <param>
-      <key>option</key>
-      <value>'decim'</value>
-    </param>
-    <param>
-      <key>writeback</key>
-      <value>decim</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(351, 255)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_config</key>
-    <param>
-      <key>id</key>
-      <value>saved_freq</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>1698e6</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>real</value>
-    </param>
-    <param>
-      <key>config_file</key>
-      <value>config_filename</value>
-    </param>
-    <param>
-      <key>section</key>
-      <value>'usrp'</value>
-    </param>
-    <param>
-      <key>option</key>
-      <value>'freq'</value>
-    </param>
-    <param>
-      <key>writeback</key>
-      <value>freq</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(507, 258)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_config</key>
-    <param>
-      <key>id</key>
-      <value>saved_gain</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>35</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>real</value>
-    </param>
-    <param>
-      <key>config_file</key>
-      <value>config_filename</value>
-    </param>
-    <param>
-      <key>section</key>
-      <value>'usrp'</value>
-    </param>
-    <param>
-      <key>option</key>
-      <value>'gain'</value>
-    </param>
-    <param>
-      <key>writeback</key>
-      <value>gain</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(664, 259)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_config</key>
-    <param>
-      <key>id</key>
-      <value>saved_pll_alpha</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>0.05</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>real</value>
-    </param>
-    <param>
-      <key>config_file</key>
-      <value>config_filename</value>
-    </param>
-    <param>
-      <key>section</key>
-      <value>'demod'</value>
-    </param>
-    <param>
-      <key>option</key>
-      <value>'pll_alpha'</value>
-    </param>
-    <param>
-      <key>writeback</key>
-      <value>pll_alpha</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(823, 258)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_config</key>
-    <param>
-      <key>id</key>
-      <value>saved_sync_alpha</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>0.05</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>real</value>
-    </param>
-    <param>
-      <key>config_file</key>
-      <value>config_filename</value>
-    </param>
-    <param>
-      <key>section</key>
-      <value>'demod'</value>
-    </param>
-    <param>
-      <key>option</key>
-      <value>'sync_alpha'</value>
-    </param>
-    <param>
-      <key>writeback</key>
-      <value>sync_alpha</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(981, 258)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_config</key>
-    <param>
-      <key>id</key>
-      <value>output_filename</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>'frames.dat'</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>string</value>
-    </param>
-    <param>
-      <key>config_file</key>
-      <value>config_filename</value>
-    </param>
-    <param>
-      <key>section</key>
-      <value>'output'</value>
-    </param>
-    <param>
-      <key>option</key>
-      <value>'filename'</value>
-    </param>
-    <param>
-      <key>writeback</key>
-      <value>output_filename</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(1139, 259)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable_static_text</key>
-    <param>
-      <key>id</key>
-      <value>decim_text</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>label</key>
-      <value>Decimation</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>decim</value>
-    </param>
-    <param>
-      <key>converver</key>
-      <value>float_converter</value>
-    </param>
-    <param>
-      <key>formatter</key>
-      <value>None</value>
-    </param>
-    <param>
-      <key>grid_pos</key>
-      <value>1, 1, 1, 1</value>
-    </param>
-    <param>
-      <key>notebook</key>
-      <value></value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(973, 20)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>max_sync_offset</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>0.01</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(705, 19)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>config_filename</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>'usrp_rx_hrpt.cfg'</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(12, 160)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>import</key>
-    <param>
-      <key>id</key>
-      <value>import_0</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>import</key>
-      <value>import math</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(11, 102)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>noaa_hrpt_pll_cf</key>
-    <param>
-      <key>id</key>
-      <value>pll</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>alpha</key>
-      <value>pll_alpha</value>
-    </param>
-    <param>
-      <key>beta</key>
-      <value>pll_alpha**2/4.0</value>
-    </param>
-    <param>
-      <key>max_offset</key>
-      <value>max_carrier_offset</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(664, 809)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>noaa_hrpt_sync_fb</key>
-    <param>
-      <key>id</key>
-      <value>sync</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>alpha</key>
-      <value>sync_alpha</value>
-    </param>
-    <param>
-      <key>beta</key>
-      <value>sync_alpha**2/4.0</value>
-    </param>
-    <param>
-      <key>sps</key>
-      <value>sps</value>
-    </param>
-    <param>
-      <key>max_offset</key>
-      <value>max_sync_offset</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(865, 801)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>gr_file_sink</key>
-    <param>
-      <key>id</key>
-      <value>frame_sink</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>file</key>
-      <value>output_filename</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>short</value>
-    </param>
-    <param>
-      <key>vlen</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(1283, 937)</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>(1091, 829)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>noaa_hrpt_decoder</key>
-    <param>
-      <key>id</key>
-      <value>decoder</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(1281, 829)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>wxgui_scopesink2</key>
-    <param>
-      <key>id</key>
-      <value>pll_scope</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>float</value>
-    </param>
-    <param>
-      <key>title</key>
-      <value>Demod Waveform</value>
-    </param>
-    <param>
-      <key>samp_rate</key>
-      <value>sample_rate</value>
-    </param>
-    <param>
-      <key>v_scale</key>
-      <value>0.5</value>
-    </param>
-    <param>
-      <key>t_scale</key>
-      <value>20.0/sample_rate</value>
-    </param>
-    <param>
-      <key>ac_couple</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>xy_mode</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>num_inputs</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>grid_pos</key>
-      <value>2,0,1,4</value>
-    </param>
-    <param>
-      <key>notebook</key>
-      <value></value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(631, 632)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>180</value>
-    </param>
-  </block>
-  <block>
-    <key>gr_agc_xx</key>
-    <param>
-      <key>id</key>
-      <value>agc</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>complex</value>
-    </param>
-    <param>
-      <key>rate</key>
-      <value>1e-6</value>
-    </param>
-    <param>
-      <key>reference</key>
-      <value>1.0</value>
-    </param>
-    <param>
-      <key>gain</key>
-      <value>1.0</value>
-    </param>
-    <param>
-      <key>max_gain</key>
-      <value>1.0</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(269, 801)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>gr_fir_filter_xxx</key>
-    <param>
-      <key>id</key>
-      <value>gr_fir_filter_xxx_0</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>ccc</value>
-    </param>
-    <param>
-      <key>decim</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>taps</key>
-      <value>mf_taps</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(418, 817)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>mf_taps</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>[-0.5/hs,]*hs+[0.5/hs,]*hs</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(830, 154)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>gr_file_source</key>
-    <param>
-      <key>id</key>
-      <value>file_source</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>file</key>
-      <value>'usrp.dat'</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>short</value>
-    </param>
-    <param>
-      <key>repeat</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>vlen</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(215, 490)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>gr_deinterleave</key>
-    <param>
-      <key>id</key>
-      <value>gr_deinterleave_0</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>float</value>
-    </param>
-    <param>
-      <key>num_streams</key>
-      <value>2</value>
-    </param>
-    <param>
-      <key>vlen</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(598, 485)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>gr_float_to_complex</key>
-    <param>
-      <key>id</key>
-      <value>gr_float_to_complex_0</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>vlen</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(801, 485)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>gr_short_to_float</key>
-    <param>
-      <key>id</key>
-      <value>s2f</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(393, 502)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>virtual_sink</key>
-    <param>
-      <key>id</key>
-      <value>sample_stream</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>stream_id</key>
-      <value>samples</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(1027, 498)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>usrp_simple_source_x</key>
-    <param>
-      <key>id</key>
-      <value>usrp_source</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>complex</value>
-    </param>
-    <param>
-      <key>format</key>
-      <value></value>
-    </param>
-    <param>
-      <key>which</key>
-      <value>0</value>
-    </param>
-    <param>
-      <key>decimation</key>
-      <value>decim</value>
-    </param>
-    <param>
-      <key>frequency</key>
-      <value>freq</value>
-    </param>
-    <param>
-      <key>lo_offset</key>
-      <value>float('inf')</value>
-    </param>
-    <param>
-      <key>gain</key>
-      <value>gain</value>
-    </param>
-    <param>
-      <key>side</key>
-      <value>side</value>
-    </param>
-    <param>
-      <key>rx_ant</key>
-      <value>RXA</value>
-    </param>
-    <param>
-      <key>hb_filters</key>
-      <value></value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(63, 785)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>virtual_source</key>
-    <param>
-      <key>id</key>
-      <value>virtual_source_0</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>stream_id</key>
-      <value>samples</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(69, 671)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>options</key>
-    <param>
-      <key>id</key>
-      <value>usrp_rx_hrpt2</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>title</key>
-      <value>USRP HRPT Receiver</value>
-    </param>
-    <param>
-      <key>author</key>
-      <value></value>
-    </param>
-    <param>
-      <key>description</key>
-      <value></value>
-    </param>
-    <param>
-      <key>window_size</key>
-      <value>4096,4096</value>
-    </param>
-    <param>
-      <key>generate_options</key>
-      <value>wx_gui</value>
-    </param>
-    <param>
-      <key>category</key>
-      <value>Custom</value>
-    </param>
-    <param>
-      <key>run</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>realtime_scheduling</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>_coordinate</key>
-      <value>(10, 10)</value>
-    </param>
-    <param>
-      <key>_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <connection>
-    <source_block_id>gr_fir_filter_xxx_0</source_block_id>
-    <sink_block_id>pll</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>agc</source_block_id>
-    <sink_block_id>gr_fir_filter_xxx_0</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>usrp_source</source_block_id>
-    <sink_block_id>agc</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>deframer</source_block_id>
-    <sink_block_id>decoder</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>pll</source_block_id>
-    <sink_block_id>pll_scope</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>pll</source_block_id>
-    <sink_block_id>sync</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>sync</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>deframer</source_block_id>
-    <sink_block_id>frame_sink</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>agc</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>file_source</source_block_id>
-    <sink_block_id>s2f</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>s2f</source_block_id>
-    <sink_block_id>gr_deinterleave_0</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>gr_deinterleave_0</source_block_id>
-    <sink_block_id>gr_float_to_complex_0</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>gr_deinterleave_0</source_block_id>
-    <sink_block_id>gr_float_to_complex_0</sink_block_id>
-    <source_key>1</source_key>
-    <sink_key>1</sink_key>
-  </connection>
-  <connection>
-    <source_block_id>gr_float_to_complex_0</source_block_id>
-    <sink_block_id>sample_stream</sink_block_id>
-    <source_key>0</source_key>
-    <sink_key>0</sink_key>
-  </connection>
-</flow_graph>
diff --git a/gr-noaa/apps/usrp_rx_hrpt2.py b/gr-noaa/apps/usrp_rx_hrpt2.py
deleted file mode 100755 (executable)
index 3193351..0000000
+++ /dev/null
@@ -1,401 +0,0 @@
-#!/usr/bin/env python
-##################################################
-# Gnuradio Python Flow Graph
-# Title: USRP HRPT Receiver
-# Generated: Sun Sep 27 13:32:48 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 forms
-from gnuradio.wxgui import scopesink2
-from grc_gnuradio import usrp as grc_usrp
-from grc_gnuradio import wxgui as grc_wxgui
-from optparse import OptionParser
-import ConfigParser
-import math
-import wx
-
-class usrp_rx_hrpt2(grc_wxgui.top_block_gui):
-
-       def __init__(self):
-               grc_wxgui.top_block_gui.__init__(self, title="USRP HRPT Receiver")
-
-               ##################################################
-               # Variables
-               ##################################################
-               self.config_filename = config_filename = 'usrp_rx_hrpt.cfg'
-               self._decim_config = ConfigParser.ConfigParser()
-               self._decim_config.read(config_filename)
-               try: decim = self._decim_config.getfloat('usrp', 'decim')
-               except: decim = 16
-               self.decim = decim
-               self.sym_rate = sym_rate = 600*1109
-               self.sample_rate = sample_rate = 64e6/decim
-               self.sps = sps = sample_rate/sym_rate
-               self._side_config = ConfigParser.ConfigParser()
-               self._side_config.read(config_filename)
-               try: side = self._side_config.get('usrp', 'side')
-               except: side = 'A'
-               self.side = side
-               self._saved_sync_alpha_config = ConfigParser.ConfigParser()
-               self._saved_sync_alpha_config.read(config_filename)
-               try: saved_sync_alpha = self._saved_sync_alpha_config.getfloat('demod', 'sync_alpha')
-               except: saved_sync_alpha = 0.05
-               self.saved_sync_alpha = saved_sync_alpha
-               self._saved_pll_alpha_config = ConfigParser.ConfigParser()
-               self._saved_pll_alpha_config.read(config_filename)
-               try: saved_pll_alpha = self._saved_pll_alpha_config.getfloat('demod', 'pll_alpha')
-               except: saved_pll_alpha = 0.05
-               self.saved_pll_alpha = saved_pll_alpha
-               self._saved_gain_config = ConfigParser.ConfigParser()
-               self._saved_gain_config.read(config_filename)
-               try: saved_gain = self._saved_gain_config.getfloat('usrp', 'gain')
-               except: saved_gain = 35
-               self.saved_gain = saved_gain
-               self._saved_freq_config = ConfigParser.ConfigParser()
-               self._saved_freq_config.read(config_filename)
-               try: saved_freq = self._saved_freq_config.getfloat('usrp', 'freq')
-               except: saved_freq = 1698e6
-               self.saved_freq = saved_freq
-               self.hs = hs = int(sps/2.0)
-               self.sync_alpha = sync_alpha = saved_sync_alpha
-               self.side_text = side_text = side
-               self.pll_alpha = pll_alpha = saved_pll_alpha
-               self._output_filename_config = ConfigParser.ConfigParser()
-               self._output_filename_config.read(config_filename)
-               try: output_filename = self._output_filename_config.get('output', 'filename')
-               except: output_filename = 'frames.dat'
-               self.output_filename = output_filename
-               self.mf_taps = mf_taps = [-0.5/hs,]*hs+[0.5/hs,]*hs
-               self.max_sync_offset = max_sync_offset = 0.01
-               self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate
-               self.gain = gain = saved_gain
-               self.freq = freq = saved_freq
-               self.decim_text = decim_text = decim
-
-               ##################################################
-               # Controls
-               ##################################################
-               _sync_alpha_sizer = wx.BoxSizer(wx.VERTICAL)
-               self._sync_alpha_text_box = forms.text_box(
-                       parent=self.GetWin(),
-                       sizer=_sync_alpha_sizer,
-                       value=self.sync_alpha,
-                       callback=self.set_sync_alpha,
-                       label="SYNC Alpha",
-                       converter=forms.float_converter(),
-                       proportion=0,
-               )
-               self._sync_alpha_slider = forms.slider(
-                       parent=self.GetWin(),
-                       sizer=_sync_alpha_sizer,
-                       value=self.sync_alpha,
-                       callback=self.set_sync_alpha,
-                       minimum=0.0,
-                       maximum=0.5,
-                       num_steps=100,
-                       style=wx.SL_HORIZONTAL,
-                       cast=float,
-                       proportion=1,
-               )
-               self.GridAdd(_sync_alpha_sizer, 0, 3, 1, 1)
-               self._side_text_static_text = forms.static_text(
-                       parent=self.GetWin(),
-                       value=self.side_text,
-                       callback=self.set_side_text,
-                       label="USRP Side",
-                       converter=forms.str_converter(),
-               )
-               self.GridAdd(self._side_text_static_text, 1, 0, 1, 1)
-               _pll_alpha_sizer = wx.BoxSizer(wx.VERTICAL)
-               self._pll_alpha_text_box = forms.text_box(
-                       parent=self.GetWin(),
-                       sizer=_pll_alpha_sizer,
-                       value=self.pll_alpha,
-                       callback=self.set_pll_alpha,
-                       label="PLL Alpha",
-                       converter=forms.float_converter(),
-                       proportion=0,
-               )
-               self._pll_alpha_slider = forms.slider(
-                       parent=self.GetWin(),
-                       sizer=_pll_alpha_sizer,
-                       value=self.pll_alpha,
-                       callback=self.set_pll_alpha,
-                       minimum=0.0,
-                       maximum=0.5,
-                       num_steps=100,
-                       style=wx.SL_HORIZONTAL,
-                       cast=float,
-                       proportion=1,
-               )
-               self.GridAdd(_pll_alpha_sizer, 0, 2, 1, 1)
-               _gain_sizer = wx.BoxSizer(wx.VERTICAL)
-               self._gain_text_box = forms.text_box(
-                       parent=self.GetWin(),
-                       sizer=_gain_sizer,
-                       value=self.gain,
-                       callback=self.set_gain,
-                       label="RX Gain",
-                       converter=forms.float_converter(),
-                       proportion=0,
-               )
-               self._gain_slider = forms.slider(
-                       parent=self.GetWin(),
-                       sizer=_gain_sizer,
-                       value=self.gain,
-                       callback=self.set_gain,
-                       minimum=0,
-                       maximum=100,
-                       num_steps=100,
-                       style=wx.SL_HORIZONTAL,
-                       cast=float,
-                       proportion=1,
-               )
-               self.GridAdd(_gain_sizer, 0, 1, 1, 1)
-               self._freq_text_box = forms.text_box(
-                       parent=self.GetWin(),
-                       value=self.freq,
-                       callback=self.set_freq,
-                       label="Frequency",
-                       converter=forms.float_converter(),
-               )
-               self.GridAdd(self._freq_text_box, 0, 0, 1, 1)
-               self._decim_text_static_text = forms.static_text(
-                       parent=self.GetWin(),
-                       value=self.decim_text,
-                       callback=self.set_decim_text,
-                       label="Decimation",
-                       converter=forms.float_converter(),
-               )
-               self.GridAdd(self._decim_text_static_text, 1, 1, 1, 1)
-
-               ##################################################
-               # Blocks
-               ##################################################
-               self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0)
-               self.decoder = noaa.hrpt_decoder()
-               self.deframer = noaa.hrpt_deframer()
-               self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename)
-               self.gr_fir_filter_xxx_0 = gr.fir_filter_ccc(1, (mf_taps))
-               self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset)
-               self.pll_scope = scopesink2.scope_sink_f(
-                       self.GetWin(),
-                       title="Demod Waveform",
-                       sample_rate=sample_rate,
-                       v_scale=0.5,
-                       t_scale=20.0/sample_rate,
-                       ac_couple=False,
-                       xy_mode=False,
-                       num_inputs=1,
-               )
-               self.GridAdd(self.pll_scope.win, 2, 0, 1, 4)
-               self.sync = noaa.hrpt_sync_fb(sync_alpha, sync_alpha**2/4.0, sps, max_sync_offset)
-               self.usrp_source = grc_usrp.simple_source_c(which=0, side=side, rx_ant="RXA")
-               self.usrp_source.set_decim_rate(decim)
-               self.usrp_source.set_frequency(freq, verbose=True)
-               self.usrp_source.set_gain(gain)
-
-               ##################################################
-               # Connections
-               ##################################################
-               self.connect((self.gr_fir_filter_xxx_0, 0), (self.pll, 0))
-               self.connect((self.agc, 0), (self.gr_fir_filter_xxx_0, 0))
-               self.connect((self.usrp_source, 0), (self.agc, 0))
-               self.connect((self.deframer, 0), (self.decoder, 0))
-               self.connect((self.pll, 0), (self.pll_scope, 0))
-               self.connect((self.pll, 0), (self.sync, 0))
-               self.connect((self.sync, 0), (self.deframer, 0))
-               self.connect((self.deframer, 0), (self.frame_sink, 0))
-
-       def set_config_filename(self, config_filename):
-               self.config_filename = config_filename
-               self._side_config = ConfigParser.ConfigParser()
-               self._side_config.read(self.config_filename)
-               if not self._side_config.has_section('usrp'):
-                       self._side_config.add_section('usrp')
-               self._side_config.set('usrp', 'side', str(self.side))
-               self._side_config.write(open(self.config_filename, 'w'))
-               self._decim_config = ConfigParser.ConfigParser()
-               self._decim_config.read(self.config_filename)
-               if not self._decim_config.has_section('usrp'):
-                       self._decim_config.add_section('usrp')
-               self._decim_config.set('usrp', 'decim', str(self.decim))
-               self._decim_config.write(open(self.config_filename, 'w'))
-               self._saved_freq_config = ConfigParser.ConfigParser()
-               self._saved_freq_config.read(self.config_filename)
-               if not self._saved_freq_config.has_section('usrp'):
-                       self._saved_freq_config.add_section('usrp')
-               self._saved_freq_config.set('usrp', 'freq', str(self.freq))
-               self._saved_freq_config.write(open(self.config_filename, 'w'))
-               self._saved_gain_config = ConfigParser.ConfigParser()
-               self._saved_gain_config.read(self.config_filename)
-               if not self._saved_gain_config.has_section('usrp'):
-                       self._saved_gain_config.add_section('usrp')
-               self._saved_gain_config.set('usrp', 'gain', str(self.gain))
-               self._saved_gain_config.write(open(self.config_filename, 'w'))
-               self._saved_pll_alpha_config = ConfigParser.ConfigParser()
-               self._saved_pll_alpha_config.read(self.config_filename)
-               if not self._saved_pll_alpha_config.has_section('demod'):
-                       self._saved_pll_alpha_config.add_section('demod')
-               self._saved_pll_alpha_config.set('demod', 'pll_alpha', str(self.pll_alpha))
-               self._saved_pll_alpha_config.write(open(self.config_filename, 'w'))
-               self._saved_sync_alpha_config = ConfigParser.ConfigParser()
-               self._saved_sync_alpha_config.read(self.config_filename)
-               if not self._saved_sync_alpha_config.has_section('demod'):
-                       self._saved_sync_alpha_config.add_section('demod')
-               self._saved_sync_alpha_config.set('demod', 'sync_alpha', str(self.sync_alpha))
-               self._saved_sync_alpha_config.write(open(self.config_filename, 'w'))
-               self._output_filename_config = ConfigParser.ConfigParser()
-               self._output_filename_config.read(self.config_filename)
-               if not self._output_filename_config.has_section('output'):
-                       self._output_filename_config.add_section('output')
-               self._output_filename_config.set('output', 'filename', str(self.output_filename))
-               self._output_filename_config.write(open(self.config_filename, 'w'))
-
-       def set_decim(self, decim):
-               self.decim = decim
-               self.set_sample_rate(64e6/self.decim)
-               self._decim_config = ConfigParser.ConfigParser()
-               self._decim_config.read(self.config_filename)
-               if not self._decim_config.has_section('usrp'):
-                       self._decim_config.add_section('usrp')
-               self._decim_config.set('usrp', 'decim', str(self.decim))
-               self._decim_config.write(open(self.config_filename, 'w'))
-               self.set_decim_text(self.decim)
-               self.usrp_source.set_decim_rate(self.decim)
-
-       def set_sym_rate(self, sym_rate):
-               self.sym_rate = sym_rate
-               self.set_sps(self.sample_rate/self.sym_rate)
-
-       def set_sample_rate(self, sample_rate):
-               self.sample_rate = sample_rate
-               self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate)
-               self.set_sps(self.sample_rate/self.sym_rate)
-               self.pll_scope.set_sample_rate(self.sample_rate)
-
-       def set_sps(self, sps):
-               self.sps = sps
-               self.set_hs(int(self.sps/2.0))
-
-       def set_side(self, side):
-               self.side = side
-               self.set_side_text(self.side)
-               self._side_config = ConfigParser.ConfigParser()
-               self._side_config.read(self.config_filename)
-               if not self._side_config.has_section('usrp'):
-                       self._side_config.add_section('usrp')
-               self._side_config.set('usrp', 'side', str(self.side))
-               self._side_config.write(open(self.config_filename, 'w'))
-
-       def set_saved_sync_alpha(self, saved_sync_alpha):
-               self.saved_sync_alpha = saved_sync_alpha
-               self.set_sync_alpha(self.saved_sync_alpha)
-
-       def set_saved_pll_alpha(self, saved_pll_alpha):
-               self.saved_pll_alpha = saved_pll_alpha
-               self.set_pll_alpha(self.saved_pll_alpha)
-
-       def set_saved_gain(self, saved_gain):
-               self.saved_gain = saved_gain
-               self.set_gain(self.saved_gain)
-
-       def set_saved_freq(self, saved_freq):
-               self.saved_freq = saved_freq
-               self.set_freq(self.saved_freq)
-
-       def set_hs(self, hs):
-               self.hs = hs
-               self.set_mf_taps([-0.5/self.hs,]*self.hs+[0.5/self.hs,]*self.hs)
-
-       def set_sync_alpha(self, sync_alpha):
-               self.sync_alpha = sync_alpha
-               self._sync_alpha_slider.set_value(self.sync_alpha)
-               self._sync_alpha_text_box.set_value(self.sync_alpha)
-               self._saved_sync_alpha_config = ConfigParser.ConfigParser()
-               self._saved_sync_alpha_config.read(self.config_filename)
-               if not self._saved_sync_alpha_config.has_section('demod'):
-                       self._saved_sync_alpha_config.add_section('demod')
-               self._saved_sync_alpha_config.set('demod', 'sync_alpha', str(self.sync_alpha))
-               self._saved_sync_alpha_config.write(open(self.config_filename, 'w'))
-               self.sync.set_alpha(self.sync_alpha)
-               self.sync.set_beta(self.sync_alpha**2/4.0)
-
-       def set_side_text(self, side_text):
-               self.side_text = side_text
-               self._side_text_static_text.set_value(self.side_text)
-
-       def set_pll_alpha(self, pll_alpha):
-               self.pll_alpha = pll_alpha
-               self._pll_alpha_slider.set_value(self.pll_alpha)
-               self._pll_alpha_text_box.set_value(self.pll_alpha)
-               self._saved_pll_alpha_config = ConfigParser.ConfigParser()
-               self._saved_pll_alpha_config.read(self.config_filename)
-               if not self._saved_pll_alpha_config.has_section('demod'):
-                       self._saved_pll_alpha_config.add_section('demod')
-               self._saved_pll_alpha_config.set('demod', 'pll_alpha', str(self.pll_alpha))
-               self._saved_pll_alpha_config.write(open(self.config_filename, 'w'))
-               self.pll.set_alpha(self.pll_alpha)
-               self.pll.set_beta(self.pll_alpha**2/4.0)
-
-       def set_output_filename(self, output_filename):
-               self.output_filename = output_filename
-               self._output_filename_config = ConfigParser.ConfigParser()
-               self._output_filename_config.read(self.config_filename)
-               if not self._output_filename_config.has_section('output'):
-                       self._output_filename_config.add_section('output')
-               self._output_filename_config.set('output', 'filename', str(self.output_filename))
-               self._output_filename_config.write(open(self.config_filename, 'w'))
-
-       def set_mf_taps(self, mf_taps):
-               self.mf_taps = mf_taps
-               self.gr_fir_filter_xxx_0.set_taps((self.mf_taps))
-
-       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)
-
-       def set_max_carrier_offset(self, max_carrier_offset):
-               self.max_carrier_offset = max_carrier_offset
-               self.pll.set_max_offset(self.max_carrier_offset)
-
-       def set_gain(self, gain):
-               self.gain = gain
-               self._gain_slider.set_value(self.gain)
-               self._gain_text_box.set_value(self.gain)
-               self._saved_gain_config = ConfigParser.ConfigParser()
-               self._saved_gain_config.read(self.config_filename)
-               if not self._saved_gain_config.has_section('usrp'):
-                       self._saved_gain_config.add_section('usrp')
-               self._saved_gain_config.set('usrp', 'gain', str(self.gain))
-               self._saved_gain_config.write(open(self.config_filename, 'w'))
-               self.usrp_source.set_gain(self.gain)
-
-       def set_freq(self, freq):
-               self.freq = freq
-               self._freq_text_box.set_value(self.freq)
-               self._saved_freq_config = ConfigParser.ConfigParser()
-               self._saved_freq_config.read(self.config_filename)
-               if not self._saved_freq_config.has_section('usrp'):
-                       self._saved_freq_config.add_section('usrp')
-               self._saved_freq_config.set('usrp', 'freq', str(self.freq))
-               self._saved_freq_config.write(open(self.config_filename, 'w'))
-               self.usrp_source.set_frequency(self.freq)
-
-       def set_decim_text(self, decim_text):
-               self.decim_text = decim_text
-               self._decim_text_static_text.set_value(self.decim_text)
-
-if __name__ == '__main__':
-       parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
-       (options, args) = parser.parse_args()
-       if gr.enable_realtime_scheduling() != gr.RT_OK:
-               print "Error: failed to enable realtime scheduling."
-       tb = usrp_rx_hrpt2()
-       tb.Run(True)
-
index fadc2d1da51cec6f82cbe18b8fbc1b6cdcd0643c..918a954bd689d3a270a6f2ff179bad195789c982 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='ASCII'?>
 <flow_graph>
-  <timestamp>Sun Sep 27 10:13:25 2009</timestamp>
+  <timestamp>Sun Nov  1 19:32:32 2009</timestamp>
   <block>
     <key>options</key>
     <param>
@@ -13,7 +13,7 @@
     </param>
     <param>
       <key>title</key>
-      <value>USRP HRPT Receiver</value>
+      <value></value>
     </param>
     <param>
       <key>author</key>
       <key>category</key>
       <value>Custom</value>
     </param>
+    <param>
+      <key>run_options</key>
+      <value>prompt</value>
+    </param>
     <param>
       <key>run</key>
       <value>True</value>
     <key>variable</key>
     <param>
       <key>id</key>
-      <value>max_sync_offset</value>
+      <value>max_clock_offset</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>0.01</value>
+      <value>0.1</value>
     </param>
     <param>
       <key>_coordinate</key>
     </param>
     <param>
       <key>value</key>
-      <value>'usrp_rx_hrpt.cfg'</value>
+      <value>os.environ['HOME']+'/.gnuradio/config.conf'</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(12, 167)</value>
+      <value>(13, 162)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
     <param>
       <key>import</key>
-      <value>import math</value>
+      <value>import math, os</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(11, 112)</value>
+      <value>(11, 109)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>output_filename</value>
+      <value>clock_alpha</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>'frames.dat'</value>
+      <value>0.05</value>
     </param>
     <param>
       <key>type</key>
-      <value>string</value>
+      <value>real</value>
     </param>
     <param>
       <key>config_file</key>
     </param>
     <param>
       <key>section</key>
-      <value>'output'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'filename'</value>
+      <value>'clock_alpha'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>output_filename</value>
+      <value>clock_alpha</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1146, 122)</value>
+      <value>(986, 101)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>sync_alpha</value>
+      <value>gain</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>0.05</value>
+      <value>35</value>
     </param>
     <param>
       <key>type</key>
     </param>
     <param>
       <key>section</key>
-      <value>'demod'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'sync_alpha'</value>
+      <value>'gain'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>sync_alpha</value>
+      <value>gain</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(988, 121)</value>
+      <value>(668, 101)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>pll_alpha</value>
+      <value>freq</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>0.05</value>
+      <value>1698e6</value>
     </param>
     <param>
       <key>type</key>
     </param>
     <param>
       <key>section</key>
-      <value>'demod'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'pll_alpha'</value>
+      <value>'freq'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>pll_alpha</value>
+      <value>freq</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(830, 121)</value>
+      <value>(511, 100)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>gain</value>
+      <value>decim</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>35</value>
+      <value>16</value>
     </param>
     <param>
       <key>type</key>
     </param>
     <param>
       <key>section</key>
-      <value>'usrp'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'gain'</value>
+      <value>'decim'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>gain</value>
+      <value>decim</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(671, 122)</value>
+      <value>(355, 97)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>freq</value>
+      <value>output_filename</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>1698e6</value>
+      <value>'frames.dat'</value>
     </param>
     <param>
       <key>type</key>
-      <value>real</value>
+      <value>string</value>
     </param>
     <param>
       <key>config_file</key>
     </param>
     <param>
       <key>section</key>
-      <value>'usrp'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'freq'</value>
+      <value>'filename'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>freq</value>
+      <value>output_filename</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(514, 121)</value>
+      <value>(1143, 101)</value>
     </param>
     <param>
       <key>_rotation</key>
     <key>variable_config</key>
     <param>
       <key>id</key>
-      <value>decim</value>
+      <value>pll_alpha</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>value</key>
-      <value>16</value>
+      <value>0.05</value>
     </param>
     <param>
       <key>type</key>
     </param>
     <param>
       <key>section</key>
-      <value>'usrp'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
-      <value>'decim'</value>
+      <value>'pll_alpha'</value>
     </param>
     <param>
       <key>writeback</key>
-      <value>decim</value>
+      <value>pll_alpha</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(358, 118)</value>
+      <value>(827, 100)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
     <param>
       <key>section</key>
-      <value>'usrp'</value>
+      <value>'usrp_rx_hrpt'</value>
     </param>
     <param>
       <key>option</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(201, 116)</value>
+      <value>(198, 95)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_decoder</key>
+    <key>gr_agc_xx</key>
     <param>
       <key>id</key>
-      <value>decoder</value>
+      <value>agc</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
+    <param>
+      <key>type</key>
+      <value>complex</value>
+    </param>
+    <param>
+      <key>rate</key>
+      <value>1e-6</value>
+    </param>
+    <param>
+      <key>reference</key>
+      <value>1.0</value>
+    </param>
+    <param>
+      <key>gain</key>
+      <value>1.0</value>
+    </param>
+    <param>
+      <key>max_gain</key>
+      <value>1.0</value>
+    </param>
     <param>
       <key>_coordinate</key>
-      <value>(1247, 347)</value>
+      <value>(339, 434)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(29, 303)</value>
+      <value>(127, 418)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>variable</key>
+    <key>gr_clock_recovery_mm_xx</key>
     <param>
       <key>id</key>
-      <value>mf_taps</value>
+      <value>gr_clock_recovery_mm_xx_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>value</key>
-      <value>[-0.5/hs,]*hs+[0.5/hs,]*hs</value>
+      <key>type</key>
+      <value>float</value>
+    </param>
+    <param>
+      <key>omega</key>
+      <value>sps/2.0</value>
+    </param>
+    <param>
+      <key>gain_omega</key>
+      <value>clock_alpha**2/4.0</value>
+    </param>
+    <param>
+      <key>mu</key>
+      <value>0.5</value>
+    </param>
+    <param>
+      <key>gain_mu</key>
+      <value>clock_alpha</value>
+    </param>
+    <param>
+      <key>omega_relative_limit</key>
+      <value>max_clock_offset</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(825, 19)</value>
+      <value>(920, 426)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>gr_agc_xx</key>
+    <key>gr_moving_average_xx</key>
     <param>
       <key>id</key>
-      <value>agc</value>
+      <value>gr_moving_average_xx_0</value>
     </param>
     <param>
       <key>_enabled</key>
     </param>
     <param>
       <key>type</key>
-      <value>complex</value>
+      <value>float</value>
     </param>
     <param>
-      <key>rate</key>
-      <value>1e-6</value>
+      <key>length</key>
+      <value>hs</value>
     </param>
     <param>
-      <key>reference</key>
-      <value>1.0</value>
+      <key>scale</key>
+      <value>1.0/hs</value>
     </param>
     <param>
-      <key>gain</key>
-      <value>1.0</value>
+      <key>max_iter</key>
+      <value>4000</value>
     </param>
     <param>
-      <key>max_gain</key>
-      <value>1.0</value>
+      <key>_coordinate</key>
+      <value>(720, 442)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>noaa_hrpt_pll_cf</key>
+    <param>
+      <key>id</key>
+      <value>pll</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>alpha</key>
+      <value>pll_alpha</value>
+    </param>
+    <param>
+      <key>beta</key>
+      <value>pll_alpha**2/4.0</value>
+    </param>
+    <param>
+      <key>max_offset</key>
+      <value>max_carrier_offset</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(246, 319)</value>
+      <value>(507, 442)</value>
+    </param>
+    <param>
+      <key>_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>virtual_sink</key>
+    <param>
+      <key>id</key>
+      <value>virtual_sink_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>(1180, 457)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1060, 347)</value>
+      <value>(815, 673)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(1251, 454)</value>
+      <value>(1026, 722)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_sync_fb</key>
+    <key>noaa_hrpt_bit_sync</key>
     <param>
       <key>id</key>
-      <value>sync</value>
+      <value>noaa_hrpt_bit_sync_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>alpha</key>
-      <value>sync_alpha</value>
+      <key>_coordinate</key>
+      <value>(624, 673)</value>
     </param>
     <param>
-      <key>beta</key>
-      <value>sync_alpha**2/4.0</value>
+      <key>_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>gr_binary_slicer_fb</key>
     <param>
-      <key>sps</key>
-      <value>sps</value>
+      <key>id</key>
+      <value>gr_binary_slicer_fb_0</value>
     </param>
     <param>
-      <key>max_offset</key>
-      <value>max_sync_offset</value>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(833, 319)</value>
+      <value>(446, 673)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>noaa_hrpt_pll_cf</key>
+    <key>virtual_source</key>
     <param>
       <key>id</key>
-      <value>pll</value>
+      <value>virtual_source_0</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>alpha</key>
-      <value>pll_alpha</value>
-    </param>
-    <param>
-      <key>beta</key>
-      <value>pll_alpha**2/4.0</value>
-    </param>
-    <param>
-      <key>max_offset</key>
-      <value>max_carrier_offset</value>
+      <key>stream_id</key>
+      <value>baseband</value>
     </param>
     <param>
       <key>_coordinate</key>
-      <value>(638, 327)</value>
+      <value>(226, 669)</value>
     </param>
     <param>
       <key>_rotation</key>
     </param>
   </block>
   <block>
-    <key>gr_fir_filter_xxx</key>
+    <key>noaa_hrpt_decoder</key>
     <param>
       <key>id</key>
-      <value>gr_fir_filter_xxx_0</value>
+      <value>decoder</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
-    <param>
-      <key>type</key>
-      <value>ccc</value>
-    </param>
-    <param>
-      <key>decim</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>taps</key>
-      <value>mf_taps</value>
-    </param>
     <param>
       <key>_coordinate</key>
-      <value>(402, 335)</value>
+      <value>(1027, 623)</value>
     </param>
     <param>
       <key>_rotation</key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>deframer</source_block_id>
-    <sink_block_id>decoder</sink_block_id>
+    <source_block_id>agc</source_block_id>
+    <sink_block_id>pll</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
     <source_block_id>pll</source_block_id>
-    <sink_block_id>sync</sink_block_id>
+    <sink_block_id>gr_moving_average_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_moving_average_xx_0</source_block_id>
+    <sink_block_id>gr_clock_recovery_mm_xx_0</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>gr_clock_recovery_mm_xx_0</source_block_id>
+    <sink_block_id>virtual_sink_0</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
   <connection>
-    <source_block_id>sync</source_block_id>
+    <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>deframer</source_block_id>
-    <sink_block_id>frame_sink</sink_block_id>
+    <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>agc</source_block_id>
-    <sink_block_id>gr_fir_filter_xxx_0</sink_block_id>
+    <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_fir_filter_xxx_0</source_block_id>
-    <sink_block_id>pll</sink_block_id>
+    <source_block_id>deframer</source_block_id>
+    <sink_block_id>frame_sink</sink_block_id>
+    <source_key>0</source_key>
+    <sink_key>0</sink_key>
+  </connection>
+  <connection>
+    <source_block_id>deframer</source_block_id>
+    <sink_block_id>decoder</sink_block_id>
     <source_key>0</source_key>
     <sink_key>0</sink_key>
   </connection>
index 9917847bb81d7b03f8844d8c4a7552a8610a851f..33259a2313d541016657b32103f80ceeb3006376 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/env python
 ##################################################
 # Gnuradio Python Flow Graph
-# Title: USRP HRPT Receiver
-# Generated: Sun Sep 27 10:13:25 2009
+# Title: Usrp Rx Hrpt Nogui
+# Generated: Sun Nov  1 19:32:32 2009
 ##################################################
 
 from gnuradio import eng_notation
@@ -13,59 +13,58 @@ from gnuradio.gr import firdes
 from grc_gnuradio import usrp as grc_usrp
 from optparse import OptionParser
 import ConfigParser
-import math
+import math, os
 
 class usrp_rx_hrpt_nogui(gr.top_block):
 
        def __init__(self):
-               gr.top_block.__init__(self, "USRP HRPT Receiver")
+               gr.top_block.__init__(self, "Usrp Rx Hrpt Nogui")
 
                ##################################################
                # Variables
                ##################################################
-               self.config_filename = config_filename = 'usrp_rx_hrpt.cfg'
+               self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf'
                self._decim_config = ConfigParser.ConfigParser()
                self._decim_config.read(config_filename)
-               try: decim = self._decim_config.getfloat('usrp', 'decim')
+               try: decim = self._decim_config.getfloat('usrp_rx_hrpt', 'decim')
                except: decim = 16
                self.decim = decim
                self.sym_rate = sym_rate = 600*1109
                self.sample_rate = sample_rate = 64e6/decim
                self.sps = sps = sample_rate/sym_rate
-               self.hs = hs = int(sps/2.0)
-               self._sync_alpha_config = ConfigParser.ConfigParser()
-               self._sync_alpha_config.read(config_filename)
-               try: sync_alpha = self._sync_alpha_config.getfloat('demod', 'sync_alpha')
-               except: sync_alpha = 0.05
-               self.sync_alpha = sync_alpha
                self._side_config = ConfigParser.ConfigParser()
                self._side_config.read(config_filename)
-               try: side = self._side_config.get('usrp', 'side')
+               try: side = self._side_config.get('usrp_rx_hrpt', 'side')
                except: side = 'A'
                self.side = side
                self._pll_alpha_config = ConfigParser.ConfigParser()
                self._pll_alpha_config.read(config_filename)
-               try: pll_alpha = self._pll_alpha_config.getfloat('demod', 'pll_alpha')
+               try: pll_alpha = self._pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha')
                except: pll_alpha = 0.05
                self.pll_alpha = pll_alpha
                self._output_filename_config = ConfigParser.ConfigParser()
                self._output_filename_config.read(config_filename)
-               try: output_filename = self._output_filename_config.get('output', 'filename')
+               try: output_filename = self._output_filename_config.get('usrp_rx_hrpt', 'filename')
                except: output_filename = 'frames.dat'
                self.output_filename = output_filename
-               self.mf_taps = mf_taps = [-0.5/hs,]*hs+[0.5/hs,]*hs
-               self.max_sync_offset = max_sync_offset = 0.01
+               self.max_clock_offset = max_clock_offset = 0.1
                self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate
+               self.hs = hs = int(sps/2.0)
                self._gain_config = ConfigParser.ConfigParser()
                self._gain_config.read(config_filename)
-               try: gain = self._gain_config.getfloat('usrp', 'gain')
+               try: gain = self._gain_config.getfloat('usrp_rx_hrpt', 'gain')
                except: gain = 35
                self.gain = gain
                self._freq_config = ConfigParser.ConfigParser()
                self._freq_config.read(config_filename)
-               try: freq = self._freq_config.getfloat('usrp', 'freq')
+               try: freq = self._freq_config.getfloat('usrp_rx_hrpt', 'freq')
                except: freq = 1698e6
                self.freq = freq
+               self._clock_alpha_config = ConfigParser.ConfigParser()
+               self._clock_alpha_config.read(config_filename)
+               try: clock_alpha = self._clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha')
+               except: clock_alpha = 0.05
+               self.clock_alpha = clock_alpha
 
                ##################################################
                # Blocks
@@ -74,9 +73,11 @@ class usrp_rx_hrpt_nogui(gr.top_block):
                self.decoder = noaa.hrpt_decoder()
                self.deframer = noaa.hrpt_deframer()
                self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename)
-               self.gr_fir_filter_xxx_0 = gr.fir_filter_ccc(1, (mf_taps))
+               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.sync = noaa.hrpt_sync_fb(sync_alpha, sync_alpha**2/4.0, sps, max_sync_offset)
                self.usrp_source = grc_usrp.simple_source_c(which=0, side=side, rx_ant="RXA")
                self.usrp_source.set_decim_rate(decim)
                self.usrp_source.set_frequency(freq, verbose=True)
@@ -86,56 +87,58 @@ class usrp_rx_hrpt_nogui(gr.top_block):
                # Connections
                ##################################################
                self.connect((self.usrp_source, 0), (self.agc, 0))
-               self.connect((self.deframer, 0), (self.decoder, 0))
-               self.connect((self.pll, 0), (self.sync, 0))
-               self.connect((self.sync, 0), (self.deframer, 0))
+               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.agc, 0), (self.gr_fir_filter_xxx_0, 0))
-               self.connect((self.gr_fir_filter_xxx_0, 0), (self.pll, 0))
+               self.connect((self.deframer, 0), (self.decoder, 0))
 
        def set_config_filename(self, config_filename):
                self.config_filename = config_filename
-               self._output_filename_config = ConfigParser.ConfigParser()
-               self._output_filename_config.read(self.config_filename)
-               if not self._output_filename_config.has_section('output'):
-                       self._output_filename_config.add_section('output')
-               self._output_filename_config.set('output', 'filename', str(self.output_filename))
-               self._output_filename_config.write(open(self.config_filename, 'w'))
-               self._sync_alpha_config = ConfigParser.ConfigParser()
-               self._sync_alpha_config.read(self.config_filename)
-               if not self._sync_alpha_config.has_section('demod'):
-                       self._sync_alpha_config.add_section('demod')
-               self._sync_alpha_config.set('demod', 'sync_alpha', str(self.sync_alpha))
-               self._sync_alpha_config.write(open(self.config_filename, 'w'))
-               self._pll_alpha_config = ConfigParser.ConfigParser()
-               self._pll_alpha_config.read(self.config_filename)
-               if not self._pll_alpha_config.has_section('demod'):
-                       self._pll_alpha_config.add_section('demod')
-               self._pll_alpha_config.set('demod', 'pll_alpha', str(self.pll_alpha))
-               self._pll_alpha_config.write(open(self.config_filename, 'w'))
+               self._clock_alpha_config = ConfigParser.ConfigParser()
+               self._clock_alpha_config.read(self.config_filename)
+               if not self._clock_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._clock_alpha_config.add_section('usrp_rx_hrpt')
+               self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha))
+               self._clock_alpha_config.write(open(self.config_filename, 'w'))
                self._gain_config = ConfigParser.ConfigParser()
                self._gain_config.read(self.config_filename)
-               if not self._gain_config.has_section('usrp'):
-                       self._gain_config.add_section('usrp')
-               self._gain_config.set('usrp', 'gain', str(self.gain))
+               if not self._gain_config.has_section('usrp_rx_hrpt'):
+                       self._gain_config.add_section('usrp_rx_hrpt')
+               self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain))
                self._gain_config.write(open(self.config_filename, 'w'))
                self._freq_config = ConfigParser.ConfigParser()
                self._freq_config.read(self.config_filename)
-               if not self._freq_config.has_section('usrp'):
-                       self._freq_config.add_section('usrp')
-               self._freq_config.set('usrp', 'freq', str(self.freq))
+               if not self._freq_config.has_section('usrp_rx_hrpt'):
+                       self._freq_config.add_section('usrp_rx_hrpt')
+               self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq))
                self._freq_config.write(open(self.config_filename, 'w'))
                self._decim_config = ConfigParser.ConfigParser()
                self._decim_config.read(self.config_filename)
-               if not self._decim_config.has_section('usrp'):
-                       self._decim_config.add_section('usrp')
-               self._decim_config.set('usrp', 'decim', str(self.decim))
+               if not self._decim_config.has_section('usrp_rx_hrpt'):
+                       self._decim_config.add_section('usrp_rx_hrpt')
+               self._decim_config.set('usrp_rx_hrpt', 'decim', str(self.decim))
                self._decim_config.write(open(self.config_filename, 'w'))
+               self._output_filename_config = ConfigParser.ConfigParser()
+               self._output_filename_config.read(self.config_filename)
+               if not self._output_filename_config.has_section('usrp_rx_hrpt'):
+                       self._output_filename_config.add_section('usrp_rx_hrpt')
+               self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename))
+               self._output_filename_config.write(open(self.config_filename, 'w'))
+               self._pll_alpha_config = ConfigParser.ConfigParser()
+               self._pll_alpha_config.read(self.config_filename)
+               if not self._pll_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._pll_alpha_config.add_section('usrp_rx_hrpt')
+               self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha))
+               self._pll_alpha_config.write(open(self.config_filename, 'w'))
                self._side_config = ConfigParser.ConfigParser()
                self._side_config.read(self.config_filename)
-               if not self._side_config.has_section('usrp'):
-                       self._side_config.add_section('usrp')
-               self._side_config.set('usrp', 'side', str(self.side))
+               if not self._side_config.has_section('usrp_rx_hrpt'):
+                       self._side_config.add_section('usrp_rx_hrpt')
+               self._side_config.set('usrp_rx_hrpt', 'side', str(self.side))
                self._side_config.write(open(self.config_filename, 'w'))
 
        def set_decim(self, decim):
@@ -143,9 +146,9 @@ class usrp_rx_hrpt_nogui(gr.top_block):
                self.set_sample_rate(64e6/self.decim)
                self._decim_config = ConfigParser.ConfigParser()
                self._decim_config.read(self.config_filename)
-               if not self._decim_config.has_section('usrp'):
-                       self._decim_config.add_section('usrp')
-               self._decim_config.set('usrp', 'decim', str(self.decim))
+               if not self._decim_config.has_section('usrp_rx_hrpt'):
+                       self._decim_config.add_section('usrp_rx_hrpt')
+               self._decim_config.set('usrp_rx_hrpt', 'decim', str(self.decim))
                self._decim_config.write(open(self.config_filename, 'w'))
                self.usrp_source.set_decim_rate(self.decim)
 
@@ -161,38 +164,24 @@ class usrp_rx_hrpt_nogui(gr.top_block):
        def set_sps(self, sps):
                self.sps = sps
                self.set_hs(int(self.sps/2.0))
-
-       def set_hs(self, hs):
-               self.hs = hs
-               self.set_mf_taps([-0.5/self.hs,]*self.hs+[0.5/self.hs,]*self.hs)
-
-       def set_sync_alpha(self, sync_alpha):
-               self.sync_alpha = sync_alpha
-               self._sync_alpha_config = ConfigParser.ConfigParser()
-               self._sync_alpha_config.read(self.config_filename)
-               if not self._sync_alpha_config.has_section('demod'):
-                       self._sync_alpha_config.add_section('demod')
-               self._sync_alpha_config.set('demod', 'sync_alpha', str(self.sync_alpha))
-               self._sync_alpha_config.write(open(self.config_filename, 'w'))
-               self.sync.set_alpha(self.sync_alpha)
-               self.sync.set_beta(self.sync_alpha**2/4.0)
+               self.gr_clock_recovery_mm_xx_0.set_omega(self.sps/2.0)
 
        def set_side(self, side):
                self.side = side
                self._side_config = ConfigParser.ConfigParser()
                self._side_config.read(self.config_filename)
-               if not self._side_config.has_section('usrp'):
-                       self._side_config.add_section('usrp')
-               self._side_config.set('usrp', 'side', str(self.side))
+               if not self._side_config.has_section('usrp_rx_hrpt'):
+                       self._side_config.add_section('usrp_rx_hrpt')
+               self._side_config.set('usrp_rx_hrpt', 'side', str(self.side))
                self._side_config.write(open(self.config_filename, 'w'))
 
        def set_pll_alpha(self, pll_alpha):
                self.pll_alpha = pll_alpha
                self._pll_alpha_config = ConfigParser.ConfigParser()
                self._pll_alpha_config.read(self.config_filename)
-               if not self._pll_alpha_config.has_section('demod'):
-                       self._pll_alpha_config.add_section('demod')
-               self._pll_alpha_config.set('demod', 'pll_alpha', str(self.pll_alpha))
+               if not self._pll_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._pll_alpha_config.add_section('usrp_rx_hrpt')
+               self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha))
                self._pll_alpha_config.write(open(self.config_filename, 'w'))
                self.pll.set_alpha(self.pll_alpha)
                self.pll.set_beta(self.pll_alpha**2/4.0)
@@ -201,30 +190,29 @@ class usrp_rx_hrpt_nogui(gr.top_block):
                self.output_filename = output_filename
                self._output_filename_config = ConfigParser.ConfigParser()
                self._output_filename_config.read(self.config_filename)
-               if not self._output_filename_config.has_section('output'):
-                       self._output_filename_config.add_section('output')
-               self._output_filename_config.set('output', 'filename', str(self.output_filename))
+               if not self._output_filename_config.has_section('usrp_rx_hrpt'):
+                       self._output_filename_config.add_section('usrp_rx_hrpt')
+               self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename))
                self._output_filename_config.write(open(self.config_filename, 'w'))
 
-       def set_mf_taps(self, mf_taps):
-               self.mf_taps = mf_taps
-               self.gr_fir_filter_xxx_0.set_taps((self.mf_taps))
-
-       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)
+       def set_max_clock_offset(self, max_clock_offset):
+               self.max_clock_offset = max_clock_offset
 
        def set_max_carrier_offset(self, max_carrier_offset):
                self.max_carrier_offset = max_carrier_offset
                self.pll.set_max_offset(self.max_carrier_offset)
 
+       def set_hs(self, hs):
+               self.hs = hs
+               self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs)
+
        def set_gain(self, gain):
                self.gain = gain
                self._gain_config = ConfigParser.ConfigParser()
                self._gain_config.read(self.config_filename)
-               if not self._gain_config.has_section('usrp'):
-                       self._gain_config.add_section('usrp')
-               self._gain_config.set('usrp', 'gain', str(self.gain))
+               if not self._gain_config.has_section('usrp_rx_hrpt'):
+                       self._gain_config.add_section('usrp_rx_hrpt')
+               self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain))
                self._gain_config.write(open(self.config_filename, 'w'))
                self.usrp_source.set_gain(self.gain)
 
@@ -232,12 +220,23 @@ class usrp_rx_hrpt_nogui(gr.top_block):
                self.freq = freq
                self._freq_config = ConfigParser.ConfigParser()
                self._freq_config.read(self.config_filename)
-               if not self._freq_config.has_section('usrp'):
-                       self._freq_config.add_section('usrp')
-               self._freq_config.set('usrp', 'freq', str(self.freq))
+               if not self._freq_config.has_section('usrp_rx_hrpt'):
+                       self._freq_config.add_section('usrp_rx_hrpt')
+               self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq))
                self._freq_config.write(open(self.config_filename, 'w'))
                self.usrp_source.set_frequency(self.freq)
 
+       def set_clock_alpha(self, clock_alpha):
+               self.clock_alpha = clock_alpha
+               self._clock_alpha_config = ConfigParser.ConfigParser()
+               self._clock_alpha_config.read(self.config_filename)
+               if not self._clock_alpha_config.has_section('usrp_rx_hrpt'):
+                       self._clock_alpha_config.add_section('usrp_rx_hrpt')
+               self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha))
+               self._clock_alpha_config.write(open(self.config_filename, 'w'))
+               self.gr_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0)
+               self.gr_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha)
+
 if __name__ == '__main__':
        parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
        (options, args) = parser.parse_args()
index a290204b0a45c7950590f88d8c7d1b1e6b86031d..800d9ad65c3bd8aa043af95047e70defc65cfcbf 100644 (file)
@@ -24,8 +24,8 @@ 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 \
-       noaa_hrpt_sync_fb.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
new file mode 100644 (file)
index 0000000..7dcb827
--- /dev/null
@@ -0,0 +1,16 @@
+<?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/grc/noaa_hrpt_sync_fb.xml b/gr-noaa/grc/noaa_hrpt_sync_fb.xml
deleted file mode 100644 (file)
index e066e34..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<block>
-  <name>HRPT SYNC</name>
-  <key>noaa_hrpt_sync_fb</key>
-  <category>NOAA</category>
-  <import>from gnuradio import noaa</import>
-  <make>noaa.hrpt_sync_fb($alpha, $beta, $sps, $max_offset)</make>
-  <callback>set_alpha($alpha)</callback>
-  <callback>set_beta($beta)</callback>
-  <callback>set_max_offset($max_offset)</callback>
-  <param>
-    <name>Alpha</name>
-    <key>alpha</key>
-    <type>real</type>
-  </param>
-  <param>
-    <name>Beta</name>
-    <key>beta</key>
-    <type>real</type>
-  </param>
-  <param>
-    <name>Samples/Symbol</name>
-    <key>sps</key>
-    <type>real</type>
-  </param>
-  <param>
-    <name>Max Offset</name>
-    <key>max_offset</key>
-    <type>real</type>
-  </param>
-  <sink>
-    <name>in</name>
-    <type>float</type>
-  </sink>
-  <source>
-    <name>out</name>
-    <type>byte</type>
-  </source>
-</block>
index 6435d192e93876b8086fc06e8e3aa3b0e3c6306c..a4423167ebb8535db508450a7828c265cf151338 100644 (file)
@@ -29,10 +29,10 @@ 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 \
-       noaa_hrpt_sync_fb.cc
+       noaa_hrpt_pll_cf.cc
 
 libgnuradio_noaa_la_LIBADD = \
        $(GNURADIO_CORE_LA)
@@ -40,7 +40,7 @@ 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 \
-       noaa_hrpt_sync_fb.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
new file mode 100644 (file)
index 0000000..53e47d9
--- /dev/null
@@ -0,0 +1,72 @@
+/* -*- 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
new file mode 100644 (file)
index 0000000..8b8633c
--- /dev/null
@@ -0,0 +1,49 @@
+/* -*- 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_sync_fb.cc b/gr-noaa/lib/noaa_hrpt_sync_fb.cc
deleted file mode 100644 (file)
index 9c655b0..0000000
+++ /dev/null
@@ -1,95 +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_sync_fb.h>
-#include <gr_io_signature.h>
-
-inline int signum(float f)
-{
-  return f >= 0.0 ? 1 : -1;
-}
-
-noaa_hrpt_sync_fb_sptr
-noaa_make_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset)
-{
-  return gnuradio::get_initial_sptr(new noaa_hrpt_sync_fb(alpha, beta, sps, max_offset));
-}
-
-noaa_hrpt_sync_fb::noaa_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset)
-  : gr_block("noaa_hrpt_sync_fb",
-            gr_make_io_signature(1, 1, sizeof(float)),
-            gr_make_io_signature(1, 1, sizeof(char))),
-    d_alpha(alpha), d_beta(beta), 
-    d_sps(sps), d_max_offset(max_offset),
-    d_phase(0.0), d_freq(1.0/sps),
-    d_last_sign(1)
-{
-}
-
-int
-noaa_hrpt_sync_fb::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 float *in = (const float *)input_items[0];
-  char *out = (char *)output_items[0];
-
-  int i = 0, j = 0;
-  while (i < ninputs && j < noutput_items) {
-    float sample = in[i++];
-    int sign = signum(sample);
-    d_phase += d_freq;
-
-    // Train on zero crossings in center region of symbol
-    if (sign != d_last_sign) {
-      float phase_err = 0.0;
-      if (d_phase > 0.25 && d_phase < 0.75)
-       phase_err = d_phase-0.5;
-      else if (d_phase >= 0.75)
-       phase_err = d_phase - 1.0;
-      else
-       phase_err = d_phase;
-
-      d_phase -= phase_err*d_alpha;        // 1st order phase adjustment
-      d_freq -= phase_err*d_beta;          // 2nd order frequency adjustment
-
-      d_last_sign = sign;
-    }
-
-    if (d_phase > 1.0) {
-      if (sample < 0.0)
-       out[j++] = 1;
-      else
-       out[j++] = 0;
-      d_phase -= 1.0;
-    }
-  }
-
-  consume_each(i);
-  return j;
-}
diff --git a/gr-noaa/lib/noaa_hrpt_sync_fb.h b/gr-noaa/lib/noaa_hrpt_sync_fb.h
deleted file mode 100644 (file)
index a9416b9..0000000
+++ /dev/null
@@ -1,58 +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_SYNC_FB_H
-#define INCLUDED_NOAA_HRPT_SYNC_FB_H
-
-#include <gr_block.h>
-
-class noaa_hrpt_sync_fb;
-typedef boost::shared_ptr<noaa_hrpt_sync_fb> noaa_hrpt_sync_fb_sptr;
-
-noaa_hrpt_sync_fb_sptr
-noaa_make_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset);
-
-class noaa_hrpt_sync_fb : public gr_block
-{
-  friend noaa_hrpt_sync_fb_sptr noaa_make_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset);
-  noaa_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset);
-
-  float d_alpha;               // 1st order loop constant
-  float d_beta;                        // 2nd order loop constant
-  float d_sps;                  // samples per symbol
-  float d_max_offset;          // Maximum frequency offset for d_sps, samples/symbol
-  float d_phase;               // Instantaneous symbol phase
-  float d_freq;                        // Instantaneous symbol frequency, samples/symbol
-  int   d_last_sign;            // Tracks zero crossings
-
- 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);
-
-  void set_alpha(float alpha) { d_alpha = alpha; }
-  void set_beta(float beta) { d_beta = beta; }
-  void set_max_offset(float max_offset) { d_max_offset = max_offset; }
-};
-
-#endif /* INCLUDED_NOAA_HRPT_SYNC_FB_H */
index 3ac7879d641cc2e013ae856eeae0525a86b8e2bb..97056811b46d78c0141d0ddd330079aabda801e4 100644 (file)
@@ -52,10 +52,10 @@ 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 \
-       noaa_hrpt_sync_fb.i
+       noaa_hrpt_pll_cf.i
 
 include $(top_srcdir)/Makefile.swig
 
diff --git a/gr-noaa/swig/noaa_hrpt_bit_sync.i b/gr-noaa/swig/noaa_hrpt_bit_sync.i
new file mode 100644 (file)
index 0000000..34b565c
--- /dev/null
@@ -0,0 +1,32 @@
+/* -*- 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_hrpt_sync_fb.i b/gr-noaa/swig/noaa_hrpt_sync_fb.i
deleted file mode 100644 (file)
index a8e5b21..0000000
+++ /dev/null
@@ -1,37 +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_sync_fb)
-
-noaa_hrpt_sync_fb_sptr
-noaa_make_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset);
-
-class noaa_hrpt_sync_fb : public gr_sync_block
-{
-private:
-  noaa_hrpt_sync_fb();
-
-public:
-  void set_alpha(float alpha);
-  void set_beta(float beta);
-  void set_max_offset(float min_freq);
-};
index e6497bc468314bc1776dceb42d69c0fa25e58135..efda4f40336eb32c8e0f0be57690fb2675269788 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_sync_fb.h>
 %}
 
+%include "noaa_hrpt_bit_sync.i"
 %include "noaa_hrpt_decoder.i"
 %include "noaa_hrpt_deframer.i"
 %include "noaa_hrpt_pll_cf.i"
-%include "noaa_hrpt_sync_fb.i"
+