diff options
Diffstat (limited to 'gr-noaa/apps')
-rw-r--r-- | gr-noaa/apps/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gr-noaa/apps/Makefile.am | 8 | ||||
-rw-r--r-- | gr-noaa/apps/file_rx_hrpt.grc | 721 | ||||
-rwxr-xr-x | gr-noaa/apps/file_rx_hrpt.py | 334 | ||||
-rw-r--r-- | gr-noaa/apps/file_rx_lrit.grc | 1372 | ||||
-rwxr-xr-x | gr-noaa/apps/file_rx_lrit.py | 337 | ||||
-rw-r--r-- | gr-noaa/apps/hrpt_demod.grc | 310 | ||||
-rwxr-xr-x | gr-noaa/apps/hrpt_demod.py | 76 | ||||
-rw-r--r-- | gr-noaa/apps/usrp_rx_hrpt.grc | 1327 | ||||
-rwxr-xr-x | gr-noaa/apps/usrp_rx_hrpt.py | 401 | ||||
-rw-r--r-- | gr-noaa/apps/usrp_rx_hrpt_nogui.grc | 1013 | ||||
-rwxr-xr-x | gr-noaa/apps/usrp_rx_hrpt_nogui.py | 217 | ||||
-rw-r--r-- | gr-noaa/apps/usrp_rx_lrit.grc | 1825 | ||||
-rwxr-xr-x | gr-noaa/apps/usrp_rx_lrit.py | 523 |
14 files changed, 2608 insertions, 5858 deletions
diff --git a/gr-noaa/apps/CMakeLists.txt b/gr-noaa/apps/CMakeLists.txt index 37d07ffa0..233f0ee5f 100644 --- a/gr-noaa/apps/CMakeLists.txt +++ b/gr-noaa/apps/CMakeLists.txt @@ -24,10 +24,8 @@ GR_PYTHON_INSTALL( hrpt_decode.py hrpt_demod.py file_rx_hrpt.py - file_rx_lrit.py usrp_rx_hrpt.py usrp_rx_hrpt_nogui.py - usrp_rx_lrit.py DESTINATION ${GR_RUNTIME_DIR} COMPONENT "noaa_python" ) diff --git a/gr-noaa/apps/Makefile.am b/gr-noaa/apps/Makefile.am index b760e52b4..c60c8c137 100644 --- a/gr-noaa/apps/Makefile.am +++ b/gr-noaa/apps/Makefile.am @@ -27,17 +27,13 @@ dist_bin_SCRIPTS = \ hrpt_decode.py \ hrpt_demod.py \ file_rx_hrpt.py \ - file_rx_lrit.py \ usrp_rx_hrpt.py \ - usrp_rx_hrpt_nogui.py \ - usrp_rx_lrit.py + usrp_rx_hrpt_nogui.py EXTRA_DIST += \ hrpt_decode.grc \ hrpt_demod.grc \ file_rx_hrpt.grc \ - file_rx_lrit.grc \ usrp_rx_hrpt.grc \ - usrp_rx_hrpt_nogui.grc \ - usrp_rx_lrit.grc + usrp_rx_hrpt_nogui.grc endif diff --git a/gr-noaa/apps/file_rx_hrpt.grc b/gr-noaa/apps/file_rx_hrpt.grc index e3cccd393..4097e83d3 100644 --- a/gr-noaa/apps/file_rx_hrpt.grc +++ b/gr-noaa/apps/file_rx_hrpt.grc @@ -1,55 +1,23 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Mon Nov 9 07:47:17 2009</timestamp> + <timestamp>Thu Oct 27 13:48:25 2011</timestamp> <block> - <key>options</key> + <key>variable</key> <param> <key>id</key> - <value>file_rx_hrpt</value> + <value>max_carrier_offset</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> + <key>value</key> + <value>2*math.pi*100e3/sample_rate</value> </param> <param> <key>_coordinate</key> - <value>(10, 10)</value> + <value>(575, 19)</value> </param> <param> <key>_rotation</key> @@ -106,7 +74,7 @@ <key>variable</key> <param> <key>id</key> - <value>sample_rate</value> + <value>hs</value> </param> <param> <key>_enabled</key> @@ -114,11 +82,11 @@ </param> <param> <key>value</key> - <value>64e6/decim</value> + <value>int(sps/2.0)</value> </param> <param> <key>_coordinate</key> - <value>(198, 17)</value> + <value>(499, 19)</value> </param> <param> <key>_rotation</key> @@ -126,22 +94,22 @@ </param> </block> <block> - <key>virtual_source</key> + <key>variable</key> <param> <key>id</key> - <value>virtual_source_0</value> + <value>max_clock_offset</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>stream_id</key> - <value>baseband</value> + <key>value</key> + <value>100e-6</value> </param> <param> <key>_coordinate</key> - <value>(173, 971)</value> + <value>(705, 19)</value> </param> <param> <key>_rotation</key> @@ -149,77 +117,79 @@ </param> </block> <block> - <key>wxgui_scopesink2</key> + <key>import</key> <param> <key>id</key> - <value>demod_scope</value> + <value>import_0</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> + <key>import</key> + <value>import math, os</value> </param> <param> - <key>samp_rate</key> - <value>sym_rate*2.0</value> + <key>_coordinate</key> + <value>(9, 106)</value> </param> <param> - <key>v_scale</key> - <value>0.5</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>variable</key> <param> - <key>v_offset</key> - <value>0</value> + <key>id</key> + <value>config_filename</value> </param> <param> - <key>t_scale</key> - <value>10.0/sym_rate</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>ac_couple</key> - <value>False</value> + <key>value</key> + <value>os.environ['HOME']+'/.gnuradio/config.conf'</value> </param> <param> - <key>xy_mode</key> - <value>False</value> + <key>_coordinate</key> + <value>(13, 168)</value> </param> <param> - <key>num_inputs</key> - <value>1</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>variable</key> <param> - <key>win_size</key> - <value></value> + <key>id</key> + <value>sample_rate</value> </param> <param> - <key>grid_pos</key> - <value>0, 0, 1, 1</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>notebook</key> - <value>displays, 1</value> + <key>value</key> + <value>4e6</value> </param> <param> <key>_coordinate</key> - <value>(666, 542)</value> + <value>(198, 17)</value> </param> <param> <key>_rotation</key> - <value>180</value> + <value>0</value> </param> </block> <block> - <key>gr_clock_recovery_mm_xx</key> + <key>digital_clock_recovery_mm_xx</key> <param> <key>id</key> - <value>gr_clock_recovery_mm_xx_0</value> + <value>digital_clock_recovery_mm_xx_0</value> </param> <param> <key>_enabled</key> @@ -251,7 +221,7 @@ </param> <param> <key>_coordinate</key> - <value>(873, 696)</value> + <value>(897, 341)</value> </param> <param> <key>_rotation</key> @@ -259,34 +229,22 @@ </param> </block> <block> - <key>gr_moving_average_xx</key> + <key>virtual_sink</key> <param> <key>id</key> - <value>gr_moving_average_xx_0</value> + <value>virtual_sink_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> + <key>stream_id</key> + <value>baseband</value> </param> <param> <key>_coordinate</key> - <value>(682, 713)</value> + <value>(1139, 373)</value> </param> <param> <key>_rotation</key> @@ -317,7 +275,7 @@ </param> <param> <key>_coordinate</key> - <value>(469, 713)</value> + <value>(470, 357)</value> </param> <param> <key>_rotation</key> @@ -325,79 +283,10 @@ </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>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> + <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> @@ -405,46 +294,23 @@ </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> + <value>float</value> </param> <param> - <key>_coordinate</key> - <value>(301, 705)</value> + <key>length</key> + <value>hs</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> + <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>(73, 733)</value> + <value>(683, 357)</value> </param> <param> <key>_rotation</key> @@ -452,10 +318,10 @@ </param> </block> <block> - <key>gr_file_source</key> + <key>gr_file_sink</key> <param> <key>id</key> - <value>gr_file_source_0</value> + <value>frame_sink</value> </param> <param> <key>_enabled</key> @@ -463,23 +329,23 @@ </param> <param> <key>file</key> - <value>input_filename</value> + <value>output_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>unbuffered</key> + <value>False</value> + </param> + <param> <key>_coordinate</key> - <value>(76, 613)</value> + <value>(809, 595)</value> </param> <param> <key>_rotation</key> @@ -487,34 +353,26 @@ </param> </block> <block> - <key>notebook</key> + <key>noaa_hrpt_decoder</key> <param> <key>id</key> - <value>displays</value> + <value>decoder</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> + <key>verbose</key> + <value>True</value> </param> <param> - <key>notebook</key> - <value></value> + <key>output</key> + <value>True</value> </param> <param> <key>_coordinate</key> - <value>(12, 249)</value> + <value>(810, 496)</value> </param> <param> <key>_rotation</key> @@ -522,10 +380,10 @@ </param> </block> <block> - <key>wxgui_fftsink2</key> + <key>gr_agc_xx</key> <param> <key>id</key> - <value>rx_fft</value> + <value>agc</value> </param> <param> <key>_enabled</key> @@ -536,72 +394,24 @@ <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> + <key>rate</key> + <value>1e-6</value> </param> <param> - <key>win_size</key> - <value>640, 360</value> + <key>reference</key> + <value>1.0</value> </param> <param> - <key>grid_pos</key> - <value>0, 0, 1, 1</value> + <key>gain</key> + <value>1.0</value> </param> <param> - <key>notebook</key> - <value>displays, 0</value> + <key>max_gain</key> + <value>1.0</value> </param> <param> <key>_coordinate</key> - <value>(471, 450)</value> + <value>(302, 349)</value> </param> <param> <key>_rotation</key> @@ -609,10 +419,10 @@ </param> </block> <block> - <key>gr_binary_slicer_fb</key> + <key>gr_interleaved_short_to_complex</key> <param> <key>id</key> - <value>gr_binary_slicer_fb_0</value> + <value>gr_interleaved_short_to_complex_0</value> </param> <param> <key>_enabled</key> @@ -620,7 +430,7 @@ </param> <param> <key>_coordinate</key> - <value>(393, 975)</value> + <value>(92, 377)</value> </param> <param> <key>_rotation</key> @@ -651,7 +461,7 @@ </param> <param> <key>_coordinate</key> - <value>(75, 679)</value> + <value>(94, 323)</value> </param> <param> <key>_rotation</key> @@ -659,69 +469,34 @@ </param> </block> <block> - <key>parameter</key> + <key>gr_file_source</key> <param> <key>id</key> - <value>input_filename</value> + <value>gr_file_source_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> + <key>file</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>(196, 98)</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>32</value> + <value>short</value> </param> <param> - <key>type</key> - <value>intx</value> + <key>repeat</key> + <value>False</value> </param> <param> - <key>short_id</key> - <value>d</value> + <key>vlen</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(307, 98)</value> + <value>(95, 257)</value> </param> <param> <key>_rotation</key> @@ -729,54 +504,42 @@ </param> </block> <block> - <key>variable_slider</key> + <key>variable_config</key> <param> <key>id</key> - <value>pll_alpha</value> + <value>freq</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> + <value>1698e6</value> </param> <param> - <key>max</key> - <value>0.5</value> - </param> - <param> - <key>num_steps</key> - <value>100</value> + <key>type</key> + <value>real</value> </param> <param> - <key>style</key> - <value>wx.SL_HORIZONTAL</value> + <key>config_file</key> + <value>config_filename</value> </param> <param> - <key>converver</key> - <value>float_converter</value> + <key>section</key> + <value>'usrp_rx_hrpt'</value> </param> <param> - <key>grid_pos</key> - <value>0, 0, 1, 1</value> + <key>option</key> + <value>'freq'</value> </param> <param> - <key>notebook</key> - <value></value> + <key>writeback</key> + <value>freq</value> </param> <param> <key>_coordinate</key> - <value>(397, 98)</value> + <value>(218, 104)</value> </param> <param> <key>_rotation</key> @@ -784,77 +547,42 @@ </param> </block> <block> - <key>variable_slider</key> + <key>variable_config</key> <param> <key>id</key> - <value>clock_alpha</value> + <value>gain</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> + <value>35</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>(540, 98)</value> + <key>type</key> + <value>real</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>config_file</key> + <value>config_filename</value> </param> - </block> - <block> - <key>variable</key> <param> - <key>id</key> - <value>hs</value> + <key>section</key> + <value>'usrp_rx_hrpt'</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>option</key> + <value>'gain'</value> </param> <param> - <key>value</key> - <value>int(sps/2.0)</value> + <key>writeback</key> + <value>gain</value> </param> <param> <key>_coordinate</key> - <value>(499, 19)</value> + <value>(375, 105)</value> </param> <param> <key>_rotation</key> @@ -862,10 +590,10 @@ </param> </block> <block> - <key>variable</key> + <key>variable_config</key> <param> <key>id</key> - <value>max_carrier_offset</value> + <value>pll_alpha</value> </param> <param> <key>_enabled</key> @@ -873,34 +601,31 @@ </param> <param> <key>value</key> - <value>2*math.pi*100e3/sample_rate</value> + <value>0.01</value> </param> <param> - <key>_coordinate</key> - <value>(575, 19)</value> + <key>type</key> + <value>real</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>config_file</key> + <value>config_filename</value> </param> - </block> - <block> - <key>variable</key> <param> - <key>id</key> - <value>max_clock_offset</value> + <key>section</key> + <value>'usrp_rx_hrpt'</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>option</key> + <value>'pll_alpha'</value> </param> <param> - <key>value</key> - <value>100e-6</value> + <key>writeback</key> + <value>pll_alpha</value> </param> <param> <key>_coordinate</key> - <value>(705, 19)</value> + <value>(534, 104)</value> </param> <param> <key>_rotation</key> @@ -911,7 +636,7 @@ <key>variable_config</key> <param> <key>id</key> - <value>output_filename</value> + <value>clock_alpha</value> </param> <param> <key>_enabled</key> @@ -919,11 +644,11 @@ </param> <param> <key>value</key> - <value>'frames.hrpt'</value> + <value>0.01</value> </param> <param> <key>type</key> - <value>string</value> + <value>real</value> </param> <param> <key>config_file</key> @@ -935,15 +660,15 @@ </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>(521, 254)</value> + <value>(692, 104)</value> </param> <param> <key>_rotation</key> @@ -954,7 +679,7 @@ <key>variable_config</key> <param> <key>id</key> - <value>saved_pll_alpha</value> + <value>output_filename</value> </param> <param> <key>_enabled</key> @@ -962,11 +687,11 @@ </param> <param> <key>value</key> - <value>0.01</value> + <value>'frames.hrpt'</value> </param> <param> <key>type</key> - <value>real</value> + <value>string</value> </param> <param> <key>config_file</key> @@ -978,15 +703,15 @@ </param> <param> <key>option</key> - <value>'pll_alpha'</value> + <value>'filename'</value> </param> <param> <key>writeback</key> - <value>pll_alpha</value> + <value>output_filename</value> </param> <param> <key>_coordinate</key> - <value>(195, 253)</value> + <value>(850, 105)</value> </param> <param> <key>_rotation</key> @@ -994,42 +719,41 @@ </param> </block> <block> - <key>variable_config</key> + <key>noaa_hrpt_deframer</key> <param> <key>id</key> - <value>saved_clock_alpha</value> + <value>deframer</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>real</value> + <key>_coordinate</key> + <value>(598, 546)</value> </param> <param> - <key>config_file</key> - <value>config_filename</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>virtual_source</key> <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> + <key>id</key> + <value>virtual_source_0</value> </param> <param> - <key>option</key> - <value>'clock_alpha'</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>writeback</key> - <value>clock_alpha</value> + <key>stream_id</key> + <value>baseband</value> </param> <param> <key>_coordinate</key> - <value>(360, 255)</value> + <value>(90, 542)</value> </param> <param> <key>_rotation</key> @@ -1037,10 +761,10 @@ </param> </block> <block> - <key>noaa_hrpt_deframer</key> + <key>digital_binary_slicer_fb</key> <param> <key>id</key> - <value>deframer</value> + <value>digital_binary_slicer_fb_0</value> </param> <param> <key>_enabled</key> @@ -1048,7 +772,7 @@ </param> <param> <key>_coordinate</key> - <value>(579, 975)</value> + <value>(332, 546)</value> </param> <param> <key>_rotation</key> @@ -1056,57 +780,54 @@ </param> </block> <block> - <key>noaa_hrpt_decoder</key> + <key>options</key> <param> <key>id</key> - <value>decoder</value> + <value>file_rx_hrpt</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>verbose</key> - <value>True</value> + <key>title</key> + <value>USRP HRPT Receiver</value> </param> <param> - <key>output</key> - <value>False</value> + <key>author</key> + <value></value> </param> <param> - <key>_coordinate</key> - <value>(849, 925)</value> + <key>description</key> + <value></value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>window_size</key> + <value>4096,4096</value> </param> - </block> - <block> - <key>gr_file_sink</key> <param> - <key>id</key> - <value>frame_sink</value> + <key>generate_options</key> + <value>no_gui</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>category</key> + <value>Custom</value> </param> <param> - <key>file</key> - <value>output_filename</value> + <key>run_options</key> + <value>prompt</value> </param> <param> - <key>type</key> - <value>short</value> + <key>run</key> + <value>True</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>realtime_scheduling</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(848, 1007)</value> + <value>(10, 10)</value> </param> <param> <key>_rotation</key> @@ -1114,38 +835,14 @@ </param> </block> <connection> - <source_block_id>virtual_source_0</source_block_id> - <sink_block_id>gr_binary_slicer_fb_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>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> + <source_block_id>digital_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> + <sink_block_id>digital_clock_recovery_mm_xx_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> @@ -1162,8 +859,14 @@ <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>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>deframer</source_block_id> + <sink_block_id>frame_sink</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> @@ -1186,7 +889,13 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_binary_slicer_fb_0</source_block_id> + <source_block_id>virtual_source_0</source_block_id> + <sink_block_id>digital_binary_slicer_fb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_binary_slicer_fb_0</source_block_id> <sink_block_id>deframer</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> diff --git a/gr-noaa/apps/file_rx_hrpt.py b/gr-noaa/apps/file_rx_hrpt.py index 13b887635..fcd1832f6 100755 --- a/gr-noaa/apps/file_rx_hrpt.py +++ b/gr-noaa/apps/file_rx_hrpt.py @@ -2,53 +2,36 @@ ################################################## # Gnuradio Python Flow Graph # Title: USRP HRPT Receiver -# Generated: Mon Nov 9 07:47:17 2009 +# Generated: Thu Oct 27 13:48:25 2011 ################################################## +from gnuradio import digital 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): +class file_rx_hrpt(gr.top_block): - def __init__(self, input_filename="usrp.dat", decim=32): - grc_wxgui.top_block_gui.__init__(self, title="USRP HRPT Receiver") - - ################################################## - # Parameters - ################################################## - self.input_filename = input_filename - self.decim = decim + def __init__(self): + gr.top_block.__init__(self, "USRP HRPT Receiver") ################################################## # 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.sample_rate = sample_rate = 4e6 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.01 - 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.01 - self.saved_clock_alpha = saved_clock_alpha - self.pll_alpha = pll_alpha = saved_pll_alpha + self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' + self._pll_alpha_config = ConfigParser.ConfigParser() + self._pll_alpha_config.read(config_filename) + try: pll_alpha = self._pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha') + except: pll_alpha = 0.01 + 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('usrp_rx_hrpt', 'filename') @@ -57,190 +40,127 @@ class file_rx_hrpt(grc_wxgui.top_block_gui): self.max_clock_offset = max_clock_offset = 100e-6 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) + self._gain_config = ConfigParser.ConfigParser() + self._gain_config.read(config_filename) + 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_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.01 + self.clock_alpha = clock_alpha ################################################## # Blocks ################################################## - self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - self.decoder = noaa.hrpt_decoder(True,False) - 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.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, 2*sample_rate) + self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) + self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) + self.gr_interleaved_short_to_complex_0 = gr.interleaved_short_to_complex() + self.gr_file_source_0 = gr.file_source(gr.sizeof_short*1, "input_filename", False) + self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename) + self.frame_sink.set_unbuffered(False) + self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) + self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() + self.deframer = noaa.hrpt_deframer() + self.decoder = noaa.hrpt_decoder(True,True) + self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) ################################################## # Connections ################################################## - 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.gr_moving_average_xx_0, 0), (self.digital_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.deframer, 0), (self.decoder, 0)) + self.connect((self.deframer, 0), (self.frame_sink, 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)) - self.connect((self.gr_binary_slicer_fb_0, 0), (self.deframer, 0)) - - def set_input_filename(self, input_filename): - self.input_filename = input_filename + self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) + self.connect((self.digital_binary_slicer_fb_0, 0), (self.deframer, 0)) - def set_decim(self, decim): - self.decim = decim - self.set_sample_rate(64e6/self.decim) + def get_sym_rate(self): + return self.sym_rate 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 get_sample_rate(self): + return self.sample_rate def set_sample_rate(self, sample_rate): self.sample_rate = sample_rate - self.set_sps(self.sample_rate/self.sym_rate) - self.rx_fft.set_sample_rate(self.sample_rate) self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) + self.set_sps(self.sample_rate/self.sym_rate) + + def get_sps(self): + return self.sps + + def set_sps(self, sps): + self.sps = sps + self.set_hs(int(self.sps/2.0)) + self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) + + def get_config_filename(self): + return self.config_filename def set_config_filename(self, config_filename): self.config_filename = config_filename + self._freq_config = ConfigParser.ConfigParser() + self._freq_config.read(self.config_filename) + 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._gain_config = ConfigParser.ConfigParser() + self._gain_config.read(self.config_filename) + 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._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._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._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._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')) - - def set_sps(self, sps): - self.sps = sps - self.gr_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) - self.set_hs(int(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 get_pll_alpha(self): + return self.pll_alpha 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')) + 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')) + + def get_output_filename(self): + return self.output_filename def set_output_filename(self, output_filename): self.output_filename = output_filename @@ -251,37 +171,69 @@ class file_rx_hrpt(grc_wxgui.top_block_gui): self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) self._output_filename_config.write(open(self.config_filename, 'w')) + def get_max_clock_offset(self): + return self.max_clock_offset + def set_max_clock_offset(self, max_clock_offset): self.max_clock_offset = max_clock_offset + def get_max_carrier_offset(self): + return self.max_carrier_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 get_hs(self): + return self.hs + 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 get_gain(self): + return self.gain + + 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_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')) + + def get_freq(self): + return self.freq + + def set_freq(self, freq): + self.freq = freq + self._freq_config = ConfigParser.ConfigParser() + self._freq_config.read(self.config_filename) + 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')) + + def get_clock_alpha(self): + return self.clock_alpha + 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')) + self.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) + self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.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')) 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=32, - 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) + tb = file_rx_hrpt() + tb.start() + raw_input('Press Enter to quit: ') + tb.stop() diff --git a/gr-noaa/apps/file_rx_lrit.grc b/gr-noaa/apps/file_rx_lrit.grc deleted file mode 100644 index ee6da2a31..000000000 --- a/gr-noaa/apps/file_rx_lrit.grc +++ /dev/null @@ -1,1372 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Wed Dec 16 09:14:28 2009</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>file_rx_lrit</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value>LRIT Receiver (from capture file)</value> - </param> - <param> - <key>author</key> - <value></value> - </param> - <param> - <key>description</key> - <value></value> - </param> - <param> - <key>window_size</key> - <value>4095, 4095</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>prompt</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>symbol_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>293e3</value> - </param> - <param> - <key>_coordinate</key> - <value>(347, 10)</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/symbol_rate</value> - </param> - <param> - <key>_coordinate</key> - <value>(445, 10)</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>(11, 136)</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 os</value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 82)</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>(249, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>rx_spectrum</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>Baseband 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>10</value> - </param> - <param> - <key>ref_level</key> - <value>50</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</value> - </param> - <param> - <key>win</key> - <value>None</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, 0</value> - </param> - <param> - <key>_coordinate</key> - <value>(267, 556)</value> - </param> - <param> - <key>_rotation</key> - <value>0</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>lrit.dat</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>repeat</key> - <value>False</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(79, 729)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</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>(60, 824)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_scopesink2</key> - <param> - <key>id</key> - <value>rx_waveform</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>Baseband Waveform</value> - </param> - <param> - <key>samp_rate</key> - <value>sample_rate</value> - </param> - <param> - <key>v_scale</key> - <value>0</value> - </param> - <param> - <key>v_offset</key> - <value>0</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>win_size</key> - <value></value> - </param> - <param> - <key>grid_pos</key> - <value>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 0</value> - </param> - <param> - <key>_coordinate</key> - <value>(267, 915)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_slider</key> - <param> - <key>id</key> - <value>gain_mu</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Gain Mu</value> - </param> - <param> - <key>value</key> - <value>saved_gain_mu</value> - </param> - <param> - <key>min</key> - <value>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>(478, 91)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>costas_spectrum</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>PLL 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>10</value> - </param> - <param> - <key>y_divs</key> - <value>10</value> - </param> - <param> - <key>ref_level</key> - <value>-15</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>30</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</value> - </param> - <param> - <key>win</key> - <value>window.hanning</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, 2</value> - </param> - <param> - <key>_coordinate</key> - <value>(916, 535)</value> - </param> - <param> - <key>_rotation</key> - <value>0</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>complex</value> - </param> - <param> - <key>omega</key> - <value>sps</value> - </param> - <param> - <key>gain_omega</key> - <value>(gain_mu**2)/4.0</value> - </param> - <param> - <key>mu</key> - <value>0.5</value> - </param> - <param> - <key>gain_mu</key> - <value>gain_mu</value> - </param> - <param> - <key>omega_relative_limit</key> - <value>50e-6</value> - </param> - <param> - <key>_coordinate</key> - <value>(915, 789)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>costas_spectrum_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>Bit Sync Spectrum</value> - </param> - <param> - <key>samp_rate</key> - <value>symbol_rate</value> - </param> - <param> - <key>baseband_freq</key> - <value>0</value> - </param> - <param> - <key>y_per_div</key> - <value>10</value> - </param> - <param> - <key>y_divs</key> - <value>10</value> - </param> - <param> - <key>ref_level</key> - <value>-15</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>30</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</value> - </param> - <param> - <key>win</key> - <value>window.hanning</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, 3</value> - </param> - <param> - <key>_coordinate</key> - <value>(1160, 539)</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>['USRP RX', 'RRC Filter', 'PLL', 'MM']</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>(15, 206)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_slider</key> - <param> - <key>id</key> - <value>costas_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Costas Alpha</value> - </param> - <param> - <key>value</key> - <value>saved_costas_alpha</value> - </param> - <param> - <key>min</key> - <value>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>(338, 90)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_scopesink2</key> - <param> - <key>id</key> - <value>costas_waveform</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>PLL 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>v_offset</key> - <value>0</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>win_size</key> - <value></value> - </param> - <param> - <key>grid_pos</key> - <value>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 2</value> - </param> - <param> - <key>_coordinate</key> - <value>(915, 928)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_scopesink2</key> - <param> - <key>id</key> - <value>mm_waveform</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>Constellation</value> - </param> - <param> - <key>samp_rate</key> - <value>symbol_rate</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>20.0/symbol_rate</value> - </param> - <param> - <key>ac_couple</key> - <value>False</value> - </param> - <param> - <key>xy_mode</key> - <value>True</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>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 3</value> - </param> - <param> - <key>_coordinate</key> - <value>(1160, 922)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_costas_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.2</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_lrit'</value> - </param> - <param> - <key>option</key> - <value>'costas_alpha'</value> - </param> - <param> - <key>writeback</key> - <value>costas_alpha</value> - </param> - <param> - <key>_coordinate</key> - <value>(251, 244)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_gain_mu</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.2</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_lrit'</value> - </param> - <param> - <key>option</key> - <value>'gain_mu'</value> - </param> - <param> - <key>writeback</key> - <value>gain_mu</value> - </param> - <param> - <key>_coordinate</key> - <value>(411, 242)</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>160</value> - </param> - <param> - <key>type</key> - <value>intx</value> - </param> - <param> - <key>short_id</key> - <value>d</value> - </param> - <param> - <key>_coordinate</key> - <value>(249, 90)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>rrc_spectrum</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>RRC 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>10</value> - </param> - <param> - <key>y_divs</key> - <value>10</value> - </param> - <param> - <key>ref_level</key> - <value>-15</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>30</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</value> - </param> - <param> - <key>win</key> - <value>window.hanning</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>(705, 534)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_agc_xx</key> - <param> - <key>id</key> - <value>gr_agc_xx_0</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/32767.0</value> - </param> - <param> - <key>max_gain</key> - <value>1.0</value> - </param> - <param> - <key>_coordinate</key> - <value>(273, 800)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_scopesink2</key> - <param> - <key>id</key> - <value>rx_waveform_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>RRC 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>v_offset</key> - <value>0</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>win_size</key> - <value></value> - </param> - <param> - <key>grid_pos</key> - <value>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 1</value> - </param> - <param> - <key>_coordinate</key> - <value>(706, 927)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_costas_loop_cc</key> - <param> - <key>id</key> - <value>costas</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alpha</key> - <value>costas_alpha</value> - </param> - <param> - <key>beta</key> - <value>(costas_alpha**2)/4.0</value> - </param> - <param> - <key>max_freq</key> - <value>50e-6*sps</value> - </param> - <param> - <key>min_freq</key> - <value>-50e-6*sps</value> - </param> - <param> - <key>order</key> - <value>2</value> - </param> - <param> - <key>_coordinate</key> - <value>(706, 792)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>root_raised_cosine_filter</key> - <param> - <key>id</key> - <value>rrc</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>fir_filter_ccf</value> - </param> - <param> - <key>decim</key> - <value>1</value> - </param> - <param> - <key>interp</key> - <value>1</value> - </param> - <param> - <key>gain</key> - <value>1</value> - </param> - <param> - <key>samp_rate</key> - <value>sample_rate</value> - </param> - <param> - <key>sym_rate</key> - <value>symbol_rate</value> - </param> - <param> - <key>alpha</key> - <value>0.25</value> - </param> - <param> - <key>ntaps</key> - <value>int(11*sample_rate/symbol_rate)</value> - </param> - <param> - <key>_coordinate</key> - <value>(448, 784)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>rrc</source_block_id> - <sink_block_id>rx_waveform_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>rrc</source_block_id> - <sink_block_id>rrc_spectrum</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_agc_xx_0</source_block_id> - <sink_block_id>rrc</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>rx_waveform</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>rx_spectrum</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>gr_agc_xx_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>gr_throttle_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>rrc</source_block_id> - <sink_block_id>costas</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>costas</source_block_id> - <sink_block_id>costas_spectrum</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>costas</source_block_id> - <sink_block_id>costas_waveform</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>costas</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>costas_spectrum_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>mm_waveform</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-noaa/apps/file_rx_lrit.py b/gr-noaa/apps/file_rx_lrit.py deleted file mode 100755 index 9a50631f7..000000000 --- a/gr-noaa/apps/file_rx_lrit.py +++ /dev/null @@ -1,337 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: LRIT Receiver (from capture file) -# Generated: Wed Dec 16 09:16:13 2009 -################################################## - -from gnuradio import eng_notation -from gnuradio import gr -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 os -import wx - -class file_rx_lrit(grc_wxgui.top_block_gui): - - def __init__(self, decim=160): - grc_wxgui.top_block_gui.__init__(self, title="LRIT Receiver (from capture file)") - - ################################################## - # Parameters - ################################################## - self.decim = decim - - ################################################## - # Variables - ################################################## - self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' - self.symbol_rate = symbol_rate = 293e3 - self._saved_gain_mu_config = ConfigParser.ConfigParser() - self._saved_gain_mu_config.read(config_filename) - try: saved_gain_mu = self._saved_gain_mu_config.getfloat('usrp_rx_lrit', 'gain_mu') - except: saved_gain_mu = 0.2 - self.saved_gain_mu = saved_gain_mu - self._saved_costas_alpha_config = ConfigParser.ConfigParser() - self._saved_costas_alpha_config.read(config_filename) - try: saved_costas_alpha = self._saved_costas_alpha_config.getfloat('usrp_rx_lrit', 'costas_alpha') - except: saved_costas_alpha = 0.2 - self.saved_costas_alpha = saved_costas_alpha - self.sample_rate = sample_rate = 64e6/decim - self.sps = sps = sample_rate/symbol_rate - self.gain_mu = gain_mu = saved_gain_mu - self.costas_alpha = costas_alpha = saved_costas_alpha - - ################################################## - # Notebooks - ################################################## - self.displays = wx.Notebook(self.GetWin(), style=wx.NB_TOP) - self.displays.AddPage(grc_wxgui.Panel(self.displays), "USRP RX") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "RRC Filter") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "PLL") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "MM") - self.GridAdd(self.displays, 1, 0, 1, 2) - - ################################################## - # Controls - ################################################## - _gain_mu_sizer = wx.BoxSizer(wx.VERTICAL) - self._gain_mu_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_gain_mu_sizer, - value=self.gain_mu, - callback=self.set_gain_mu, - label="Gain Mu", - converter=forms.float_converter(), - proportion=0, - ) - self._gain_mu_slider = forms.slider( - parent=self.GetWin(), - sizer=_gain_mu_sizer, - value=self.gain_mu, - callback=self.set_gain_mu, - minimum=0, - maximum=0.5, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_gain_mu_sizer, 0, 1, 1, 1) - _costas_alpha_sizer = wx.BoxSizer(wx.VERTICAL) - self._costas_alpha_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_costas_alpha_sizer, - value=self.costas_alpha, - callback=self.set_costas_alpha, - label="Costas Alpha", - converter=forms.float_converter(), - proportion=0, - ) - self._costas_alpha_slider = forms.slider( - parent=self.GetWin(), - sizer=_costas_alpha_sizer, - value=self.costas_alpha, - callback=self.set_costas_alpha, - minimum=0, - maximum=0.5, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_costas_alpha_sizer, 0, 0, 1, 1) - - ################################################## - # Blocks - ################################################## - self.costas = gr.costas_loop_cc(costas_alpha, (costas_alpha**2)/4.0, 50e-6*sps, -50e-6*sps, 2) - self.costas_spectrum = fftsink2.fft_sink_c( - self.displays.GetPage(2).GetWin(), - baseband_freq=0, - y_per_div=10, - y_divs=10, - ref_level=-15, - ref_scale=2.0, - sample_rate=sample_rate, - fft_size=1024, - fft_rate=30, - average=True, - avg_alpha=None, - title="PLL Spectrum", - peak_hold=False, - win=window.hanning, - ) - self.displays.GetPage(2).GridAdd(self.costas_spectrum.win, 0, 0, 1, 1) - self.costas_spectrum_0 = fftsink2.fft_sink_c( - self.displays.GetPage(3).GetWin(), - baseband_freq=0, - y_per_div=10, - y_divs=10, - ref_level=-15, - ref_scale=2.0, - sample_rate=symbol_rate, - fft_size=1024, - fft_rate=30, - average=True, - avg_alpha=None, - title="Bit Sync Spectrum", - peak_hold=False, - win=window.hanning, - ) - self.displays.GetPage(3).GridAdd(self.costas_spectrum_0.win, 0, 0, 1, 1) - self.costas_waveform = scopesink2.scope_sink_c( - self.displays.GetPage(2).GetWin(), - title="PLL Waveform", - sample_rate=sample_rate, - v_scale=0.5, - v_offset=0, - t_scale=20.0/sample_rate, - ac_couple=False, - xy_mode=False, - num_inputs=1, - ) - self.displays.GetPage(2).GridAdd(self.costas_waveform.win, 1, 0, 1, 1) - self.gr_agc_xx_0 = gr.agc_cc(1e-6, 1.0, 1.0/32767.0, 1.0) - self.gr_clock_recovery_mm_xx_0 = gr.clock_recovery_mm_cc(sps, (gain_mu**2)/4.0, 0.5, gain_mu, 50e-6) - self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "lrit.dat", False) - self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, sample_rate) - self.mm_waveform = scopesink2.scope_sink_c( - self.displays.GetPage(3).GetWin(), - title="Constellation", - sample_rate=symbol_rate, - v_scale=0.5, - v_offset=0, - t_scale=20.0/symbol_rate, - ac_couple=False, - xy_mode=True, - num_inputs=1, - ) - self.displays.GetPage(3).GridAdd(self.mm_waveform.win, 1, 0, 1, 1) - self.rrc = gr.fir_filter_ccf(1, firdes.root_raised_cosine( - 1, sample_rate, symbol_rate, 0.25, int(11*sample_rate/symbol_rate))) - self.rrc_spectrum = fftsink2.fft_sink_c( - self.displays.GetPage(1).GetWin(), - baseband_freq=0, - y_per_div=10, - y_divs=10, - ref_level=-15, - ref_scale=2.0, - sample_rate=sample_rate, - fft_size=1024, - fft_rate=30, - average=True, - avg_alpha=None, - title="RRC Spectrum", - peak_hold=False, - win=window.hanning, - ) - self.displays.GetPage(1).GridAdd(self.rrc_spectrum.win, 0, 0, 1, 1) - self.rx_spectrum = fftsink2.fft_sink_c( - self.displays.GetPage(0).GetWin(), - baseband_freq=0, - y_per_div=5, - y_divs=10, - ref_level=50, - ref_scale=2.0, - sample_rate=sample_rate, - fft_size=1024, - fft_rate=15, - average=True, - avg_alpha=None, - title="Baseband Spectrum", - peak_hold=False, - ) - self.displays.GetPage(0).GridAdd(self.rx_spectrum.win, 0, 0, 1, 1) - self.rx_waveform = scopesink2.scope_sink_c( - self.displays.GetPage(0).GetWin(), - title="Baseband Waveform", - sample_rate=sample_rate, - v_scale=0, - v_offset=0, - t_scale=20.0/sample_rate, - ac_couple=False, - xy_mode=False, - num_inputs=1, - ) - self.displays.GetPage(0).GridAdd(self.rx_waveform.win, 1, 0, 1, 1) - self.rx_waveform_0 = scopesink2.scope_sink_c( - self.displays.GetPage(1).GetWin(), - title="RRC Waveform", - sample_rate=sample_rate, - v_scale=0.5, - v_offset=0, - t_scale=20.0/sample_rate, - ac_couple=False, - xy_mode=False, - num_inputs=1, - ) - self.displays.GetPage(1).GridAdd(self.rx_waveform_0.win, 1, 0, 1, 1) - - ################################################## - # Connections - ################################################## - self.connect((self.rrc, 0), (self.rx_waveform_0, 0)) - self.connect((self.rrc, 0), (self.rrc_spectrum, 0)) - self.connect((self.gr_agc_xx_0, 0), (self.rrc, 0)) - self.connect((self.gr_throttle_0, 0), (self.rx_waveform, 0)) - self.connect((self.gr_throttle_0, 0), (self.rx_spectrum, 0)) - self.connect((self.gr_throttle_0, 0), (self.gr_agc_xx_0, 0)) - self.connect((self.gr_file_source_0, 0), (self.gr_throttle_0, 0)) - self.connect((self.rrc, 0), (self.costas, 0)) - self.connect((self.costas, 0), (self.costas_spectrum, 0)) - self.connect((self.costas, 0), (self.costas_waveform, 0)) - self.connect((self.costas, 0), (self.gr_clock_recovery_mm_xx_0, 0)) - self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.costas_spectrum_0, 0)) - self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.mm_waveform, 0)) - - def set_decim(self, decim): - self.decim = decim - self.set_sample_rate(64e6/self.decim) - - def set_config_filename(self, config_filename): - self.config_filename = config_filename - self._saved_costas_alpha_config = ConfigParser.ConfigParser() - self._saved_costas_alpha_config.read(self.config_filename) - if not self._saved_costas_alpha_config.has_section('usrp_rx_lrit'): - self._saved_costas_alpha_config.add_section('usrp_rx_lrit') - self._saved_costas_alpha_config.set('usrp_rx_lrit', 'costas_alpha', str(self.costas_alpha)) - self._saved_costas_alpha_config.write(open(self.config_filename, 'w')) - self._saved_gain_mu_config = ConfigParser.ConfigParser() - self._saved_gain_mu_config.read(self.config_filename) - if not self._saved_gain_mu_config.has_section('usrp_rx_lrit'): - self._saved_gain_mu_config.add_section('usrp_rx_lrit') - self._saved_gain_mu_config.set('usrp_rx_lrit', 'gain_mu', str(self.gain_mu)) - self._saved_gain_mu_config.write(open(self.config_filename, 'w')) - - def set_symbol_rate(self, symbol_rate): - self.symbol_rate = symbol_rate - self.set_sps(self.sample_rate/self.symbol_rate) - self.costas_spectrum_0.set_sample_rate(self.symbol_rate) - self.mm_waveform.set_sample_rate(self.symbol_rate) - self.rrc.set_taps(firdes.root_raised_cosine(1, self.sample_rate, self.symbol_rate, 0.25, int(11*self.sample_rate/self.symbol_rate))) - - def set_saved_gain_mu(self, saved_gain_mu): - self.saved_gain_mu = saved_gain_mu - self.set_gain_mu(self.saved_gain_mu) - - def set_saved_costas_alpha(self, saved_costas_alpha): - self.saved_costas_alpha = saved_costas_alpha - self.set_costas_alpha(self.saved_costas_alpha) - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_sps(self.sample_rate/self.symbol_rate) - self.rx_spectrum.set_sample_rate(self.sample_rate) - self.rx_waveform.set_sample_rate(self.sample_rate) - self.costas_spectrum.set_sample_rate(self.sample_rate) - self.costas_waveform.set_sample_rate(self.sample_rate) - self.rrc_spectrum.set_sample_rate(self.sample_rate) - self.rx_waveform_0.set_sample_rate(self.sample_rate) - self.rrc.set_taps(firdes.root_raised_cosine(1, self.sample_rate, self.symbol_rate, 0.25, int(11*self.sample_rate/self.symbol_rate))) - - def set_sps(self, sps): - self.sps = sps - self.gr_clock_recovery_mm_xx_0.set_omega(self.sps) - - def set_gain_mu(self, gain_mu): - self.gain_mu = gain_mu - self._gain_mu_slider.set_value(self.gain_mu) - self._gain_mu_text_box.set_value(self.gain_mu) - self.gr_clock_recovery_mm_xx_0.set_gain_omega((self.gain_mu**2)/4.0) - self.gr_clock_recovery_mm_xx_0.set_gain_mu(self.gain_mu) - self._saved_gain_mu_config = ConfigParser.ConfigParser() - self._saved_gain_mu_config.read(self.config_filename) - if not self._saved_gain_mu_config.has_section('usrp_rx_lrit'): - self._saved_gain_mu_config.add_section('usrp_rx_lrit') - self._saved_gain_mu_config.set('usrp_rx_lrit', 'gain_mu', str(self.gain_mu)) - self._saved_gain_mu_config.write(open(self.config_filename, 'w')) - - def set_costas_alpha(self, costas_alpha): - self.costas_alpha = costas_alpha - self._costas_alpha_slider.set_value(self.costas_alpha) - self._costas_alpha_text_box.set_value(self.costas_alpha) - self._saved_costas_alpha_config = ConfigParser.ConfigParser() - self._saved_costas_alpha_config.read(self.config_filename) - if not self._saved_costas_alpha_config.has_section('usrp_rx_lrit'): - self._saved_costas_alpha_config.add_section('usrp_rx_lrit') - self._saved_costas_alpha_config.set('usrp_rx_lrit', 'costas_alpha', str(self.costas_alpha)) - self._saved_costas_alpha_config.write(open(self.config_filename, 'w')) - self.costas.set_alpha(self.costas_alpha) - self.costas.set_beta((self.costas_alpha**2)/4.0) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - parser.add_option("-d", "--decim", dest="decim", type="intx", default=160, - help="Set Decim [default=%default]") - (options, args) = parser.parse_args() - tb = file_rx_lrit(decim=options.decim) - tb.Run(True) - diff --git a/gr-noaa/apps/hrpt_demod.grc b/gr-noaa/apps/hrpt_demod.grc index 8af3d82dd..f5833b864 100644 --- a/gr-noaa/apps/hrpt_demod.grc +++ b/gr-noaa/apps/hrpt_demod.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sun Nov 8 10:41:07 2009</timestamp> + <timestamp>Thu Oct 27 13:51:57 2011</timestamp> <block> <key>options</key> <param> @@ -103,29 +103,6 @@ </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>import</key> <param> <key>id</key> @@ -343,122 +320,6 @@ </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>(504, 402)</value> - </param> - <param> - <key>_rotation</key> - <value>0</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>(703, 386)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_deframer</key> - <param> - <key>id</key> - <value>noaa_hrpt_deframer_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(1142, 422)</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>(960, 422)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable</key> <param> <key>id</key> @@ -682,6 +543,10 @@ <value>1</value> </param> <param> + <key>unbuffered</key> + <value>False</value> + </param> + <param> <key>_coordinate</key> <value>(1144, 489)</value> </param> @@ -690,6 +555,145 @@ <value>180</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>(504, 402)</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>4e6</value> + </param> + <param> + <key>_coordinate</key> + <value>(198, 17)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_clock_recovery_mm_xx</key> + <param> + <key>id</key> + <value>digital_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>(704, 386)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>noaa_hrpt_deframer</key> + <param> + <key>id</key> + <value>noaa_hrpt_deframer_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(1142, 422)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_binary_slicer_fb</key> + <param> + <key>id</key> + <value>digital_binary_slicer_fb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(957, 422)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> <source_block_id>file_source</source_block_id> <sink_block_id>cs2cf</sink_block_id> @@ -697,18 +701,6 @@ <sink_key>0</sink_key> </connection> <connection> - <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>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> @@ -739,7 +731,19 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_binary_slicer_fb_0</source_block_id> + <source_block_id>gr_moving_average_xx_0</source_block_id> + <sink_block_id>digital_clock_recovery_mm_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_clock_recovery_mm_xx_0</source_block_id> + <sink_block_id>digital_binary_slicer_fb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_binary_slicer_fb_0</source_block_id> <sink_block_id>noaa_hrpt_deframer_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> diff --git a/gr-noaa/apps/hrpt_demod.py b/gr-noaa/apps/hrpt_demod.py index 38d031686..38b4b2fe3 100755 --- a/gr-noaa/apps/hrpt_demod.py +++ b/gr-noaa/apps/hrpt_demod.py @@ -2,9 +2,10 @@ ################################################## # Gnuradio Python Flow Graph # Title: Hrpt Demod -# Generated: Sun Nov 8 10:41:08 2009 +# Generated: Thu Oct 27 13:51:59 2011 ################################################## +from gnuradio import digital from gnuradio import eng_notation from gnuradio import gr from gnuradio import noaa @@ -31,7 +32,7 @@ class hrpt_demod(gr.top_block): # Variables ################################################## self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 64e6/decim + self.sample_rate = sample_rate = 4e6 self.sps = sps = sample_rate/sym_rate self.max_clock_offset = max_clock_offset = 100e-6 self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate @@ -40,71 +41,104 @@ class hrpt_demod(gr.top_block): ################################################## # Blocks ################################################## - self.agc = gr.agc_cc(1e-5, 1.0, 1.0/32768.0, 1.0) - self.cs2cf = gr.interleaved_short_to_complex() - self.decoder = noaa.hrpt_decoder(True,False) - 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_deframer_0 = noaa.hrpt_deframer() self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) + self.noaa_hrpt_deframer_0 = noaa.hrpt_deframer() + self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) + self.gr_file_sink_0 = gr.file_sink(gr.sizeof_short*1, output_filename) + self.gr_file_sink_0.set_unbuffered(False) + self.file_source = gr.file_source(gr.sizeof_short*1, input_filename, False) + self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) + self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() + self.decoder = noaa.hrpt_decoder(True,False) + self.cs2cf = gr.interleaved_short_to_complex() + self.agc = gr.agc_cc(1e-5, 1.0, 1.0/32768.0, 1.0) ################################################## # Connections ################################################## 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.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.decoder, 0)) - self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_deframer_0, 0)) + self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) + self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) + self.connect((self.digital_binary_slicer_fb_0, 0), (self.noaa_hrpt_deframer_0, 0)) + + def get_input_filename(self): + return self.input_filename def set_input_filename(self, input_filename): self.input_filename = input_filename + def get_output_filename(self): + return self.output_filename + def set_output_filename(self, output_filename): self.output_filename = output_filename + def get_decim(self): + return self.decim + def set_decim(self, decim): self.decim = decim - self.set_sample_rate(64e6/self.decim) + + def get_pll_alpha(self): + return self.pll_alpha 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) + def get_clock_alpha(self): + return self.clock_alpha + 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.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) + self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) + + def get_sym_rate(self): + return self.sym_rate def set_sym_rate(self, sym_rate): self.sym_rate = sym_rate self.set_sps(self.sample_rate/self.sym_rate) + def get_sample_rate(self): + return self.sample_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) + def get_sps(self): + return self.sps + 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) + self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) + + def get_max_clock_offset(self): + return self.max_clock_offset def set_max_clock_offset(self, max_clock_offset): self.max_clock_offset = max_clock_offset + def get_max_carrier_offset(self): + return self.max_carrier_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 get_hs(self): + return self.hs + def set_hs(self, hs): self.hs = hs self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs) @@ -116,11 +150,11 @@ if __name__ == '__main__': parser.add_option("-o", "--output-filename", dest="output_filename", type="string", default="frames.dat", help="Set frames.dat [default=%default]") parser.add_option("-d", "--decim", dest="decim", type="intx", default=32, - help="Set decim [default=%default]") + help="Set None [default=%default]") parser.add_option("-p", "--pll-alpha", dest="pll_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set pll_alpha [default=%default]") + help="Set None [default=%default]") parser.add_option("-s", "--clock-alpha", dest="clock_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set clock_alpha [default=%default]") + help="Set None [default=%default]") (options, args) = parser.parse_args() tb = hrpt_demod(input_filename=options.input_filename, output_filename=options.output_filename, decim=options.decim, pll_alpha=options.pll_alpha, clock_alpha=options.clock_alpha) tb.run() diff --git a/gr-noaa/apps/usrp_rx_hrpt.grc b/gr-noaa/apps/usrp_rx_hrpt.grc index 990855f69..26af48ff0 100644 --- a/gr-noaa/apps/usrp_rx_hrpt.grc +++ b/gr-noaa/apps/usrp_rx_hrpt.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Mon Nov 9 07:56:11 2009</timestamp> + <timestamp>Thu Oct 27 13:26:39 2011</timestamp> <block> <key>options</key> <param> @@ -149,29 +149,6 @@ </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> @@ -325,10 +302,10 @@ </param> </block> <block> - <key>variable_static_text</key> + <key>variable_slider</key> <param> <key>id</key> - <value>side_text</value> + <value>clock_alpha</value> </param> <param> <key>_enabled</key> @@ -336,23 +313,70 @@ </param> <param> <key>label</key> - <value>USRP Side</value> + <value>Clock Alpha</value> </param> <param> <key>value</key> - <value>side</value> + <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>str_converter</value> + <value>float_converter</value> </param> <param> - <key>formatter</key> - <value>None</value> + <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>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, 1</value> + <value>2,0,1,4</value> </param> <param> <key>notebook</key> @@ -360,7 +384,7 @@ </param> <param> <key>_coordinate</key> - <value>(828, 20)</value> + <value>(12, 249)</value> </param> <param> <key>_rotation</key> @@ -368,42 +392,86 @@ </param> </block> <block> - <key>variable_static_text</key> + <key>wxgui_fftsink2</key> <param> <key>id</key> - <value>decim_text</value> + <value>rx_fft</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>Decimation</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>value</key> - <value>decim</value> + <key>title</key> + <value>RX Spectrum</value> </param> <param> - <key>converver</key> - <value>float_converter</value> + <key>samp_rate</key> + <value>sample_rate</value> </param> <param> - <key>formatter</key> + <key>baseband_freq</key> + <value>freq</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>1, 1, 1, 1</value> + <value>0, 0, 1, 1</value> </param> <param> <key>notebook</key> - <value></value> + <value>displays, 0</value> </param> <param> <key>_coordinate</key> - <value>(973, 20)</value> + <value>(477, 457)</value> </param> <param> <key>_rotation</key> @@ -414,7 +482,7 @@ <key>variable</key> <param> <key>id</key> - <value>config_filename</value> + <value>max_clock_offset</value> </param> <param> <key>_enabled</key> @@ -422,11 +490,11 @@ </param> <param> <key>value</key> - <value>os.environ['HOME']+'/.gnuradio/config.conf'</value> + <value>100e-6</value> </param> <param> <key>_coordinate</key> - <value>(12, 129)</value> + <value>(705, 19)</value> </param> <param> <key>_rotation</key> @@ -434,22 +502,38 @@ </param> </block> <block> - <key>import</key> + <key>gr_agc_xx</key> <param> <key>id</key> - <value>import_0</value> + <value>agc</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>import</key> - <value>import math, os</value> + <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>(11, 76)</value> + <value>(301, 705)</value> </param> <param> <key>_rotation</key> @@ -457,42 +541,30 @@ </param> </block> <block> - <key>variable_config</key> + <key>noaa_hrpt_pll_cf</key> <param> <key>id</key> - <value>saved_freq</value> + <value>pll</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_rx_hrpt'</value> + <key>alpha</key> + <value>pll_alpha</value> </param> <param> - <key>option</key> - <value>'freq'</value> + <key>beta</key> + <value>pll_alpha**2/4.0</value> </param> <param> - <key>writeback</key> - <value>freq</value> + <key>max_offset</key> + <value>max_carrier_offset</value> </param> <param> <key>_coordinate</key> - <value>(507, 258)</value> + <value>(469, 713)</value> </param> <param> <key>_rotation</key> @@ -503,7 +575,7 @@ <key>variable_config</key> <param> <key>id</key> - <value>saved_gain</value> + <value>addr</value> </param> <param> <key>_enabled</key> @@ -511,11 +583,11 @@ </param> <param> <key>value</key> - <value>35</value> + <value>""</value> </param> <param> <key>type</key> - <value>real</value> + <value>string</value> </param> <param> <key>config_file</key> @@ -527,15 +599,15 @@ </param> <param> <key>option</key> - <value>'gain'</value> + <value>'addr'</value> </param> <param> <key>writeback</key> - <value>gain</value> + <value>addr</value> </param> <param> <key>_coordinate</key> - <value>(664, 259)</value> + <value>(194, 253)</value> </param> <param> <key>_rotation</key> @@ -543,483 +615,622 @@ </param> </block> <block> - <key>variable_slider</key> + <key>uhd_usrp_source</key> <param> <key>id</key> - <value>clock_alpha</value> + <value>uhd_usrp_source_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>Clock Alpha</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>value</key> - <value>saved_clock_alpha</value> + <key>dev_addr</key> + <value>addr</value> </param> <param> - <key>min</key> + <key>sync</key> + <value></value> + </param> + <param> + <key>clock_rate</key> <value>0.0</value> </param> <param> - <key>max</key> - <value>0.5</value> + <key>num_mboards</key> + <value>1</value> </param> <param> - <key>num_steps</key> - <value>100</value> + <key>ref_source0</key> + <value></value> </param> <param> - <key>style</key> - <value>wx.SL_HORIZONTAL</value> + <key>sd_spec0</key> + <value></value> </param> <param> - <key>converver</key> - <value>float_converter</value> + <key>ref_source1</key> + <value></value> </param> <param> - <key>grid_pos</key> - <value>0, 3, 1, 1</value> + <key>sd_spec1</key> + <value></value> </param> <param> - <key>notebook</key> + <key>ref_source2</key> <value></value> </param> <param> - <key>_coordinate</key> - <value>(618, 106)</value> + <key>sd_spec2</key> + <value></value> </param> <param> - <key>_rotation</key> + <key>ref_source3</key> + <value></value> + </param> + <param> + <key>sd_spec3</key> + <value></value> + </param> + <param> + <key>ref_source4</key> + <value></value> + </param> + <param> + <key>sd_spec4</key> + <value></value> + </param> + <param> + <key>ref_source5</key> + <value></value> + </param> + <param> + <key>sd_spec5</key> + <value></value> + </param> + <param> + <key>ref_source6</key> + <value></value> + </param> + <param> + <key>sd_spec6</key> + <value></value> + </param> + <param> + <key>ref_source7</key> + <value></value> + </param> + <param> + <key>sd_spec7</key> + <value></value> + </param> + <param> + <key>nchan</key> + <value>1</value> + </param> + <param> + <key>samp_rate</key> + <value>sample_rate</value> + </param> + <param> + <key>center_freq0</key> + <value>freq</value> + </param> + <param> + <key>gain0</key> <value>0</value> </param> - </block> - <block> - <key>variable_config</key> <param> - <key>id</key> - <value>side</value> + <key>ant0</key> + <value></value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>bw0</key> + <value>0</value> </param> <param> - <key>value</key> - <value>'A'</value> + <key>center_freq1</key> + <value>0</value> </param> <param> - <key>type</key> - <value>string</value> + <key>gain1</key> + <value>0</value> </param> <param> - <key>config_file</key> - <value>config_filename</value> + <key>ant1</key> + <value></value> </param> <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> + <key>bw1</key> + <value>0</value> </param> <param> - <key>option</key> - <value>'side'</value> + <key>center_freq2</key> + <value>0</value> </param> <param> - <key>writeback</key> - <value>side</value> + <key>gain2</key> + <value>0</value> </param> <param> - <key>_coordinate</key> - <value>(194, 253)</value> + <key>ant2</key> + <value></value> </param> <param> - <key>_rotation</key> + <key>bw2</key> <value>0</value> </param> - </block> - <block> - <key>notebook</key> <param> - <key>id</key> - <value>displays</value> + <key>center_freq3</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>gain3</key> + <value>0</value> </param> <param> - <key>style</key> - <value>wx.NB_TOP</value> + <key>ant3</key> + <value></value> </param> <param> - <key>labels</key> - <value>['Spectrum','Demod']</value> + <key>bw3</key> + <value>0</value> </param> <param> - <key>grid_pos</key> - <value>2,0,1,4</value> + <key>center_freq4</key> + <value>0</value> </param> <param> - <key>notebook</key> + <key>gain4</key> + <value>0</value> + </param> + <param> + <key>ant4</key> <value></value> </param> <param> - <key>_coordinate</key> - <value>(12, 249)</value> + <key>bw4</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>center_freq5</key> <value>0</value> </param> - </block> - <block> - <key>gr_file_sink</key> <param> - <key>id</key> - <value>frame_sink</value> + <key>gain5</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ant5</key> + <value></value> </param> <param> - <key>file</key> - <value>output_filename</value> + <key>bw5</key> + <value>0</value> </param> <param> - <key>type</key> - <value>short</value> + <key>center_freq6</key> + <value>0</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>gain6</key> + <value>0</value> </param> <param> - <key>_coordinate</key> - <value>(973, 1024)</value> + <key>ant6</key> + <value></value> </param> <param> - <key>_rotation</key> + <key>bw6</key> <value>0</value> </param> - </block> - <block> - <key>virtual_source</key> <param> - <key>id</key> - <value>virtual_source_0</value> + <key>center_freq7</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>gain7</key> + <value>0</value> </param> <param> - <key>stream_id</key> - <value>baseband</value> + <key>ant7</key> + <value></value> </param> <param> - <key>_coordinate</key> - <value>(173, 971)</value> + <key>bw7</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>center_freq8</key> <value>0</value> </param> - </block> - <block> - <key>wxgui_scopesink2</key> <param> - <key>id</key> - <value>demod_scope</value> + <key>gain8</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ant8</key> + <value></value> </param> <param> - <key>type</key> - <value>float</value> + <key>bw8</key> + <value>0</value> </param> <param> - <key>title</key> - <value>Post-Demod</value> + <key>center_freq9</key> + <value>0</value> </param> <param> - <key>samp_rate</key> - <value>sym_rate*2.0</value> + <key>gain9</key> + <value>0</value> </param> <param> - <key>v_scale</key> - <value>0.5</value> + <key>ant9</key> + <value></value> </param> <param> - <key>v_offset</key> + <key>bw9</key> <value>0</value> </param> <param> - <key>t_scale</key> - <value>10.0/sym_rate</value> + <key>center_freq10</key> + <value>0</value> </param> <param> - <key>ac_couple</key> - <value>False</value> + <key>gain10</key> + <value>0</value> </param> <param> - <key>xy_mode</key> - <value>False</value> + <key>ant10</key> + <value></value> </param> <param> - <key>num_inputs</key> - <value>1</value> + <key>bw10</key> + <value>0</value> </param> <param> - <key>win_size</key> + <key>center_freq11</key> + <value>0</value> + </param> + <param> + <key>gain11</key> + <value>0</value> + </param> + <param> + <key>ant11</key> <value></value> </param> <param> - <key>grid_pos</key> - <value>0, 0, 1, 1</value> + <key>bw11</key> + <value>0</value> </param> <param> - <key>notebook</key> - <value>displays, 1</value> + <key>center_freq12</key> + <value>0</value> </param> <param> - <key>_coordinate</key> - <value>(666, 542)</value> + <key>gain12</key> + <value>0</value> </param> <param> - <key>_rotation</key> - <value>180</value> + <key>ant12</key> + <value></value> </param> - </block> - <block> - <key>gr_clock_recovery_mm_xx</key> <param> - <key>id</key> - <value>gr_clock_recovery_mm_xx_0</value> + <key>bw12</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>center_freq13</key> + <value>0</value> </param> <param> - <key>type</key> - <value>float</value> + <key>gain13</key> + <value>0</value> </param> <param> - <key>omega</key> - <value>sps/2.0</value> + <key>ant13</key> + <value></value> </param> <param> - <key>gain_omega</key> - <value>clock_alpha**2/4.0</value> + <key>bw13</key> + <value>0</value> </param> <param> - <key>mu</key> - <value>0.5</value> + <key>center_freq14</key> + <value>0</value> </param> <param> - <key>gain_mu</key> - <value>clock_alpha</value> + <key>gain14</key> + <value>0</value> </param> <param> - <key>omega_relative_limit</key> - <value>max_clock_offset</value> + <key>ant14</key> + <value></value> </param> <param> - <key>_coordinate</key> - <value>(873, 696)</value> + <key>bw14</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>center_freq15</key> <value>0</value> </param> - </block> - <block> - <key>gr_moving_average_xx</key> <param> - <key>id</key> - <value>gr_moving_average_xx_0</value> + <key>gain15</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ant15</key> + <value></value> </param> <param> - <key>type</key> - <value>float</value> + <key>bw15</key> + <value>0</value> </param> <param> - <key>length</key> - <value>hs</value> + <key>center_freq16</key> + <value>0</value> </param> <param> - <key>scale</key> - <value>1.0/hs</value> + <key>gain16</key> + <value>0</value> </param> <param> - <key>max_iter</key> - <value>4000</value> + <key>ant16</key> + <value></value> </param> <param> - <key>_coordinate</key> - <value>(682, 713)</value> + <key>bw16</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>center_freq17</key> <value>0</value> </param> - </block> - <block> - <key>noaa_hrpt_pll_cf</key> <param> - <key>id</key> - <value>pll</value> + <key>gain17</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ant17</key> + <value></value> </param> <param> - <key>alpha</key> - <value>pll_alpha</value> + <key>bw17</key> + <value>0</value> </param> <param> - <key>beta</key> - <value>pll_alpha**2/4.0</value> + <key>center_freq18</key> + <value>0</value> </param> <param> - <key>max_offset</key> - <value>max_carrier_offset</value> + <key>gain18</key> + <value>0</value> </param> <param> - <key>_coordinate</key> - <value>(469, 713)</value> + <key>ant18</key> + <value></value> </param> <param> - <key>_rotation</key> + <key>bw18</key> <value>0</value> </param> - </block> - <block> - <key>virtual_sink</key> <param> - <key>id</key> - <value>virtual_sink_0</value> + <key>center_freq19</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>gain19</key> + <value>0</value> </param> <param> - <key>stream_id</key> - <value>baseband</value> + <key>ant19</key> + <value></value> </param> <param> - <key>_coordinate</key> - <value>(1142, 728)</value> + <key>bw19</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>center_freq20</key> <value>0</value> </param> - </block> - <block> - <key>gr_agc_xx</key> <param> - <key>id</key> - <value>agc</value> + <key>gain20</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ant20</key> + <value></value> </param> <param> - <key>type</key> - <value>complex</value> + <key>bw20</key> + <value>0</value> </param> <param> - <key>rate</key> - <value>1e-6</value> + <key>center_freq21</key> + <value>0</value> </param> <param> - <key>reference</key> - <value>1.0</value> + <key>gain21</key> + <value>0</value> </param> <param> - <key>gain</key> - <value>1.0</value> + <key>ant21</key> + <value></value> </param> <param> - <key>max_gain</key> - <value>1.0</value> + <key>bw21</key> + <value>0</value> </param> <param> - <key>_coordinate</key> - <value>(301, 705)</value> + <key>center_freq22</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>gain22</key> <value>0</value> </param> - </block> - <block> - <key>usrp_simple_source_x</key> <param> - <key>id</key> - <value>usrp_source</value> + <key>ant22</key> + <value></value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>bw22</key> + <value>0</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>center_freq23</key> + <value>0</value> + </param> + <param> + <key>gain23</key> + <value>0</value> </param> <param> - <key>format</key> + <key>ant23</key> <value></value> </param> <param> - <key>which</key> + <key>bw23</key> <value>0</value> </param> <param> - <key>decimation</key> - <value>decim</value> + <key>center_freq24</key> + <value>0</value> </param> <param> - <key>frequency</key> - <value>freq</value> + <key>gain24</key> + <value>0</value> </param> <param> - <key>lo_offset</key> - <value>float('inf')</value> + <key>ant24</key> + <value></value> </param> <param> - <key>gain</key> - <value>gain</value> + <key>bw24</key> + <value>0</value> + </param> + <param> + <key>center_freq25</key> + <value>0</value> + </param> + <param> + <key>gain25</key> + <value>0</value> + </param> + <param> + <key>ant25</key> + <value></value> + </param> + <param> + <key>bw25</key> + <value>0</value> + </param> + <param> + <key>center_freq26</key> + <value>0</value> + </param> + <param> + <key>gain26</key> + <value>0</value> + </param> + <param> + <key>ant26</key> + <value></value> + </param> + <param> + <key>bw26</key> + <value>0</value> + </param> + <param> + <key>center_freq27</key> + <value>0</value> + </param> + <param> + <key>gain27</key> + <value>0</value> + </param> + <param> + <key>ant27</key> + <value></value> + </param> + <param> + <key>bw27</key> + <value>0</value> + </param> + <param> + <key>center_freq28</key> + <value>0</value> + </param> + <param> + <key>gain28</key> + <value>0</value> + </param> + <param> + <key>ant28</key> + <value></value> + </param> + <param> + <key>bw28</key> + <value>0</value> + </param> + <param> + <key>center_freq29</key> + <value>0</value> + </param> + <param> + <key>gain29</key> + <value>0</value> + </param> + <param> + <key>ant29</key> + <value></value> + </param> + <param> + <key>bw29</key> + <value>0</value> </param> <param> - <key>side</key> - <value>side</value> + <key>center_freq30</key> + <value>0</value> </param> <param> - <key>rx_ant</key> - <value>RXA</value> + <key>gain30</key> + <value>0</value> </param> <param> - <key>hb_filters</key> + <key>ant30</key> <value></value> </param> <param> + <key>bw30</key> + <value>0</value> + </param> + <param> + <key>center_freq31</key> + <value>0</value> + </param> + <param> + <key>gain31</key> + <value>0</value> + </param> + <param> + <key>ant31</key> + <value></value> + </param> + <param> + <key>bw31</key> + <value>0</value> + </param> + <param> <key>_coordinate</key> - <value>(89, 689)</value> + <value>(49, 713)</value> </param> <param> <key>_rotation</key> @@ -1027,86 +1238,85 @@ </param> </block> <block> - <key>wxgui_fftsink2</key> + <key>variable_static_text</key> <param> <key>id</key> - <value>rx_fft</value> + <value>addr_text</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>label</key> + <value>USRP Addr</value> </param> <param> - <key>title</key> - <value>RX Spectrum</value> + <key>value</key> + <value>addr</value> </param> <param> - <key>samp_rate</key> - <value>sample_rate</value> + <key>converver</key> + <value>str_converter</value> </param> <param> - <key>baseband_freq</key> - <value>freq</value> + <key>formatter</key> + <value>None</value> </param> <param> - <key>y_per_div</key> - <value>5</value> + <key>grid_pos</key> + <value>1, 0, 1, 1</value> </param> <param> - <key>y_divs</key> - <value>8</value> + <key>notebook</key> + <value></value> </param> <param> - <key>ref_level</key> - <value>-5</value> + <key>_coordinate</key> + <value>(828, 20)</value> </param> <param> - <key>ref_scale</key> - <value>2.0</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>variable_static_text</key> <param> - <key>fft_size</key> - <value>1024</value> + <key>id</key> + <value>rate_text</value> </param> <param> - <key>fft_rate</key> - <value>15</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>peak_hold</key> - <value>False</value> + <key>label</key> + <value>Baseband Rate</value> </param> <param> - <key>average</key> - <value>True</value> + <key>value</key> + <value>sample_rate</value> </param> <param> - <key>avg_alpha</key> - <value>0.1</value> + <key>converver</key> + <value>float_converter</value> </param> <param> - <key>win</key> + <key>formatter</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> + <value>1, 1, 1, 1</value> </param> <param> <key>notebook</key> - <value>displays, 0</value> + <value></value> </param> <param> <key>_coordinate</key> - <value>(477, 457)</value> + <value>(973, 20)</value> </param> <param> <key>_rotation</key> @@ -1114,18 +1324,22 @@ </param> </block> <block> - <key>gr_binary_slicer_fb</key> + <key>import</key> <param> <key>id</key> - <value>gr_binary_slicer_fb_0</value> + <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>(393, 975)</value> + <value>(9, 106)</value> </param> <param> <key>_rotation</key> @@ -1133,18 +1347,65 @@ </param> </block> <block> - <key>noaa_hrpt_deframer</key> + <key>variable</key> <param> <key>id</key> - <value>deframer</value> + <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>(762, 975)</value> + <value>(13, 168)</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.hrpt'</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>(990, 255)</value> </param> <param> <key>_rotation</key> @@ -1155,7 +1416,7 @@ <key>variable_config</key> <param> <key>id</key> - <value>decim</value> + <value>saved_clock_alpha</value> </param> <param> <key>_enabled</key> @@ -1163,7 +1424,7 @@ </param> <param> <key>value</key> - <value>32</value> + <value>0.01</value> </param> <param> <key>type</key> @@ -1179,15 +1440,15 @@ </param> <param> <key>option</key> - <value>'decim'</value> + <value>'clock_alpha'</value> </param> <param> <key>writeback</key> - <value>decim</value> + <value>clock_alpha</value> </param> <param> <key>_coordinate</key> - <value>(351, 255)</value> + <value>(832, 254)</value> </param> <param> <key>_rotation</key> @@ -1230,7 +1491,7 @@ </param> <param> <key>_coordinate</key> - <value>(823, 258)</value> + <value>(674, 254)</value> </param> <param> <key>_rotation</key> @@ -1241,7 +1502,7 @@ <key>variable_config</key> <param> <key>id</key> - <value>saved_clock_alpha</value> + <value>saved_gain</value> </param> <param> <key>_enabled</key> @@ -1249,7 +1510,7 @@ </param> <param> <key>value</key> - <value>0.01</value> + <value>35</value> </param> <param> <key>type</key> @@ -1265,15 +1526,15 @@ </param> <param> <key>option</key> - <value>'clock_alpha'</value> + <value>'gain'</value> </param> <param> <key>writeback</key> - <value>clock_alpha</value> + <value>gain</value> </param> <param> <key>_coordinate</key> - <value>(981, 258)</value> + <value>(515, 255)</value> </param> <param> <key>_rotation</key> @@ -1284,7 +1545,7 @@ <key>variable_config</key> <param> <key>id</key> - <value>output_filename</value> + <value>saved_freq</value> </param> <param> <key>_enabled</key> @@ -1292,11 +1553,11 @@ </param> <param> <key>value</key> - <value>'frames.hrpt'</value> + <value>1698e6</value> </param> <param> <key>type</key> - <value>string</value> + <value>real</value> </param> <param> <key>config_file</key> @@ -1308,15 +1569,275 @@ </param> <param> <key>option</key> - <value>'filename'</value> + <value>'freq'</value> </param> <param> <key>writeback</key> - <value>output_filename</value> + <value>freq</value> + </param> + <param> + <key>_coordinate</key> + <value>(358, 254)</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>4e6</value> </param> <param> <key>_coordinate</key> - <value>(1139, 259)</value> + <value>(198, 17)</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>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> + </param> + <param> + <key>_coordinate</key> + <value>(666, 542)</value> + </param> + <param> + <key>_rotation</key> + <value>180</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>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>(1138, 729)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_clock_recovery_mm_xx</key> + <param> + <key>id</key> + <value>digital_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>(896, 697)</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>digital_binary_slicer_fb</key> + <param> + <key>id</key> + <value>digital_binary_slicer_fb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(423, 975)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>noaa_hrpt_deframer</key> + <param> + <key>id</key> + <value>deframer</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(762, 975)</value> </param> <param> <key>_rotation</key> @@ -1351,22 +1872,34 @@ </param> </block> <block> - <key>variable</key> + <key>gr_file_sink</key> <param> <key>id</key> - <value>max_clock_offset</value> + <value>frame_sink</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>100e-6</value> + <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>unbuffered</key> + <value>False</value> </param> <param> <key>_coordinate</key> - <value>(705, 19)</value> + <value>(973, 1024)</value> </param> <param> <key>_rotation</key> @@ -1374,12 +1907,6 @@ </param> </block> <connection> - <source_block_id>virtual_source_0</source_block_id> - <sink_block_id>gr_binary_slicer_fb_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>deframer</source_block_id> <sink_block_id>frame_sink</sink_block_id> <source_key>0</source_key> @@ -1392,20 +1919,20 @@ <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_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>gr_clock_recovery_mm_xx_0</source_block_id> - <sink_block_id>demod_scope</sink_block_id> + <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_moving_average_xx_0</source_block_id> - <sink_block_id>gr_clock_recovery_mm_xx_0</sink_block_id> + <source_block_id>uhd_usrp_source_0</source_block_id> + <sink_block_id>agc</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> @@ -1416,25 +1943,31 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>agc</source_block_id> - <sink_block_id>pll</sink_block_id> + <source_block_id>gr_moving_average_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>usrp_source</source_block_id> - <sink_block_id>agc</sink_block_id> + <source_block_id>gr_moving_average_xx_0</source_block_id> + <sink_block_id>digital_clock_recovery_mm_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>rx_fft</sink_block_id> + <source_block_id>digital_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>virtual_source_0</source_block_id> + <sink_block_id>digital_binary_slicer_fb_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_binary_slicer_fb_0</source_block_id> + <source_block_id>digital_binary_slicer_fb_0</source_block_id> <sink_block_id>deframer</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> diff --git a/gr-noaa/apps/usrp_rx_hrpt.py b/gr-noaa/apps/usrp_rx_hrpt.py index 48c5f9d29..e603e768e 100755 --- a/gr-noaa/apps/usrp_rx_hrpt.py +++ b/gr-noaa/apps/usrp_rx_hrpt.py @@ -2,19 +2,20 @@ ################################################## # Gnuradio Python Flow Graph # Title: USRP HRPT Receiver -# Generated: Mon Nov 9 07:56:11 2009 +# Generated: Thu Oct 27 13:26:42 2011 ################################################## +from gnuradio import digital from gnuradio import eng_notation from gnuradio import gr from gnuradio import noaa +from gnuradio import uhd 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 usrp as grc_usrp from grc_gnuradio import wxgui as grc_wxgui from optparse import OptionParser import ConfigParser @@ -29,20 +30,10 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): ################################################## # Variables ################################################## - 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_rx_hrpt', 'decim') - except: decim = 32 - self.decim = decim self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 64e6/decim + self.sample_rate = sample_rate = 4e6 + self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' 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_rx_hrpt', 'side') - except: side = 'A' - self.side = side 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') @@ -63,7 +54,12 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): try: saved_clock_alpha = self._saved_clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha') except: saved_clock_alpha = 0.01 self.saved_clock_alpha = saved_clock_alpha - self.side_text = side_text = side + self._addr_config = ConfigParser.ConfigParser() + self._addr_config.read(config_filename) + try: addr = self._addr_config.get('usrp_rx_hrpt', 'addr') + except: addr = "" + self.addr = addr + self.rate_text = rate_text = sample_rate self.pll_alpha = pll_alpha = saved_pll_alpha self._output_filename_config = ConfigParser.ConfigParser() self._output_filename_config.read(config_filename) @@ -75,28 +71,80 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): 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 + self.addr_text = addr_text = addr ################################################## - # Notebooks + # Blocks ################################################## - self.displays = wx.Notebook(self.GetWin(), style=wx.NB_TOP) + 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.displays = 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, 2, 0, 1, 4) - - ################################################## - # Controls - ################################################## - self._side_text_static_text = forms.static_text( + _clock_alpha_sizer = wx.BoxSizer(wx.VERTICAL) + self._clock_alpha_text_box = forms.text_box( parent=self.GetWin(), - value=self.side_text, - callback=self.set_side_text, - label="USRP Side", - converter=forms.str_converter(), + 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) + self.uhd_usrp_source_0 = uhd.usrp_source( + device_addr=addr, + io_type=uhd.io_type.COMPLEX_FLOAT32, + num_channels=1, ) - self.GridAdd(self._side_text_static_text, 1, 0, 1, 1) + self.uhd_usrp_source_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0.set_center_freq(freq, 0) + self.uhd_usrp_source_0.set_gain(0, 0) + self.rx_fft = fftsink2.fft_sink_c( + self.displays.GetPage(0).GetWin(), + baseband_freq=freq, + 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._rate_text_static_text = forms.static_text( + parent=self.GetWin(), + value=self.rate_text, + callback=self.set_rate_text, + label="Baseband Rate", + converter=forms.float_converter(), + ) + self.GridAdd(self._rate_text_static_text, 1, 1, 1, 1) _pll_alpha_sizer = wx.BoxSizer(wx.VERTICAL) self._pll_alpha_text_box = forms.text_box( parent=self.GetWin(), @@ -120,6 +168,8 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): proportion=1, ) self.GridAdd(_pll_alpha_sizer, 0, 2, 1, 1) + self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) + self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) _gain_sizer = wx.BoxSizer(wx.VERTICAL) self._gain_text_box = forms.text_box( parent=self.GetWin(), @@ -143,52 +193,10 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): 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) - _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 - ################################################## - self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - self.decoder = noaa.hrpt_decoder(True,True) - self.deframer = noaa.hrpt_deframer() + self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename) + self.frame_sink.set_unbuffered(False) + self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) + self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() self.demod_scope = scopesink2.scope_sink_f( self.displays.GetPage(1).GetWin(), title="Post-Demod", @@ -199,151 +207,155 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): ac_couple=False, xy_mode=False, num_inputs=1, + trig_mode=gr.gr_TRIG_MODE_AUTO, + y_axis_label="Counts", ) 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.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, - 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.deframer = noaa.hrpt_deframer() + self.decoder = noaa.hrpt_decoder(True,True) + self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) + self._addr_text_static_text = forms.static_text( + parent=self.GetWin(), + value=self.addr_text, + callback=self.set_addr_text, + label="USRP Addr", + converter=forms.str_converter(), ) - self.displays.GetPage(0).GridAdd(self.rx_fft.win, 0, 0, 1, 1) - 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) + self.GridAdd(self._addr_text_static_text, 1, 0, 1, 1) ################################################## # Connections ################################################## - 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.usrp_source, 0), (self.agc, 0)) self.connect((self.agc, 0), (self.rx_fft, 0)) - self.connect((self.gr_binary_slicer_fb_0, 0), (self.deframer, 0)) - - def set_config_filename(self, config_filename): - self.config_filename = config_filename - self._saved_freq_config = ConfigParser.ConfigParser() - self._saved_freq_config.read(self.config_filename) - 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_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._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._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._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')) + self.connect((self.uhd_usrp_source_0, 0), (self.agc, 0)) + self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) + self.connect((self.gr_moving_average_xx_0, 0), (self.demod_scope, 0)) + self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) + self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) + self.connect((self.digital_binary_slicer_fb_0, 0), (self.deframer, 0)) - def set_decim(self, decim): - self.decim = decim - self.set_sample_rate(64e6/self.decim) - self.set_decim_text(self.decim) - self.usrp_source.set_decim_rate(self.decim) - 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')) + def get_sym_rate(self): + return self.sym_rate 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 get_sample_rate(self): + return self.sample_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.rx_fft.set_sample_rate(self.sample_rate) + self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) + self.set_rate_text(self.sample_rate) + + def get_config_filename(self): + return self.config_filename + + def set_config_filename(self, config_filename): + self.config_filename = config_filename + self._addr_config = ConfigParser.ConfigParser() + self._addr_config.read(self.config_filename) + if not self._addr_config.has_section('usrp_rx_hrpt'): + self._addr_config.add_section('usrp_rx_hrpt') + self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) + self._addr_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._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._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_gain_config = ConfigParser.ConfigParser() + self._saved_gain_config.read(self.config_filename) + 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_freq_config = ConfigParser.ConfigParser() + self._saved_freq_config.read(self.config_filename) + 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')) + + def get_sps(self): + return self.sps 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_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.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) + + def get_saved_pll_alpha(self): + return self.saved_pll_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 get_saved_gain(self): + return self.saved_gain + def set_saved_gain(self, saved_gain): self.saved_gain = saved_gain self.set_gain(self.saved_gain) + def get_saved_freq(self): + return self.saved_freq + def set_saved_freq(self, saved_freq): self.saved_freq = saved_freq self.set_freq(self.saved_freq) + def get_saved_clock_alpha(self): + return self.saved_clock_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_text(self, side_text): - self.side_text = side_text - self._side_text_static_text.set_value(self.side_text) + def get_addr(self): + return self.addr + + def set_addr(self, addr): + self.addr = addr + self._addr_config = ConfigParser.ConfigParser() + self._addr_config.read(self.config_filename) + if not self._addr_config.has_section('usrp_rx_hrpt'): + self._addr_config.add_section('usrp_rx_hrpt') + self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) + self._addr_config.write(open(self.config_filename, 'w')) + self.set_addr_text(self.addr) + + def get_rate_text(self): + return self.rate_text + + def set_rate_text(self, rate_text): + self.rate_text = rate_text + self._rate_text_static_text.set_value(self.rate_text) + + def get_pll_alpha(self): + return self.pll_alpha def set_pll_alpha(self, pll_alpha): self.pll_alpha = pll_alpha @@ -358,6 +370,9 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): 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 get_output_filename(self): + return self.output_filename + def set_output_filename(self, output_filename): self.output_filename = output_filename self._output_filename_config = ConfigParser.ConfigParser() @@ -367,17 +382,29 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) self._output_filename_config.write(open(self.config_filename, 'w')) + def get_max_clock_offset(self): + return self.max_clock_offset + def set_max_clock_offset(self, max_clock_offset): self.max_clock_offset = max_clock_offset + def get_max_carrier_offset(self): + return self.max_carrier_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 get_hs(self): + return self.hs + 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 get_gain(self): + return self.gain + def set_gain(self, gain): self.gain = gain self._gain_slider.set_value(self.gain) @@ -388,36 +415,44 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui): 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) + + def get_freq(self): + return self.freq def set_freq(self, freq): self.freq = freq self._freq_text_box.set_value(self.freq) + self.rx_fft.set_baseband_freq(self.freq) + self.uhd_usrp_source_0.set_center_freq(self.freq, 0) self._saved_freq_config = ConfigParser.ConfigParser() self._saved_freq_config.read(self.config_filename) 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) - def set_decim_text(self, decim_text): - self.decim_text = decim_text - self._decim_text_static_text.set_value(self.decim_text) + def get_clock_alpha(self): + return self.clock_alpha 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.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._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.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) + self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) + + def get_addr_text(self): + return self.addr_text + + def set_addr_text(self, addr_text): + self.addr_text = addr_text + self._addr_text_static_text.set_value(self.addr_text) if __name__ == '__main__': parser = OptionParser(option_class=eng_option, usage="%prog: [options]") diff --git a/gr-noaa/apps/usrp_rx_hrpt_nogui.grc b/gr-noaa/apps/usrp_rx_hrpt_nogui.grc index 22bd3bdc3..5936c94c8 100644 --- a/gr-noaa/apps/usrp_rx_hrpt_nogui.grc +++ b/gr-noaa/apps/usrp_rx_hrpt_nogui.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Mon Nov 9 08:03:25 2009</timestamp> + <timestamp>Thu Oct 27 13:48:57 2011</timestamp> <block> <key>options</key> <param> @@ -13,7 +13,7 @@ </param> <param> <key>title</key> - <value></value> + <value>USRP HRPT Receiver</value> </param> <param> <key>author</key> @@ -45,7 +45,7 @@ </param> <param> <key>realtime_scheduling</key> - <value>1</value> + <value></value> </param> <param> <key>_coordinate</key> @@ -152,7 +152,7 @@ <key>variable</key> <param> <key>id</key> - <value>sample_rate</value> + <value>max_clock_offset</value> </param> <param> <key>_enabled</key> @@ -160,11 +160,34 @@ </param> <param> <key>value</key> - <value>64e6/decim</value> + <value>100e-6</value> </param> <param> <key>_coordinate</key> - <value>(198, 17)</value> + <value>(705, 19)</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>(9, 106)</value> </param> <param> <key>_rotation</key> @@ -187,7 +210,7 @@ </param> <param> <key>_coordinate</key> - <value>(13, 162)</value> + <value>(13, 168)</value> </param> <param> <key>_rotation</key> @@ -195,22 +218,22 @@ </param> </block> <block> - <key>import</key> + <key>variable</key> <param> <key>id</key> - <value>import_0</value> + <value>sample_rate</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>import</key> - <value>import math, os</value> + <key>value</key> + <value>4e6</value> </param> <param> <key>_coordinate</key> - <value>(11, 109)</value> + <value>(198, 17)</value> </param> <param> <key>_rotation</key> @@ -221,7 +244,7 @@ <key>variable_config</key> <param> <key>id</key> - <value>gain</value> + <value>clock_alpha</value> </param> <param> <key>_enabled</key> @@ -229,7 +252,7 @@ </param> <param> <key>value</key> - <value>35</value> + <value>0.01</value> </param> <param> <key>type</key> @@ -245,15 +268,15 @@ </param> <param> <key>option</key> - <value>'gain'</value> + <value>'clock_alpha'</value> </param> <param> <key>writeback</key> - <value>gain</value> + <value>clock_alpha</value> </param> <param> <key>_coordinate</key> - <value>(668, 101)</value> + <value>(833, 104)</value> </param> <param> <key>_rotation</key> @@ -264,7 +287,7 @@ <key>variable_config</key> <param> <key>id</key> - <value>freq</value> + <value>pll_alpha</value> </param> <param> <key>_enabled</key> @@ -272,7 +295,7 @@ </param> <param> <key>value</key> - <value>1698e6</value> + <value>0.01</value> </param> <param> <key>type</key> @@ -288,15 +311,15 @@ </param> <param> <key>option</key> - <value>'freq'</value> + <value>'pll_alpha'</value> </param> <param> <key>writeback</key> - <value>freq</value> + <value>pll_alpha</value> </param> <param> <key>_coordinate</key> - <value>(511, 100)</value> + <value>(675, 104)</value> </param> <param> <key>_rotation</key> @@ -307,7 +330,7 @@ <key>variable_config</key> <param> <key>id</key> - <value>side</value> + <value>gain</value> </param> <param> <key>_enabled</key> @@ -315,11 +338,11 @@ </param> <param> <key>value</key> - <value>'A'</value> + <value>35</value> </param> <param> <key>type</key> - <value>string</value> + <value>real</value> </param> <param> <key>config_file</key> @@ -331,15 +354,15 @@ </param> <param> <key>option</key> - <value>'side'</value> + <value>'gain'</value> </param> <param> <key>writeback</key> - <value>side</value> + <value>gain</value> </param> <param> <key>_coordinate</key> - <value>(198, 95)</value> + <value>(516, 105)</value> </param> <param> <key>_rotation</key> @@ -347,38 +370,42 @@ </param> </block> <block> - <key>gr_agc_xx</key> + <key>variable_config</key> <param> <key>id</key> - <value>agc</value> + <value>freq</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> + <key>value</key> + <value>1698e6</value> + </param> + <param> <key>type</key> - <value>complex</value> + <value>real</value> </param> <param> - <key>rate</key> - <value>1e-6</value> + <key>config_file</key> + <value>config_filename</value> </param> <param> - <key>reference</key> - <value>1.0</value> + <key>section</key> + <value>'usrp_rx_hrpt'</value> </param> <param> - <key>gain</key> - <value>1.0</value> + <key>option</key> + <value>'freq'</value> </param> <param> - <key>max_gain</key> - <value>1.0</value> + <key>writeback</key> + <value>freq</value> </param> <param> <key>_coordinate</key> - <value>(339, 434)</value> + <value>(359, 104)</value> </param> <param> <key>_rotation</key> @@ -386,58 +413,42 @@ </param> </block> <block> - <key>usrp_simple_source_x</key> + <key>variable_config</key> <param> <key>id</key> - <value>usrp_source</value> + <value>output_filename</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> + <key>value</key> + <value>'frames.hrpt'</value> </param> <param> - <key>lo_offset</key> - <value>float('inf')</value> + <key>type</key> + <value>string</value> </param> <param> - <key>gain</key> - <value>gain</value> + <key>config_file</key> + <value>config_filename</value> </param> <param> - <key>side</key> - <value>side</value> + <key>section</key> + <value>'usrp_rx_hrpt'</value> </param> <param> - <key>rx_ant</key> - <value>RXA</value> + <key>option</key> + <value>'filename'</value> </param> <param> - <key>hb_filters</key> - <value></value> + <key>writeback</key> + <value>output_filename</value> </param> <param> <key>_coordinate</key> - <value>(127, 418)</value> + <value>(991, 105)</value> </param> <param> <key>_rotation</key> @@ -445,10 +456,10 @@ </param> </block> <block> - <key>gr_clock_recovery_mm_xx</key> + <key>digital_clock_recovery_mm_xx</key> <param> <key>id</key> - <value>gr_clock_recovery_mm_xx_0</value> + <value>digital_clock_recovery_mm_xx_0</value> </param> <param> <key>_enabled</key> @@ -480,7 +491,7 @@ </param> <param> <key>_coordinate</key> - <value>(920, 426)</value> + <value>(897, 341)</value> </param> <param> <key>_rotation</key> @@ -488,34 +499,22 @@ </param> </block> <block> - <key>gr_moving_average_xx</key> + <key>virtual_sink</key> <param> <key>id</key> - <value>gr_moving_average_xx_0</value> + <value>virtual_sink_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> + <key>stream_id</key> + <value>baseband</value> </param> <param> <key>_coordinate</key> - <value>(720, 442)</value> + <value>(1139, 373)</value> </param> <param> <key>_rotation</key> @@ -523,126 +522,622 @@ </param> </block> <block> - <key>noaa_hrpt_pll_cf</key> + <key>uhd_usrp_source</key> <param> <key>id</key> - <value>pll</value> + <value>uhd_usrp_source_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>alpha</key> - <value>pll_alpha</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>beta</key> - <value>pll_alpha**2/4.0</value> + <key>dev_addr</key> + <value>addr</value> </param> <param> - <key>max_offset</key> - <value>max_carrier_offset</value> + <key>sync</key> + <value></value> </param> <param> - <key>_coordinate</key> - <value>(507, 442)</value> + <key>clock_rate</key> + <value>0.0</value> </param> <param> - <key>_rotation</key> + <key>num_mboards</key> + <value>1</value> + </param> + <param> + <key>ref_source0</key> + <value></value> + </param> + <param> + <key>sd_spec0</key> + <value></value> + </param> + <param> + <key>ref_source1</key> + <value></value> + </param> + <param> + <key>sd_spec1</key> + <value></value> + </param> + <param> + <key>ref_source2</key> + <value></value> + </param> + <param> + <key>sd_spec2</key> + <value></value> + </param> + <param> + <key>ref_source3</key> + <value></value> + </param> + <param> + <key>sd_spec3</key> + <value></value> + </param> + <param> + <key>ref_source4</key> + <value></value> + </param> + <param> + <key>sd_spec4</key> + <value></value> + </param> + <param> + <key>ref_source5</key> + <value></value> + </param> + <param> + <key>sd_spec5</key> + <value></value> + </param> + <param> + <key>ref_source6</key> + <value></value> + </param> + <param> + <key>sd_spec6</key> + <value></value> + </param> + <param> + <key>ref_source7</key> + <value></value> + </param> + <param> + <key>sd_spec7</key> + <value></value> + </param> + <param> + <key>nchan</key> + <value>1</value> + </param> + <param> + <key>samp_rate</key> + <value>sample_rate</value> + </param> + <param> + <key>center_freq0</key> + <value>freq</value> + </param> + <param> + <key>gain0</key> <value>0</value> </param> - </block> - <block> - <key>virtual_sink</key> <param> - <key>id</key> - <value>virtual_sink_0</value> + <key>ant0</key> + <value></value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>bw0</key> + <value>0</value> </param> <param> - <key>stream_id</key> - <value>baseband</value> + <key>center_freq1</key> + <value>0</value> </param> <param> - <key>_coordinate</key> - <value>(1180, 457)</value> + <key>gain1</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>ant1</key> + <value></value> + </param> + <param> + <key>bw1</key> <value>0</value> </param> - </block> - <block> - <key>gr_file_sink</key> <param> - <key>id</key> - <value>frame_sink</value> + <key>center_freq2</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>gain2</key> + <value>0</value> </param> <param> - <key>file</key> - <value>output_filename</value> + <key>ant2</key> + <value></value> </param> <param> - <key>type</key> - <value>short</value> + <key>bw2</key> + <value>0</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>center_freq3</key> + <value>0</value> </param> <param> - <key>_coordinate</key> - <value>(1026, 722)</value> + <key>gain3</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>ant3</key> + <value></value> + </param> + <param> + <key>bw3</key> <value>0</value> </param> - </block> - <block> - <key>virtual_source</key> <param> - <key>id</key> - <value>virtual_source_0</value> + <key>center_freq4</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>gain4</key> + <value>0</value> </param> <param> - <key>stream_id</key> - <value>baseband</value> + <key>ant4</key> + <value></value> </param> <param> - <key>_coordinate</key> - <value>(226, 669)</value> + <key>bw4</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>center_freq5</key> <value>0</value> </param> - </block> - <block> - <key>gr_binary_slicer_fb</key> <param> - <key>id</key> - <value>gr_binary_slicer_fb_0</value> + <key>gain5</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ant5</key> + <value></value> + </param> + <param> + <key>bw5</key> + <value>0</value> + </param> + <param> + <key>center_freq6</key> + <value>0</value> + </param> + <param> + <key>gain6</key> + <value>0</value> + </param> + <param> + <key>ant6</key> + <value></value> + </param> + <param> + <key>bw6</key> + <value>0</value> + </param> + <param> + <key>center_freq7</key> + <value>0</value> + </param> + <param> + <key>gain7</key> + <value>0</value> + </param> + <param> + <key>ant7</key> + <value></value> + </param> + <param> + <key>bw7</key> + <value>0</value> + </param> + <param> + <key>center_freq8</key> + <value>0</value> + </param> + <param> + <key>gain8</key> + <value>0</value> + </param> + <param> + <key>ant8</key> + <value></value> + </param> + <param> + <key>bw8</key> + <value>0</value> + </param> + <param> + <key>center_freq9</key> + <value>0</value> + </param> + <param> + <key>gain9</key> + <value>0</value> + </param> + <param> + <key>ant9</key> + <value></value> + </param> + <param> + <key>bw9</key> + <value>0</value> + </param> + <param> + <key>center_freq10</key> + <value>0</value> + </param> + <param> + <key>gain10</key> + <value>0</value> + </param> + <param> + <key>ant10</key> + <value></value> + </param> + <param> + <key>bw10</key> + <value>0</value> + </param> + <param> + <key>center_freq11</key> + <value>0</value> + </param> + <param> + <key>gain11</key> + <value>0</value> + </param> + <param> + <key>ant11</key> + <value></value> + </param> + <param> + <key>bw11</key> + <value>0</value> + </param> + <param> + <key>center_freq12</key> + <value>0</value> + </param> + <param> + <key>gain12</key> + <value>0</value> + </param> + <param> + <key>ant12</key> + <value></value> + </param> + <param> + <key>bw12</key> + <value>0</value> + </param> + <param> + <key>center_freq13</key> + <value>0</value> + </param> + <param> + <key>gain13</key> + <value>0</value> + </param> + <param> + <key>ant13</key> + <value></value> + </param> + <param> + <key>bw13</key> + <value>0</value> + </param> + <param> + <key>center_freq14</key> + <value>0</value> + </param> + <param> + <key>gain14</key> + <value>0</value> + </param> + <param> + <key>ant14</key> + <value></value> + </param> + <param> + <key>bw14</key> + <value>0</value> + </param> + <param> + <key>center_freq15</key> + <value>0</value> + </param> + <param> + <key>gain15</key> + <value>0</value> + </param> + <param> + <key>ant15</key> + <value></value> + </param> + <param> + <key>bw15</key> + <value>0</value> + </param> + <param> + <key>center_freq16</key> + <value>0</value> + </param> + <param> + <key>gain16</key> + <value>0</value> + </param> + <param> + <key>ant16</key> + <value></value> + </param> + <param> + <key>bw16</key> + <value>0</value> + </param> + <param> + <key>center_freq17</key> + <value>0</value> + </param> + <param> + <key>gain17</key> + <value>0</value> + </param> + <param> + <key>ant17</key> + <value></value> + </param> + <param> + <key>bw17</key> + <value>0</value> + </param> + <param> + <key>center_freq18</key> + <value>0</value> + </param> + <param> + <key>gain18</key> + <value>0</value> + </param> + <param> + <key>ant18</key> + <value></value> + </param> + <param> + <key>bw18</key> + <value>0</value> + </param> + <param> + <key>center_freq19</key> + <value>0</value> + </param> + <param> + <key>gain19</key> + <value>0</value> + </param> + <param> + <key>ant19</key> + <value></value> + </param> + <param> + <key>bw19</key> + <value>0</value> + </param> + <param> + <key>center_freq20</key> + <value>0</value> + </param> + <param> + <key>gain20</key> + <value>0</value> + </param> + <param> + <key>ant20</key> + <value></value> + </param> + <param> + <key>bw20</key> + <value>0</value> + </param> + <param> + <key>center_freq21</key> + <value>0</value> + </param> + <param> + <key>gain21</key> + <value>0</value> + </param> + <param> + <key>ant21</key> + <value></value> + </param> + <param> + <key>bw21</key> + <value>0</value> + </param> + <param> + <key>center_freq22</key> + <value>0</value> + </param> + <param> + <key>gain22</key> + <value>0</value> + </param> + <param> + <key>ant22</key> + <value></value> + </param> + <param> + <key>bw22</key> + <value>0</value> + </param> + <param> + <key>center_freq23</key> + <value>0</value> + </param> + <param> + <key>gain23</key> + <value>0</value> + </param> + <param> + <key>ant23</key> + <value></value> + </param> + <param> + <key>bw23</key> + <value>0</value> + </param> + <param> + <key>center_freq24</key> + <value>0</value> + </param> + <param> + <key>gain24</key> + <value>0</value> + </param> + <param> + <key>ant24</key> + <value></value> + </param> + <param> + <key>bw24</key> + <value>0</value> + </param> + <param> + <key>center_freq25</key> + <value>0</value> + </param> + <param> + <key>gain25</key> + <value>0</value> + </param> + <param> + <key>ant25</key> + <value></value> + </param> + <param> + <key>bw25</key> + <value>0</value> + </param> + <param> + <key>center_freq26</key> + <value>0</value> + </param> + <param> + <key>gain26</key> + <value>0</value> + </param> + <param> + <key>ant26</key> + <value></value> + </param> + <param> + <key>bw26</key> + <value>0</value> + </param> + <param> + <key>center_freq27</key> + <value>0</value> + </param> + <param> + <key>gain27</key> + <value>0</value> + </param> + <param> + <key>ant27</key> + <value></value> + </param> + <param> + <key>bw27</key> + <value>0</value> + </param> + <param> + <key>center_freq28</key> + <value>0</value> + </param> + <param> + <key>gain28</key> + <value>0</value> + </param> + <param> + <key>ant28</key> + <value></value> + </param> + <param> + <key>bw28</key> + <value>0</value> + </param> + <param> + <key>center_freq29</key> + <value>0</value> + </param> + <param> + <key>gain29</key> + <value>0</value> + </param> + <param> + <key>ant29</key> + <value></value> + </param> + <param> + <key>bw29</key> + <value>0</value> + </param> + <param> + <key>center_freq30</key> + <value>0</value> + </param> + <param> + <key>gain30</key> + <value>0</value> + </param> + <param> + <key>ant30</key> + <value></value> + </param> + <param> + <key>bw30</key> + <value>0</value> + </param> + <param> + <key>center_freq31</key> + <value>0</value> + </param> + <param> + <key>gain31</key> + <value>0</value> + </param> + <param> + <key>ant31</key> + <value></value> + </param> + <param> + <key>bw31</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(446, 673)</value> + <value>(50, 357)</value> </param> <param> <key>_rotation</key> @@ -650,18 +1145,30 @@ </param> </block> <block> - <key>noaa_hrpt_deframer</key> + <key>noaa_hrpt_pll_cf</key> <param> <key>id</key> - <value>deframer</value> + <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>(815, 673)</value> + <value>(470, 357)</value> </param> <param> <key>_rotation</key> @@ -669,42 +1176,38 @@ </param> </block> <block> - <key>variable_config</key> + <key>gr_agc_xx</key> <param> <key>id</key> - <value>decim</value> + <value>agc</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>32</value> - </param> - <param> <key>type</key> - <value>real</value> + <value>complex</value> </param> <param> - <key>config_file</key> - <value>config_filename</value> + <key>rate</key> + <value>1e-6</value> </param> <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> + <key>reference</key> + <value>1.0</value> </param> <param> - <key>option</key> - <value>'decim'</value> + <key>gain</key> + <value>1.0</value> </param> <param> - <key>writeback</key> - <value>decim</value> + <key>max_gain</key> + <value>1.0</value> </param> <param> <key>_coordinate</key> - <value>(355, 97)</value> + <value>(302, 349)</value> </param> <param> <key>_rotation</key> @@ -712,42 +1215,34 @@ </param> </block> <block> - <key>variable_config</key> + <key>gr_moving_average_xx</key> <param> <key>id</key> - <value>pll_alpha</value> + <value>gr_moving_average_xx_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>0.01</value> - </param> - <param> <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> + <value>float</value> </param> <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> + <key>length</key> + <value>hs</value> </param> <param> - <key>option</key> - <value>'pll_alpha'</value> + <key>scale</key> + <value>1.0/hs</value> </param> <param> - <key>writeback</key> - <value>pll_alpha</value> + <key>max_iter</key> + <value>4000</value> </param> <param> <key>_coordinate</key> - <value>(827, 100)</value> + <value>(683, 357)</value> </param> <param> <key>_rotation</key> @@ -755,42 +1250,34 @@ </param> </block> <block> - <key>variable_config</key> + <key>gr_file_sink</key> <param> <key>id</key> - <value>clock_alpha</value> + <value>frame_sink</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>0.01</value> + <key>file</key> + <value>output_filename</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> + <value>short</value> </param> <param> - <key>option</key> - <value>'clock_alpha'</value> + <key>vlen</key> + <value>1</value> </param> <param> - <key>writeback</key> - <value>clock_alpha</value> + <key>unbuffered</key> + <value>False</value> </param> <param> <key>_coordinate</key> - <value>(986, 101)</value> + <value>(809, 595)</value> </param> <param> <key>_rotation</key> @@ -798,42 +1285,37 @@ </param> </block> <block> - <key>variable_config</key> + <key>noaa_hrpt_deframer</key> <param> <key>id</key> - <value>output_filename</value> + <value>deframer</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>'frames.hrpt'</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> + <key>_coordinate</key> + <value>(598, 546)</value> </param> <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>digital_binary_slicer_fb</key> <param> - <key>option</key> - <value>'filename'</value> + <key>id</key> + <value>digital_binary_slicer_fb_0</value> </param> <param> - <key>writeback</key> - <value>output_filename</value> + <key>_enabled</key> + <value>True</value> </param> <param> <key>_coordinate</key> - <value>(1143, 101)</value> + <value>(259, 546)</value> </param> <param> <key>_rotation</key> @@ -841,22 +1323,22 @@ </param> </block> <block> - <key>variable</key> + <key>virtual_source</key> <param> <key>id</key> - <value>max_clock_offset</value> + <value>virtual_source_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>100e-6</value> + <key>stream_id</key> + <value>baseband</value> </param> <param> <key>_coordinate</key> - <value>(705, 19)</value> + <value>(40, 542)</value> </param> <param> <key>_rotation</key> @@ -883,7 +1365,50 @@ </param> <param> <key>_coordinate</key> - <value>(1027, 623)</value> + <value>(810, 496)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_config</key> + <param> + <key>id</key> + <value>addr</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>""</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>'addr'</value> + </param> + <param> + <key>writeback</key> + <value>addr</value> + </param> + <param> + <key>_coordinate</key> + <value>(195, 103)</value> </param> <param> <key>_rotation</key> @@ -891,14 +1416,14 @@ </param> </block> <connection> - <source_block_id>usrp_source</source_block_id> - <sink_block_id>agc</sink_block_id> + <source_block_id>digital_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>agc</source_block_id> - <sink_block_id>pll</sink_block_id> + <source_block_id>gr_moving_average_xx_0</source_block_id> + <sink_block_id>digital_clock_recovery_mm_xx_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> @@ -909,26 +1434,26 @@ <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_block_id>uhd_usrp_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>gr_clock_recovery_mm_xx_0</source_block_id> - <sink_block_id>virtual_sink_0</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>virtual_source_0</source_block_id> - <sink_block_id>gr_binary_slicer_fb_0</sink_block_id> + <source_block_id>digital_binary_slicer_fb_0</source_block_id> + <sink_block_id>deframer</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>deframer</source_block_id> - <sink_block_id>frame_sink</sink_block_id> + <source_block_id>virtual_source_0</source_block_id> + <sink_block_id>digital_binary_slicer_fb_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> @@ -939,8 +1464,8 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_binary_slicer_fb_0</source_block_id> - <sink_block_id>deframer</sink_block_id> + <source_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> diff --git a/gr-noaa/apps/usrp_rx_hrpt_nogui.py b/gr-noaa/apps/usrp_rx_hrpt_nogui.py index 1b510bdb2..4fc5642ff 100755 --- a/gr-noaa/apps/usrp_rx_hrpt_nogui.py +++ b/gr-noaa/apps/usrp_rx_hrpt_nogui.py @@ -1,16 +1,17 @@ #!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph -# Title: Usrp Rx Hrpt Nogui -# Generated: Mon Nov 9 08:03:25 2009 +# Title: USRP HRPT Receiver +# Generated: Thu Oct 27 13:49:01 2011 ################################################## +from gnuradio import digital from gnuradio import eng_notation from gnuradio import gr from gnuradio import noaa +from gnuradio import uhd from gnuradio.eng_option import eng_option from gnuradio.gr import firdes -from grc_gnuradio import usrp as grc_usrp from optparse import OptionParser import ConfigParser import math, os @@ -18,25 +19,15 @@ import math, os class usrp_rx_hrpt_nogui(gr.top_block): def __init__(self): - gr.top_block.__init__(self, "Usrp Rx Hrpt Nogui") + gr.top_block.__init__(self, "USRP HRPT Receiver") ################################################## # Variables ################################################## - 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_rx_hrpt', 'decim') - except: decim = 32 - self.decim = decim self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 64e6/decim + self.sample_rate = sample_rate = 4e6 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_rx_hrpt', 'side') - except: side = 'A' - self.side = side + self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' self._pll_alpha_config = ConfigParser.ConfigParser() self._pll_alpha_config.read(config_filename) try: pll_alpha = self._pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha') @@ -65,37 +56,86 @@ class usrp_rx_hrpt_nogui(gr.top_block): try: clock_alpha = self._clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha') except: clock_alpha = 0.01 self.clock_alpha = clock_alpha + self._addr_config = ConfigParser.ConfigParser() + self._addr_config.read(config_filename) + try: addr = self._addr_config.get('usrp_rx_hrpt', 'addr') + except: addr = "" + self.addr = addr ################################################## # Blocks ################################################## - self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - self.decoder = noaa.hrpt_decoder(True,True) - self.deframer = noaa.hrpt_deframer() - 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.uhd_usrp_source_0 = uhd.usrp_source( + device_addr=addr, + io_type=uhd.io_type.COMPLEX_FLOAT32, + num_channels=1, + ) + self.uhd_usrp_source_0.set_samp_rate(sample_rate) + self.uhd_usrp_source_0.set_center_freq(freq, 0) + self.uhd_usrp_source_0.set_gain(0, 0) self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) - self.usrp_source = grc_usrp.simple_source_c(which=0, side=side, rx_ant="RXA") - self.usrp_source.set_decim_rate(decim) - self.usrp_source.set_frequency(freq, verbose=True) - self.usrp_source.set_gain(gain) + self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) + self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename) + self.frame_sink.set_unbuffered(False) + self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) + self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() + self.deframer = noaa.hrpt_deframer() + self.decoder = noaa.hrpt_decoder(True,True) + self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) ################################################## # Connections ################################################## - self.connect((self.usrp_source, 0), (self.agc, 0)) - self.connect((self.agc, 0), (self.pll, 0)) + self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 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.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.uhd_usrp_source_0, 0), (self.agc, 0)) + self.connect((self.agc, 0), (self.pll, 0)) + self.connect((self.digital_binary_slicer_fb_0, 0), (self.deframer, 0)) + self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) self.connect((self.deframer, 0), (self.decoder, 0)) - self.connect((self.gr_binary_slicer_fb_0, 0), (self.deframer, 0)) + self.connect((self.deframer, 0), (self.frame_sink, 0)) + + def get_sym_rate(self): + return self.sym_rate + + def set_sym_rate(self, sym_rate): + self.sym_rate = sym_rate + self.set_sps(self.sample_rate/self.sym_rate) + + def get_sample_rate(self): + return self.sample_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.uhd_usrp_source_0.set_samp_rate(self.sample_rate) + + def get_sps(self): + return self.sps + + def set_sps(self, sps): + self.sps = sps + self.set_hs(int(self.sps/2.0)) + self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) + + def get_config_filename(self): + return self.config_filename def set_config_filename(self, config_filename): self.config_filename = config_filename + 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._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._gain_config = ConfigParser.ConfigParser() self._gain_config.read(self.config_filename) if not self._gain_config.has_section('usrp_rx_hrpt'): @@ -108,81 +148,35 @@ class usrp_rx_hrpt_nogui(gr.top_block): 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._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._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._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._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._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._addr_config = ConfigParser.ConfigParser() + self._addr_config.read(self.config_filename) + if not self._addr_config.has_section('usrp_rx_hrpt'): + self._addr_config.add_section('usrp_rx_hrpt') + self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) + self._addr_config.write(open(self.config_filename, 'w')) - def set_decim(self, decim): - self.decim = decim - self.set_sample_rate(64e6/self.decim) - self.usrp_source.set_decim_rate(self.decim) - 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')) - - 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) - - 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._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 get_pll_alpha(self): + return self.pll_alpha 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_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.pll.set_alpha(self.pll_alpha) + self.pll.set_beta(self.pll_alpha**2/4.0) + + def get_output_filename(self): + return self.output_filename def set_output_filename(self, output_filename): self.output_filename = output_filename @@ -193,17 +187,29 @@ class usrp_rx_hrpt_nogui(gr.top_block): self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) self._output_filename_config.write(open(self.config_filename, 'w')) + def get_max_clock_offset(self): + return self.max_clock_offset + def set_max_clock_offset(self, max_clock_offset): self.max_clock_offset = max_clock_offset + def get_max_carrier_offset(self): + return self.max_carrier_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 get_hs(self): + return self.hs + 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 get_gain(self): + return self.gain + def set_gain(self, gain): self.gain = gain self._gain_config = ConfigParser.ConfigParser() @@ -212,7 +218,9 @@ class usrp_rx_hrpt_nogui(gr.top_block): 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) + + def get_freq(self): + return self.freq def set_freq(self, freq): self.freq = freq @@ -222,24 +230,37 @@ class usrp_rx_hrpt_nogui(gr.top_block): 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) + self.uhd_usrp_source_0.set_center_freq(self.freq, 0) + + def get_clock_alpha(self): + return self.clock_alpha 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_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.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) + self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) + + def get_addr(self): + return self.addr + + def set_addr(self, addr): + self.addr = addr + self._addr_config = ConfigParser.ConfigParser() + self._addr_config.read(self.config_filename) + if not self._addr_config.has_section('usrp_rx_hrpt'): + self._addr_config.add_section('usrp_rx_hrpt') + self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) + self._addr_config.write(open(self.config_filename, 'w')) 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_hrpt_nogui() tb.start() raw_input('Press Enter to quit: ') diff --git a/gr-noaa/apps/usrp_rx_lrit.grc b/gr-noaa/apps/usrp_rx_lrit.grc deleted file mode 100644 index aca10039a..000000000 --- a/gr-noaa/apps/usrp_rx_lrit.grc +++ /dev/null @@ -1,1825 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Wed Dec 16 09:47:16 2009</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>usrp_rx_lrit</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value>USRP LRIT Receiver</value> - </param> - <param> - <key>author</key> - <value></value> - </param> - <param> - <key>description</key> - <value></value> - </param> - <param> - <key>window_size</key> - <value>4095, 4095</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>prompt</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>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>(245, 9)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>symbol_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>293e3</value> - </param> - <param> - <key>_coordinate</key> - <value>(351, 9)</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/symbol_rate</value> - </param> - <param> - <key>_coordinate</key> - <value>(456, 9)</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 os</value> - </param> - <param> - <key>_coordinate</key> - <value>(9, 83)</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>(10, 142)</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>(247, 149)</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>1691e6</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_lrit'</value> - </param> - <param> - <key>option</key> - <value>'freq'</value> - </param> - <param> - <key>writeback</key> - <value>freq</value> - </param> - <param> - <key>_coordinate</key> - <value>(246, 299)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0</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_lrit'</value> - </param> - <param> - <key>option</key> - <value>'offset'</value> - </param> - <param> - <key>writeback</key> - <value>offset</value> - </param> - <param> - <key>_coordinate</key> - <value>(406, 300)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_slider</key> - <param> - <key>id</key> - <value>offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Offset</value> - </param> - <param> - <key>value</key> - <value>saved_offset</value> - </param> - <param> - <key>min</key> - <value>-50e3</value> - </param> - <param> - <key>max</key> - <value>50e3</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>(390, 149)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_slider</key> - <param> - <key>id</key> - <value>costas_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Costas Alpha</value> - </param> - <param> - <key>value</key> - <value>saved_costas_alpha</value> - </param> - <param> - <key>min</key> - <value>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>1, 1, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(813, 152)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_slider</key> - <param> - <key>id</key> - <value>gain_mu</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Gain Mu</value> - </param> - <param> - <key>value</key> - <value>saved_gain_mu</value> - </param> - <param> - <key>min</key> - <value>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>1, 2, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(957, 151)</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>33</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_lrit'</value> - </param> - <param> - <key>option</key> - <value>'gain'</value> - </param> - <param> - <key>writeback</key> - <value>gain</value> - </param> - <param> - <key>_coordinate</key> - <value>(565, 300)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_decim</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>160</value> - </param> - <param> - <key>type</key> - <value>int</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_lrit'</value> - </param> - <param> - <key>option</key> - <value>'decim'</value> - </param> - <param> - <key>writeback</key> - <value>decim</value> - </param> - <param> - <key>_coordinate</key> - <value>(725, 300)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_text_box</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>saved_decim</value> - </param> - <param> - <key>converver</key> - <value>int_converter</value> - </param> - <param> - <key>formatter</key> - <value>None</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>(672, 151)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_costas_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.005</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_lrit'</value> - </param> - <param> - <key>option</key> - <value>'costas_alpha'</value> - </param> - <param> - <key>writeback</key> - <value>costas_alpha</value> - </param> - <param> - <key>_coordinate</key> - <value>(885, 298)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_gain_mu</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.005</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_lrit'</value> - </param> - <param> - <key>option</key> - <value>'gain_mu'</value> - </param> - <param> - <key>writeback</key> - <value>gain_mu</value> - </param> - <param> - <key>_coordinate</key> - <value>(1046, 298)</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_lrit'</value> - </param> - <param> - <key>option</key> - <value>'side'</value> - </param> - <param> - <key>writeback</key> - <value>side</value> - </param> - <param> - <key>_coordinate</key> - <value>(1102, 152)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_agc_xx</key> - <param> - <key>id</key> - <value>gr_agc_xx_0</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/32767.0</value> - </param> - <param> - <key>max_gain</key> - <value>1.0</value> - </param> - <param> - <key>_coordinate</key> - <value>(286, 729)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_scopesink2</key> - <param> - <key>id</key> - <value>rx_waveform</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>RX Waveform</value> - </param> - <param> - <key>samp_rate</key> - <value>sample_rate</value> - </param> - <param> - <key>v_scale</key> - <value>0</value> - </param> - <param> - <key>v_offset</key> - <value>0</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>win_size</key> - <value></value> - </param> - <param> - <key>grid_pos</key> - <value>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 0</value> - </param> - <param> - <key>_coordinate</key> - <value>(281, 862)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>rx_spectrum</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>freq</value> - </param> - <param> - <key>y_per_div</key> - <value>10</value> - </param> - <param> - <key>y_divs</key> - <value>10</value> - </param> - <param> - <key>ref_level</key> - <value>50</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>30</value> - </param> - <param> - <key>peak_hold</key> - <value>False</value> - </param> - <param> - <key>average</key> - <value>False</value> - </param> - <param> - <key>avg_alpha</key> - <value>0</value> - </param> - <param> - <key>win</key> - <value>None</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, 0</value> - </param> - <param> - <key>_coordinate</key> - <value>(280, 468)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>root_raised_cosine_filter</key> - <param> - <key>id</key> - <value>root_raised_cosine_filter_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>fir_filter_ccf</value> - </param> - <param> - <key>decim</key> - <value>1</value> - </param> - <param> - <key>interp</key> - <value>1</value> - </param> - <param> - <key>gain</key> - <value>1</value> - </param> - <param> - <key>samp_rate</key> - <value>sample_rate</value> - </param> - <param> - <key>sym_rate</key> - <value>symbol_rate</value> - </param> - <param> - <key>alpha</key> - <value>0.25</value> - </param> - <param> - <key>ntaps</key> - <value>int(11*sample_rate/symbol_rate)</value> - </param> - <param> - <key>_coordinate</key> - <value>(472, 713)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_scopesink2</key> - <param> - <key>id</key> - <value>rrc_waveform</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>RRC 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>v_offset</key> - <value>0</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>win_size</key> - <value></value> - </param> - <param> - <key>grid_pos</key> - <value>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 1</value> - </param> - <param> - <key>_coordinate</key> - <value>(768, 866)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>rrc_spectrum</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>RRC Spectrum</value> - </param> - <param> - <key>samp_rate</key> - <value>sample_rate</value> - </param> - <param> - <key>baseband_freq</key> - <value>freq+offset</value> - </param> - <param> - <key>y_per_div</key> - <value>10</value> - </param> - <param> - <key>y_divs</key> - <value>10</value> - </param> - <param> - <key>ref_level</key> - <value>-15</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>False</value> - </param> - <param> - <key>avg_alpha</key> - <value>0</value> - </param> - <param> - <key>win</key> - <value>None</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>(767, 499)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_costas_loop_cc</key> - <param> - <key>id</key> - <value>costas</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alpha</key> - <value>costas_alpha</value> - </param> - <param> - <key>beta</key> - <value>(costas_alpha**2.0)/4.0</value> - </param> - <param> - <key>max_freq</key> - <value>50e-6*sps</value> - </param> - <param> - <key>min_freq</key> - <value>-50e-6*sps</value> - </param> - <param> - <key>order</key> - <value>2</value> - </param> - <param> - <key>_coordinate</key> - <value>(767, 721)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>costas_spectrum</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>PLL Spectrum</value> - </param> - <param> - <key>samp_rate</key> - <value>sample_rate</value> - </param> - <param> - <key>baseband_freq</key> - <value>freq+offset</value> - </param> - <param> - <key>y_per_div</key> - <value>10</value> - </param> - <param> - <key>y_divs</key> - <value>10</value> - </param> - <param> - <key>ref_level</key> - <value>-15</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>False</value> - </param> - <param> - <key>avg_alpha</key> - <value>0</value> - </param> - <param> - <key>win</key> - <value>None</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, 2</value> - </param> - <param> - <key>_coordinate</key> - <value>(969, 502)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>mm_spectrum</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>Bit Sync Spectrum</value> - </param> - <param> - <key>samp_rate</key> - <value>symbol_rate</value> - </param> - <param> - <key>baseband_freq</key> - <value>0</value> - </param> - <param> - <key>y_per_div</key> - <value>10</value> - </param> - <param> - <key>y_divs</key> - <value>10</value> - </param> - <param> - <key>ref_level</key> - <value>-15</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>False</value> - </param> - <param> - <key>avg_alpha</key> - <value>0</value> - </param> - <param> - <key>win</key> - <value>None</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, 3</value> - </param> - <param> - <key>_coordinate</key> - <value>(1225, 503)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_scopesink2</key> - <param> - <key>id</key> - <value>costas_waveform</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>PLL 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>v_offset</key> - <value>0</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>win_size</key> - <value></value> - </param> - <param> - <key>grid_pos</key> - <value>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 2</value> - </param> - <param> - <key>_coordinate</key> - <value>(968, 852)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_clock_recovery_mm_xx</key> - <param> - <key>id</key> - <value>mm_sync</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>omega</key> - <value>sps</value> - </param> - <param> - <key>gain_omega</key> - <value>(gain_mu**2)/4.0</value> - </param> - <param> - <key>mu</key> - <value>0.5</value> - </param> - <param> - <key>gain_mu</key> - <value>gain_mu</value> - </param> - <param> - <key>omega_relative_limit</key> - <value>50e-6*sps</value> - </param> - <param> - <key>_coordinate</key> - <value>(969, 722)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_scopesink2</key> - <param> - <key>id</key> - <value>mm_const</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>Constellation</value> - </param> - <param> - <key>samp_rate</key> - <value>symbol_rate</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>20.0/symbol_rate</value> - </param> - <param> - <key>ac_couple</key> - <value>False</value> - </param> - <param> - <key>xy_mode</key> - <value>True</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>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 3</value> - </param> - <param> - <key>_coordinate</key> - <value>(1225, 859)</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>['USRP RX','RRC','PLL','Const']</value> - </param> - <param> - <key>grid_pos</key> - <value>2, 0, 1, 3</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 228)</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>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>115</value> - </param> - <param> - <key>num_steps</key> - <value>115</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>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(532, 150)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>False</value> - </param> - <param> - <key>type</key> - <value>complex</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>(63, 859)</value> - </param> - <param> - <key>_rotation</key> - <value>0</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>False</value> - </param> - <param> - <key>file</key> - <value>lrit.dat</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>repeat</key> - <value>False</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(36, 943)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>usrp_simple_source_x</key> - <param> - <key>id</key> - <value>usrp_simple_source_x_0</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+offset</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>(19, 713)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>gr_agc_xx_0</source_block_id> - <sink_block_id>root_raised_cosine_filter_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>gr_agc_xx_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>gr_throttle_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>usrp_simple_source_x_0</source_block_id> - <sink_block_id>gr_agc_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>usrp_simple_source_x_0</source_block_id> - <sink_block_id>rx_spectrum</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>rx_spectrum</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>usrp_simple_source_x_0</source_block_id> - <sink_block_id>rx_waveform</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>rx_waveform</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>root_raised_cosine_filter_0</source_block_id> - <sink_block_id>rrc_waveform</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>root_raised_cosine_filter_0</source_block_id> - <sink_block_id>rrc_spectrum</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>root_raised_cosine_filter_0</source_block_id> - <sink_block_id>costas</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>costas</source_block_id> - <sink_block_id>costas_spectrum</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>costas</source_block_id> - <sink_block_id>costas_waveform</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>costas</source_block_id> - <sink_block_id>mm_sync</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>mm_sync</source_block_id> - <sink_block_id>mm_spectrum</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>mm_sync</source_block_id> - <sink_block_id>mm_const</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-noaa/apps/usrp_rx_lrit.py b/gr-noaa/apps/usrp_rx_lrit.py deleted file mode 100755 index 9a3d70200..000000000 --- a/gr-noaa/apps/usrp_rx_lrit.py +++ /dev/null @@ -1,523 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: USRP LRIT Receiver -# Generated: Wed Dec 16 09:49:15 2009 -################################################## - -from gnuradio import eng_notation -from gnuradio import gr -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 usrp as grc_usrp -from grc_gnuradio import wxgui as grc_wxgui -from optparse import OptionParser -import ConfigParser -import os -import wx - -class usrp_rx_lrit(grc_wxgui.top_block_gui): - - def __init__(self): - grc_wxgui.top_block_gui.__init__(self, title="USRP LRIT Receiver") - - ################################################## - # Variables - ################################################## - self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' - self._saved_decim_config = ConfigParser.ConfigParser() - self._saved_decim_config.read(config_filename) - try: saved_decim = self._saved_decim_config.getint('usrp_rx_lrit', 'decim') - except: saved_decim = 160 - self.saved_decim = saved_decim - self.decim = decim = saved_decim - self.symbol_rate = symbol_rate = 293e3 - self._saved_offset_config = ConfigParser.ConfigParser() - self._saved_offset_config.read(config_filename) - try: saved_offset = self._saved_offset_config.getfloat('usrp_rx_lrit', 'offset') - except: saved_offset = 0 - self.saved_offset = saved_offset - self._saved_gain_mu_config = ConfigParser.ConfigParser() - self._saved_gain_mu_config.read(config_filename) - try: saved_gain_mu = self._saved_gain_mu_config.getfloat('usrp_rx_lrit', 'gain_mu') - except: saved_gain_mu = 0.005 - self.saved_gain_mu = saved_gain_mu - self._saved_gain_config = ConfigParser.ConfigParser() - self._saved_gain_config.read(config_filename) - try: saved_gain = self._saved_gain_config.getfloat('usrp_rx_lrit', 'gain') - except: saved_gain = 33 - 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_rx_lrit', 'freq') - except: saved_freq = 1691e6 - self.saved_freq = saved_freq - self._saved_costas_alpha_config = ConfigParser.ConfigParser() - self._saved_costas_alpha_config.read(config_filename) - try: saved_costas_alpha = self._saved_costas_alpha_config.getfloat('usrp_rx_lrit', 'costas_alpha') - except: saved_costas_alpha = 0.005 - self.saved_costas_alpha = saved_costas_alpha - self.sample_rate = sample_rate = 64e6/decim - self.sps = sps = sample_rate/symbol_rate - self._side_config = ConfigParser.ConfigParser() - self._side_config.read(config_filename) - try: side = self._side_config.get('usrp_rx_lrit', 'side') - except: side = 'A' - self.side = side - self.offset = offset = saved_offset - self.gain_mu = gain_mu = saved_gain_mu - self.gain = gain = saved_gain - self.freq = freq = saved_freq - self.costas_alpha = costas_alpha = saved_costas_alpha - - ################################################## - # Notebooks - ################################################## - self.displays = wx.Notebook(self.GetWin(), style=wx.NB_TOP) - self.displays.AddPage(grc_wxgui.Panel(self.displays), "USRP RX") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "RRC") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "PLL") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "Const") - self.GridAdd(self.displays, 2, 0, 1, 3) - - ################################################## - # Controls - ################################################## - self._decim_text_box = forms.text_box( - parent=self.GetWin(), - value=self.decim, - callback=self.set_decim, - label="Decim", - converter=forms.int_converter(), - ) - self.GridAdd(self._decim_text_box, 0, 2, 1, 1) - _offset_sizer = wx.BoxSizer(wx.VERTICAL) - self._offset_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_offset_sizer, - value=self.offset, - callback=self.set_offset, - label="Offset", - converter=forms.float_converter(), - proportion=0, - ) - self._offset_slider = forms.slider( - parent=self.GetWin(), - sizer=_offset_sizer, - value=self.offset, - callback=self.set_offset, - minimum=-50e3, - maximum=50e3, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_offset_sizer, 0, 1, 1, 1) - _gain_mu_sizer = wx.BoxSizer(wx.VERTICAL) - self._gain_mu_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_gain_mu_sizer, - value=self.gain_mu, - callback=self.set_gain_mu, - label="Gain Mu", - converter=forms.float_converter(), - proportion=0, - ) - self._gain_mu_slider = forms.slider( - parent=self.GetWin(), - sizer=_gain_mu_sizer, - value=self.gain_mu, - callback=self.set_gain_mu, - minimum=0, - maximum=0.5, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_gain_mu_sizer, 1, 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="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=115, - num_steps=115, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_gain_sizer, 1, 0, 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) - _costas_alpha_sizer = wx.BoxSizer(wx.VERTICAL) - self._costas_alpha_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_costas_alpha_sizer, - value=self.costas_alpha, - callback=self.set_costas_alpha, - label="Costas Alpha", - converter=forms.float_converter(), - proportion=0, - ) - self._costas_alpha_slider = forms.slider( - parent=self.GetWin(), - sizer=_costas_alpha_sizer, - value=self.costas_alpha, - callback=self.set_costas_alpha, - minimum=0, - maximum=0.5, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_costas_alpha_sizer, 1, 1, 1, 1) - - ################################################## - # Blocks - ################################################## - self.costas = gr.costas_loop_cc(costas_alpha, (costas_alpha**2.0)/4.0, 50e-6*sps, -50e-6*sps, 2) - self.costas_spectrum = fftsink2.fft_sink_c( - self.displays.GetPage(2).GetWin(), - baseband_freq=freq+offset, - y_per_div=10, - y_divs=10, - ref_level=-15, - ref_scale=2.0, - sample_rate=sample_rate, - fft_size=1024, - fft_rate=15, - average=False, - avg_alpha=None, - title="PLL Spectrum", - peak_hold=False, - ) - self.displays.GetPage(2).GridAdd(self.costas_spectrum.win, 0, 0, 1, 1) - self.costas_waveform = scopesink2.scope_sink_c( - self.displays.GetPage(2).GetWin(), - title="PLL Waveform", - sample_rate=sample_rate, - v_scale=0.5, - v_offset=0, - t_scale=20.0/sample_rate, - ac_couple=False, - xy_mode=False, - num_inputs=1, - ) - self.displays.GetPage(2).GridAdd(self.costas_waveform.win, 1, 0, 1, 1) - self.gr_agc_xx_0 = gr.agc_cc(1e-6, 1.0, 1.0/32767.0, 1.0) - self.mm_const = scopesink2.scope_sink_c( - self.displays.GetPage(3).GetWin(), - title="Constellation", - sample_rate=symbol_rate, - v_scale=0.5, - v_offset=0, - t_scale=20.0/symbol_rate, - ac_couple=False, - xy_mode=True, - num_inputs=1, - ) - self.displays.GetPage(3).GridAdd(self.mm_const.win, 1, 0, 1, 1) - self.mm_spectrum = fftsink2.fft_sink_c( - self.displays.GetPage(3).GetWin(), - baseband_freq=0, - y_per_div=10, - y_divs=10, - ref_level=-15, - ref_scale=2.0, - sample_rate=symbol_rate, - fft_size=1024, - fft_rate=15, - average=False, - avg_alpha=None, - title="Bit Sync Spectrum", - peak_hold=False, - ) - self.displays.GetPage(3).GridAdd(self.mm_spectrum.win, 0, 0, 1, 1) - self.mm_sync = gr.clock_recovery_mm_cc(sps, (gain_mu**2)/4.0, 0.5, gain_mu, 50e-6*sps) - self.root_raised_cosine_filter_0 = gr.fir_filter_ccf(1, firdes.root_raised_cosine( - 1, sample_rate, symbol_rate, 0.25, int(11*sample_rate/symbol_rate))) - self.rrc_spectrum = fftsink2.fft_sink_c( - self.displays.GetPage(1).GetWin(), - baseband_freq=freq+offset, - y_per_div=10, - y_divs=10, - ref_level=-15, - ref_scale=2.0, - sample_rate=sample_rate, - fft_size=1024, - fft_rate=15, - average=False, - avg_alpha=None, - title="RRC Spectrum", - peak_hold=False, - ) - self.displays.GetPage(1).GridAdd(self.rrc_spectrum.win, 0, 0, 1, 1) - self.rrc_waveform = scopesink2.scope_sink_c( - self.displays.GetPage(1).GetWin(), - title="RRC Waveform", - sample_rate=sample_rate, - v_scale=0.5, - v_offset=0, - t_scale=20.0/sample_rate, - ac_couple=False, - xy_mode=False, - num_inputs=1, - ) - self.displays.GetPage(1).GridAdd(self.rrc_waveform.win, 1, 0, 1, 1) - self.rx_spectrum = fftsink2.fft_sink_c( - self.displays.GetPage(0).GetWin(), - baseband_freq=freq, - y_per_div=10, - y_divs=10, - ref_level=50, - ref_scale=2.0, - sample_rate=sample_rate, - fft_size=1024, - fft_rate=30, - average=False, - avg_alpha=None, - title="RX Spectrum", - peak_hold=False, - ) - self.displays.GetPage(0).GridAdd(self.rx_spectrum.win, 0, 0, 1, 1) - self.rx_waveform = scopesink2.scope_sink_c( - self.displays.GetPage(0).GetWin(), - title="RX Waveform", - sample_rate=sample_rate, - v_scale=0, - v_offset=0, - t_scale=20.0/sample_rate, - ac_couple=False, - xy_mode=False, - num_inputs=1, - ) - self.displays.GetPage(0).GridAdd(self.rx_waveform.win, 1, 0, 1, 1) - self.usrp_simple_source_x_0 = grc_usrp.simple_source_c(which=0, side=side, rx_ant="RXA") - self.usrp_simple_source_x_0.set_decim_rate(decim) - self.usrp_simple_source_x_0.set_frequency(freq+offset, verbose=True) - self.usrp_simple_source_x_0.set_gain(gain) - - ################################################## - # Connections - ################################################## - self.connect((self.gr_agc_xx_0, 0), (self.root_raised_cosine_filter_0, 0)) - self.connect((self.usrp_simple_source_x_0, 0), (self.gr_agc_xx_0, 0)) - self.connect((self.usrp_simple_source_x_0, 0), (self.rx_spectrum, 0)) - self.connect((self.usrp_simple_source_x_0, 0), (self.rx_waveform, 0)) - self.connect((self.root_raised_cosine_filter_0, 0), (self.rrc_waveform, 0)) - self.connect((self.root_raised_cosine_filter_0, 0), (self.rrc_spectrum, 0)) - self.connect((self.root_raised_cosine_filter_0, 0), (self.costas, 0)) - self.connect((self.costas, 0), (self.costas_spectrum, 0)) - self.connect((self.costas, 0), (self.costas_waveform, 0)) - self.connect((self.costas, 0), (self.mm_sync, 0)) - self.connect((self.mm_sync, 0), (self.mm_spectrum, 0)) - self.connect((self.mm_sync, 0), (self.mm_const, 0)) - - def set_config_filename(self, config_filename): - self.config_filename = config_filename - self._saved_freq_config = ConfigParser.ConfigParser() - self._saved_freq_config.read(self.config_filename) - if not self._saved_freq_config.has_section('usrp_rx_lrit'): - self._saved_freq_config.add_section('usrp_rx_lrit') - self._saved_freq_config.set('usrp_rx_lrit', 'freq', str(self.freq)) - self._saved_freq_config.write(open(self.config_filename, 'w')) - self._saved_offset_config = ConfigParser.ConfigParser() - self._saved_offset_config.read(self.config_filename) - if not self._saved_offset_config.has_section('usrp_rx_lrit'): - self._saved_offset_config.add_section('usrp_rx_lrit') - self._saved_offset_config.set('usrp_rx_lrit', 'offset', str(self.offset)) - self._saved_offset_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_rx_lrit'): - self._saved_gain_config.add_section('usrp_rx_lrit') - self._saved_gain_config.set('usrp_rx_lrit', 'gain', str(self.gain)) - self._saved_gain_config.write(open(self.config_filename, 'w')) - self._saved_decim_config = ConfigParser.ConfigParser() - self._saved_decim_config.read(self.config_filename) - if not self._saved_decim_config.has_section('usrp_rx_lrit'): - self._saved_decim_config.add_section('usrp_rx_lrit') - self._saved_decim_config.set('usrp_rx_lrit', 'decim', str(self.decim)) - self._saved_decim_config.write(open(self.config_filename, 'w')) - self._saved_costas_alpha_config = ConfigParser.ConfigParser() - self._saved_costas_alpha_config.read(self.config_filename) - if not self._saved_costas_alpha_config.has_section('usrp_rx_lrit'): - self._saved_costas_alpha_config.add_section('usrp_rx_lrit') - self._saved_costas_alpha_config.set('usrp_rx_lrit', 'costas_alpha', str(self.costas_alpha)) - self._saved_costas_alpha_config.write(open(self.config_filename, 'w')) - self._saved_gain_mu_config = ConfigParser.ConfigParser() - self._saved_gain_mu_config.read(self.config_filename) - if not self._saved_gain_mu_config.has_section('usrp_rx_lrit'): - self._saved_gain_mu_config.add_section('usrp_rx_lrit') - self._saved_gain_mu_config.set('usrp_rx_lrit', 'gain_mu', str(self.gain_mu)) - self._saved_gain_mu_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_lrit'): - self._side_config.add_section('usrp_rx_lrit') - self._side_config.set('usrp_rx_lrit', 'side', str(self.side)) - self._side_config.write(open(self.config_filename, 'w')) - - def set_saved_decim(self, saved_decim): - self.saved_decim = saved_decim - self.set_decim(self.saved_decim) - - def set_decim(self, decim): - self.decim = decim - self.set_sample_rate(64e6/self.decim) - self._saved_decim_config = ConfigParser.ConfigParser() - self._saved_decim_config.read(self.config_filename) - if not self._saved_decim_config.has_section('usrp_rx_lrit'): - self._saved_decim_config.add_section('usrp_rx_lrit') - self._saved_decim_config.set('usrp_rx_lrit', 'decim', str(self.decim)) - self._saved_decim_config.write(open(self.config_filename, 'w')) - self._decim_text_box.set_value(self.decim) - self.usrp_simple_source_x_0.set_decim_rate(self.decim) - - def set_symbol_rate(self, symbol_rate): - self.symbol_rate = symbol_rate - self.set_sps(self.sample_rate/self.symbol_rate) - self.root_raised_cosine_filter_0.set_taps(firdes.root_raised_cosine(1, self.sample_rate, self.symbol_rate, 0.25, int(11*self.sample_rate/self.symbol_rate))) - self.mm_spectrum.set_sample_rate(self.symbol_rate) - self.mm_const.set_sample_rate(self.symbol_rate) - - def set_saved_offset(self, saved_offset): - self.saved_offset = saved_offset - self.set_offset(self.saved_offset) - - def set_saved_gain_mu(self, saved_gain_mu): - self.saved_gain_mu = saved_gain_mu - self.set_gain_mu(self.saved_gain_mu) - - 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_saved_costas_alpha(self, saved_costas_alpha): - self.saved_costas_alpha = saved_costas_alpha - self.set_costas_alpha(self.saved_costas_alpha) - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_sps(self.sample_rate/self.symbol_rate) - self.rx_waveform.set_sample_rate(self.sample_rate) - self.rx_spectrum.set_sample_rate(self.sample_rate) - self.root_raised_cosine_filter_0.set_taps(firdes.root_raised_cosine(1, self.sample_rate, self.symbol_rate, 0.25, int(11*self.sample_rate/self.symbol_rate))) - self.rrc_waveform.set_sample_rate(self.sample_rate) - self.rrc_spectrum.set_sample_rate(self.sample_rate) - self.costas_spectrum.set_sample_rate(self.sample_rate) - self.costas_waveform.set_sample_rate(self.sample_rate) - - def set_sps(self, sps): - self.sps = sps - self.mm_sync.set_omega(self.sps) - - 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_lrit'): - self._side_config.add_section('usrp_rx_lrit') - self._side_config.set('usrp_rx_lrit', 'side', str(self.side)) - self._side_config.write(open(self.config_filename, 'w')) - - def set_offset(self, offset): - self.offset = offset - self._saved_offset_config = ConfigParser.ConfigParser() - self._saved_offset_config.read(self.config_filename) - if not self._saved_offset_config.has_section('usrp_rx_lrit'): - self._saved_offset_config.add_section('usrp_rx_lrit') - self._saved_offset_config.set('usrp_rx_lrit', 'offset', str(self.offset)) - self._saved_offset_config.write(open(self.config_filename, 'w')) - self._offset_slider.set_value(self.offset) - self._offset_text_box.set_value(self.offset) - self.rrc_spectrum.set_baseband_freq(self.freq+self.offset) - self.costas_spectrum.set_baseband_freq(self.freq+self.offset) - self.usrp_simple_source_x_0.set_frequency(self.freq+self.offset) - - def set_gain_mu(self, gain_mu): - self.gain_mu = gain_mu - self._gain_mu_slider.set_value(self.gain_mu) - self._gain_mu_text_box.set_value(self.gain_mu) - self._saved_gain_mu_config = ConfigParser.ConfigParser() - self._saved_gain_mu_config.read(self.config_filename) - if not self._saved_gain_mu_config.has_section('usrp_rx_lrit'): - self._saved_gain_mu_config.add_section('usrp_rx_lrit') - self._saved_gain_mu_config.set('usrp_rx_lrit', 'gain_mu', str(self.gain_mu)) - self._saved_gain_mu_config.write(open(self.config_filename, 'w')) - self.mm_sync.set_gain_omega((self.gain_mu**2)/4.0) - self.mm_sync.set_gain_mu(self.gain_mu) - - def set_gain(self, gain): - self.gain = gain - self._saved_gain_config = ConfigParser.ConfigParser() - self._saved_gain_config.read(self.config_filename) - if not self._saved_gain_config.has_section('usrp_rx_lrit'): - self._saved_gain_config.add_section('usrp_rx_lrit') - self._saved_gain_config.set('usrp_rx_lrit', 'gain', str(self.gain)) - self._saved_gain_config.write(open(self.config_filename, 'w')) - self._gain_slider.set_value(self.gain) - self._gain_text_box.set_value(self.gain) - self.usrp_simple_source_x_0.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_rx_lrit'): - self._saved_freq_config.add_section('usrp_rx_lrit') - self._saved_freq_config.set('usrp_rx_lrit', 'freq', str(self.freq)) - self._saved_freq_config.write(open(self.config_filename, 'w')) - self.rx_spectrum.set_baseband_freq(self.freq) - self.rrc_spectrum.set_baseband_freq(self.freq+self.offset) - self.costas_spectrum.set_baseband_freq(self.freq+self.offset) - self.usrp_simple_source_x_0.set_frequency(self.freq+self.offset) - - def set_costas_alpha(self, costas_alpha): - self.costas_alpha = costas_alpha - self._costas_alpha_slider.set_value(self.costas_alpha) - self._costas_alpha_text_box.set_value(self.costas_alpha) - self._saved_costas_alpha_config = ConfigParser.ConfigParser() - self._saved_costas_alpha_config.read(self.config_filename) - if not self._saved_costas_alpha_config.has_section('usrp_rx_lrit'): - self._saved_costas_alpha_config.add_section('usrp_rx_lrit') - self._saved_costas_alpha_config.set('usrp_rx_lrit', 'costas_alpha', str(self.costas_alpha)) - self._saved_costas_alpha_config.write(open(self.config_filename, 'w')) - self.costas.set_alpha(self.costas_alpha) - self.costas.set_beta((self.costas_alpha**2.0)/4.0) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - (options, args) = parser.parse_args() - tb = usrp_rx_lrit() - tb.Run(True) - |