summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan2009-10-16 14:02:10 -0700
committerJohnathan Corgan2009-11-03 07:21:42 -0800
commit23bb3a5b5f8430478ab1ff7b9d394214f757deac (patch)
tree27e48b6b4539755b10a3e39ae6ed15785e4f66d4
parent96c92bb05fdbd2d42bb485bee46e63931d465cc3 (diff)
downloadgnuradio-23bb3a5b5f8430478ab1ff7b9d394214f757deac.tar.gz
gnuradio-23bb3a5b5f8430478ab1ff7b9d394214f757deac.tar.bz2
gnuradio-23bb3a5b5f8430478ab1ff7b9d394214f757deac.zip
Work in progress, updating usrp_rx_flex.py
Optimized channel bandwith filter Optimized matched filter
-rw-r--r--gr-pager/apps/usrp_rx_flex.grc823
-rwxr-xr-xgr-pager/apps/usrp_rx_flex.py118
2 files changed, 640 insertions, 301 deletions
diff --git a/gr-pager/apps/usrp_rx_flex.grc b/gr-pager/apps/usrp_rx_flex.grc
index c324eaa3e..2d16e1cd6 100644
--- a/gr-pager/apps/usrp_rx_flex.grc
+++ b/gr-pager/apps/usrp_rx_flex.grc
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Sun Oct 11 14:19:38 2009</timestamp>
+ <timestamp>Sat Oct 17 11:46:38 2009</timestamp>
<block>
<key>options</key>
<param>
@@ -25,7 +25,7 @@
</param>
<param>
<key>window_size</key>
- <value>1280, 1024</value>
+ <value>4095,4095</value>
</param>
<param>
<key>generate_options</key>
@@ -83,7 +83,7 @@
<key>variable</key>
<param>
<key>id</key>
- <value>decim</value>
+ <value>sample_rate</value>
</param>
<param>
<key>_enabled</key>
@@ -91,11 +91,11 @@
</param>
<param>
<key>value</key>
- <value>16</value>
+ <value>adc_rate/decim</value>
</param>
<param>
<key>_coordinate</key>
- <value>(310, 11)</value>
+ <value>(382, 12)</value>
</param>
<param>
<key>_rotation</key>
@@ -106,7 +106,7 @@
<key>variable</key>
<param>
<key>id</key>
- <value>sample_rate</value>
+ <value>freq</value>
</param>
<param>
<key>_enabled</key>
@@ -114,11 +114,11 @@
</param>
<param>
<key>value</key>
- <value>adc_rate/decim</value>
+ <value>band_freq+(channel-61)*25e3</value>
</param>
<param>
<key>_coordinate</key>
- <value>(382, 12)</value>
+ <value>(480, 11)</value>
</param>
<param>
<key>_rotation</key>
@@ -126,22 +126,117 @@
</param>
</block>
<block>
- <key>variable</key>
+ <key>wxgui_fftsink2</key>
<param>
<key>id</key>
- <value>channel_rate</value>
+ <value>wxgui_fftsink2_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>value</key>
- <value>25e3</value>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>FLEX Spectrum</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>sample_rate</value>
+ </param>
+ <param>
+ <key>baseband_freq</key>
+ <value>band_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>0</value>
+ </param>
+ <param>
+ <key>ref_scale</key>
+ <value>65536</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_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>(34, 508)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>180</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>['RX Spectrum','Baseband']</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>1, 0, 1, 5</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
</param>
<param>
<key>_coordinate</key>
- <value>(751, 13)</value>
+ <value>(9, 209)</value>
</param>
<param>
<key>_rotation</key>
@@ -149,22 +244,22 @@
</param>
</block>
<block>
- <key>variable</key>
+ <key>import</key>
<param>
<key>id</key>
- <value>freq</value>
+ <value>import_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>value</key>
- <value>band_freq+(channel-61)*25e3</value>
+ <key>import</key>
+ <value>import os, math</value>
</param>
<param>
<key>_coordinate</key>
- <value>(480, 11)</value>
+ <value>(10, 76)</value>
</param>
<param>
<key>_rotation</key>
@@ -172,22 +267,58 @@
</param>
</block>
<block>
- <key>variable</key>
+ <key>usrp_simple_source_x</key>
<param>
<key>id</key>
- <value>channel_decim</value>
+ <value>usrp_source</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>value</key>
- <value>int(sample_rate/channel_rate)</value>
+ <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>band_freq</value>
+ </param>
+ <param>
+ <key>lo_offset</key>
+ <value>float('inf')</value>
+ </param>
+ <param>
+ <key>gain</key>
+ <value>rx_gain</value>
+ </param>
+ <param>
+ <key>side</key>
+ <value>A</value>
+ </param>
+ <param>
+ <key>rx_ant</key>
+ <value>RXA</value>
+ </param>
+ <param>
+ <key>hb_filters</key>
+ <value></value>
</param>
<param>
<key>_coordinate</key>
- <value>(854, 11)</value>
+ <value>(32, 734)</value>
</param>
<param>
<key>_rotation</key>
@@ -195,22 +326,124 @@
</param>
</block>
<block>
- <key>variable</key>
+ <key>gr_quadrature_demod_cf</key>
+ <param>
+ <key>id</key>
+ <value>fm_demod</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>gain</key>
+ <value>demod_k</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(599, 774)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_freq_xlating_fir_filter_xxx</key>
<param>
<key>id</key>
+ <value>gr_freq_xlating_fir_filter_xxx_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>ccc</value>
+ </param>
+ <param>
+ <key>decim</key>
+ <value>channel_decim</value>
+ </param>
+ <param>
+ <key>taps</key>
<value>channel_taps</value>
</param>
<param>
+ <key>center_freq</key>
+ <value>band_freq-freq+offset</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>sample_rate</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(321, 750)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_scopesink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_scopesink2_0</value>
+ </param>
+ <param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>value</key>
- <value>firdes.low_pass(10**1, sample_rate, 10e3, 2.5e3)</value>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>Channel Waveform</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>channel_rate</value>
+ </param>
+ <param>
+ <key>v_scale</key>
+ <value>8e3</value>
+ </param>
+ <param>
+ <key>t_scale</key>
+ <value>20.0/channel_rate</value>
+ </param>
+ <param>
+ <key>ac_couple</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>xy_mode</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>num_inputs</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>0, 0, 1, 1</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value>displays, 1</value>
</param>
<param>
<key>_coordinate</key>
- <value>(588, 12)</value>
+ <value>(594, 620)</value>
</param>
<param>
<key>_rotation</key>
@@ -221,7 +454,7 @@
<key>wxgui_fftsink2</key>
<param>
<key>id</key>
- <value>wxgui_fftsink2_0</value>
+ <value>wxgui_fftsink2_1</value>
</param>
<param>
<key>_enabled</key>
@@ -233,15 +466,15 @@
</param>
<param>
<key>title</key>
- <value>FLEX Spectrum</value>
+ <value>Channel Spectrum</value>
</param>
<param>
<key>samp_rate</key>
- <value>sample_rate</value>
+ <value>channel_rate</value>
</param>
<param>
<key>baseband_freq</key>
- <value>band_freq</value>
+ <value>freq</value>
</param>
<param>
<key>y_per_div</key>
@@ -280,16 +513,20 @@
<value>0</value>
</param>
<param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
<key>grid_pos</key>
- <value>0,0,1,1</value>
+ <value>1, 0, 1, 1</value>
</param>
<param>
<key>notebook</key>
- <value>displays,0</value>
+ <value>displays, 0</value>
</param>
<param>
<key>_coordinate</key>
- <value>(34, 508)</value>
+ <value>(344, 511)</value>
</param>
<param>
<key>_rotation</key>
@@ -297,10 +534,33 @@
</param>
</block>
<block>
- <key>usrp_simple_source_x</key>
+ <key>variable</key>
<param>
<key>id</key>
- <value>usrp_source</value>
+ <value>decim</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(310, 11)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_moving_average_xx</key>
+ <param>
+ <key>id</key>
+ <value>gr_moving_average_xx_0</value>
</param>
<param>
<key>_enabled</key>
@@ -308,47 +568,69 @@
</param>
<param>
<key>type</key>
- <value>complex</value>
+ <value>float</value>
</param>
<param>
- <key>format</key>
- <value></value>
+ <key>length</key>
+ <value>8</value>
</param>
<param>
- <key>which</key>
+ <key>scale</key>
+ <value>1.0/8.0</value>
+ </param>
+ <param>
+ <key>max_iter</key>
+ <value>4000</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(831, 758)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
<value>0</value>
</param>
+ </block>
+ <block>
+ <key>variable</key>
<param>
- <key>decimation</key>
- <value>decim</value>
+ <key>id</key>
+ <value>ma_ntaps</value>
</param>
<param>
- <key>frequency</key>
- <value>band_freq</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>lo_offset</key>
- <value>float('inf')</value>
+ <key>value</key>
+ <value>channel_rate/symbol_rate</value>
</param>
<param>
- <key>gain</key>
- <value>rx_gain</value>
+ <key>_coordinate</key>
+ <value>(833, 851)</value>
</param>
<param>
- <key>side</key>
- <value>A</value>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable</key>
+ <param>
+ <key>id</key>
+ <value>symbol_rate</value>
</param>
<param>
- <key>rx_ant</key>
- <value>RXA</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>hb_filters</key>
- <value></value>
+ <key>value</key>
+ <value>3200</value>
</param>
<param>
<key>_coordinate</key>
- <value>(32, 734)</value>
+ <value>(590, 12)</value>
</param>
<param>
<key>_rotation</key>
@@ -356,22 +638,22 @@
</param>
</block>
<block>
- <key>import</key>
+ <key>variable</key>
<param>
<key>id</key>
- <value>import_0</value>
+ <value>nchan_taps</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>import</key>
- <value>import os</value>
+ <key>value</key>
+ <value>len(channel_taps)</value>
</param>
<param>
<key>_coordinate</key>
- <value>(10, 76)</value>
+ <value>(328, 1009)</value>
</param>
<param>
<key>_rotation</key>
@@ -382,7 +664,7 @@
<key>variable</key>
<param>
<key>id</key>
- <value>config_filename</value>
+ <value>channel_decim</value>
</param>
<param>
<key>_enabled</key>
@@ -390,11 +672,11 @@
</param>
<param>
<key>value</key>
- <value>os.environ["HOME"]+"/.gnuradio/config.conf"</value>
+ <value>int(sample_rate/channel_rate)</value>
</param>
<param>
<key>_coordinate</key>
- <value>(9, 133)</value>
+ <value>(906, 12)</value>
</param>
<param>
<key>_rotation</key>
@@ -402,10 +684,10 @@
</param>
</block>
<block>
- <key>variable_config</key>
+ <key>variable</key>
<param>
<key>id</key>
- <value>saved_band_freq</value>
+ <value>deviation</value>
</param>
<param>
<key>_enabled</key>
@@ -413,31 +695,34 @@
</param>
<param>
<key>value</key>
- <value>930.5125e6</value>
+ <value>4800</value>
</param>
<param>
- <key>type</key>
- <value>real</value>
+ <key>_coordinate</key>
+ <value>(688, 14)</value>
</param>
<param>
- <key>config_file</key>
- <value>config_filename</value>
+ <key>_rotation</key>
+ <value>0</value>
</param>
+ </block>
+ <block>
+ <key>variable</key>
<param>
- <key>section</key>
- <value>gr-pager</value>
+ <key>id</key>
+ <value>demod_k</value>
</param>
<param>
- <key>option</key>
- <value>band_center</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>writeback</key>
- <value>band_freq</value>
+ <key>value</key>
+ <value>3*channel_rate/(2*math.pi*deviation)</value>
</param>
<param>
<key>_coordinate</key>
- <value>(228, 311)</value>
+ <value>(598, 857)</value>
</param>
<param>
<key>_rotation</key>
@@ -445,10 +730,10 @@
</param>
</block>
<block>
- <key>variable_config</key>
+ <key>variable</key>
<param>
<key>id</key>
- <value>saved_offset</value>
+ <value>channel_taps</value>
</param>
<param>
<key>_enabled</key>
@@ -456,8 +741,54 @@
</param>
<param>
<key>value</key>
+ <value>firdes.low_pass(10, sample_rate, passband/2.0, (channel_rate-passband)/2.0)</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(325, 857)</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>(9, 133)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
<value>0</value>
</param>
+ </block>
+ <block>
+ <key>variable_config</key>
+ <param>
+ <key>id</key>
+ <value>saved_band_freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>930.5125e6</value>
+ </param>
<param>
<key>type</key>
<value>real</value>
@@ -472,15 +803,15 @@
</param>
<param>
<key>option</key>
- <value>freq_offset</value>
+ <value>band_center</value>
</param>
<param>
<key>writeback</key>
- <value>offset</value>
+ <value>band_freq</value>
</param>
<param>
<key>_coordinate</key>
- <value>(547, 312)</value>
+ <value>(228, 311)</value>
</param>
<param>
<key>_rotation</key>
@@ -491,7 +822,7 @@
<key>variable_config</key>
<param>
<key>id</key>
- <value>saved_rx_gain</value>
+ <value>saved_channel</value>
</param>
<param>
<key>_enabled</key>
@@ -499,7 +830,7 @@
</param>
<param>
<key>value</key>
- <value>40</value>
+ <value>25</value>
</param>
<param>
<key>type</key>
@@ -515,15 +846,15 @@
</param>
<param>
<key>option</key>
- <value>rx_gain</value>
+ <value>channel</value>
</param>
<param>
<key>writeback</key>
- <value>rx_gain</value>
+ <value>channel</value>
</param>
<param>
<key>_coordinate</key>
- <value>(706, 312)</value>
+ <value>(387, 312)</value>
</param>
<param>
<key>_rotation</key>
@@ -531,38 +862,42 @@
</param>
</block>
<block>
- <key>gr_freq_xlating_fir_filter_xxx</key>
+ <key>variable_config</key>
<param>
<key>id</key>
- <value>gr_freq_xlating_fir_filter_xxx_0</value>
+ <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>ccc</value>
+ <value>real</value>
</param>
<param>
- <key>decim</key>
- <value>channel_decim</value>
+ <key>config_file</key>
+ <value>config_filename</value>
</param>
<param>
- <key>taps</key>
- <value>channel_taps</value>
+ <key>section</key>
+ <value>gr-pager</value>
</param>
<param>
- <key>center_freq</key>
- <value>band_freq-freq+offset</value>
+ <key>option</key>
+ <value>freq_offset</value>
</param>
<param>
- <key>samp_rate</key>
- <value>sample_rate</value>
+ <key>writeback</key>
+ <value>offset</value>
</param>
<param>
<key>_coordinate</key>
- <value>(321, 750)</value>
+ <value>(547, 312)</value>
</param>
<param>
<key>_rotation</key>
@@ -570,34 +905,42 @@
</param>
</block>
<block>
- <key>notebook</key>
+ <key>variable_config</key>
<param>
<key>id</key>
- <value>displays</value>
+ <value>saved_rx_gain</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>style</key>
- <value>wx.NB_TOP</value>
+ <key>value</key>
+ <value>40</value>
</param>
<param>
- <key>labels</key>
- <value>['RX Spectrum','Baseband']</value>
+ <key>type</key>
+ <value>int</value>
</param>
<param>
- <key>grid_pos</key>
- <value>1, 0, 1, 5</value>
+ <key>config_file</key>
+ <value>config_filename</value>
</param>
<param>
- <key>notebook</key>
- <value></value>
+ <key>section</key>
+ <value>gr-pager</value>
+ </param>
+ <param>
+ <key>option</key>
+ <value>rx_gain</value>
+ </param>
+ <param>
+ <key>writeback</key>
+ <value>rx_gain</value>
</param>
<param>
<key>_coordinate</key>
- <value>(9, 209)</value>
+ <value>(706, 312)</value>
</param>
<param>
<key>_rotation</key>
@@ -605,10 +948,10 @@
</param>
</block>
<block>
- <key>variable_slider</key>
+ <key>variable_text_box</key>
<param>
<key>id</key>
- <value>rx_gain</value>
+ <value>band_freq</value>
</param>
<param>
<key>_enabled</key>
@@ -616,35 +959,23 @@
</param>
<param>
<key>label</key>
- <value>Analog Gain</value>
+ <value>Band Freq.</value>
</param>
<param>
<key>value</key>
- <value>saved_rx_gain</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>100</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
+ <value>saved_band_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, 4, 1, 1</value>
+ <value>0, 0, 1, 1</value>
</param>
<param>
<key>notebook</key>
@@ -652,7 +983,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(658, 122)</value>
+ <value>(225, 121)</value>
</param>
<param>
<key>_rotation</key>
@@ -758,54 +1089,45 @@
</param>
</block>
<block>
- <key>variable_slider</key>
+ <key>variable</key>
<param>
<key>id</key>
- <value>channel</value>
+ <value>passband</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
- <key>label</key>
- <value>Channel</value>
- </param>
- <param>
<key>value</key>
- <value>saved_channel</value>
+ <value>2*(deviation+symbol_rate)</value>
</param>
<param>
- <key>min</key>
- <value>1</value>
- </param>
- <param>
- <key>max</key>
- <value>120</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>119</value>
+ <key>_coordinate</key>
+ <value>(327, 930)</value>
</param>
<param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
+ <key>_rotation</key>
+ <value>0</value>
</param>
+ </block>
+ <block>
+ <key>variable</key>
<param>
- <key>converver</key>
- <value>float_converter</value>
+ <key>id</key>
+ <value>channel_rate</value>
</param>
<param>
- <key>grid_pos</key>
- <value>0, 1, 1, 1</value>
+ <key>_enabled</key>
+ <value>True</value>
</param>
<param>
- <key>notebook</key>
- <value></value>
+ <key>value</key>
+ <value>8*3200</value>
</param>
<param>
<key>_coordinate</key>
- <value>(376, 120)</value>
+ <value>(792, 13)</value>
</param>
<param>
<key>_rotation</key>
@@ -813,10 +1135,10 @@
</param>
</block>
<block>
- <key>variable_text_box</key>
+ <key>variable_slider</key>
<param>
<key>id</key>
- <value>band_freq</value>
+ <value>channel</value>
</param>
<param>
<key>_enabled</key>
@@ -824,23 +1146,35 @@
</param>
<param>
<key>label</key>
- <value>Band Freq.</value>
+ <value>Channel</value>
</param>
<param>
<key>value</key>
- <value>saved_band_freq</value>
+ <value>saved_channel</value>
</param>
<param>
- <key>converver</key>
- <value>float_converter</value>
+ <key>min</key>
+ <value>1</value>
</param>
<param>
- <key>formatter</key>
- <value>None</value>
+ <key>max</key>
+ <value>120</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>119</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>int_converter</value>
</param>
<param>
<key>grid_pos</key>
- <value>0, 0, 1, 1</value>
+ <value>0, 1, 1, 1</value>
</param>
<param>
<key>notebook</key>
@@ -848,7 +1182,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(225, 121)</value>
+ <value>(376, 120)</value>
</param>
<param>
<key>_rotation</key>
@@ -856,58 +1190,54 @@
</param>
</block>
<block>
- <key>wxgui_scopesink2</key>
+ <key>variable_slider</key>
<param>
<key>id</key>
- <value>wxgui_scopesink2_0</value>
+ <value>rx_gain</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>
+ <key>label</key>
+ <value>Analog Gain</value>
</param>
<param>
- <key>samp_rate</key>
- <value>channel_rate</value>
+ <key>value</key>
+ <value>saved_rx_gain</value>
</param>
<param>
- <key>v_scale</key>
- <value>1e3</value>
+ <key>min</key>
+ <value>0</value>
</param>
<param>
- <key>t_scale</key>
- <value>20.0/channel_rate</value>
+ <key>max</key>
+ <value>100</value>
</param>
<param>
- <key>ac_couple</key>
- <value>False</value>
+ <key>num_steps</key>
+ <value>100</value>
</param>
<param>
- <key>xy_mode</key>
- <value>False</value>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
</param>
<param>
- <key>num_inputs</key>
- <value>1</value>
+ <key>converver</key>
+ <value>int_converter</value>
</param>
<param>
<key>grid_pos</key>
- <value>0, 0, 1, 1</value>
+ <value>0, 4, 1, 1</value>
</param>
<param>
<key>notebook</key>
- <value>displays, 1</value>
+ <value></value>
</param>
<param>
<key>_coordinate</key>
- <value>(593, 551)</value>
+ <value>(658, 122)</value>
</param>
<param>
<key>_rotation</key>
@@ -915,10 +1245,10 @@
</param>
</block>
<block>
- <key>wxgui_fftsink2</key>
+ <key>wxgui_scopesink2</key>
<param>
<key>id</key>
- <value>wxgui_fftsink2_1</value>
+ <value>wxgui_scopesink2_0_0</value>
</param>
<param>
<key>_enabled</key>
@@ -926,55 +1256,39 @@
</param>
<param>
<key>type</key>
- <value>complex</value>
+ <value>float</value>
</param>
<param>
<key>title</key>
- <value>Channel Spectrum</value>
+ <value>Baseband</value>
</param>
<param>
<key>samp_rate</key>
<value>channel_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>0</value>
- </param>
- <param>
- <key>ref_scale</key>
- <value>65536</value>
+ <key>v_scale</key>
+ <value>1</value>
</param>
<param>
- <key>fft_size</key>
- <value>1024</value>
+ <key>t_scale</key>
+ <value>40.0/channel_rate</value>
</param>
<param>
- <key>fft_rate</key>
- <value>30</value>
+ <key>ac_couple</key>
+ <value>False</value>
</param>
<param>
- <key>peak_hold</key>
+ <key>xy_mode</key>
<value>False</value>
</param>
<param>
- <key>average</key>
- <value>False</value>
+ <key>num_inputs</key>
+ <value>1</value>
</param>
<param>
- <key>avg_alpha</key>
- <value>0</value>
+ <key>win_size</key>
+ <value></value>
</param>
<param>
<key>grid_pos</key>
@@ -982,60 +1296,17 @@
</param>
<param>
<key>notebook</key>
- <value>displays, 0</value>
+ <value>displays, 1</value>
</param>
<param>
<key>_coordinate</key>
- <value>(344, 511)</value>
+ <value>(797, 601)</value>
</param>
<param>
<key>_rotation</key>
<value>180</value>
</param>
</block>
- <block>
- <key>variable_config</key>
- <param>
- <key>id</key>
- <value>saved_channel</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>25</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>gr-pager</value>
- </param>
- <param>
- <key>option</key>
- <value>channel</value>
- </param>
- <param>
- <key>writeback</key>
- <value>channel</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(387, 312)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
<connection>
<source_block_id>gr_freq_xlating_fir_filter_xxx_0</source_block_id>
<sink_block_id>wxgui_fftsink2_1</sink_block_id>
@@ -1060,4 +1331,22 @@
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
+ <connection>
+ <source_block_id>gr_freq_xlating_fir_filter_xxx_0</source_block_id>
+ <sink_block_id>fm_demod</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>fm_demod</source_block_id>
+ <sink_block_id>gr_moving_average_xx_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>gr_moving_average_xx_0</source_block_id>
+ <sink_block_id>wxgui_scopesink2_0_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
</flow_graph>
diff --git a/gr-pager/apps/usrp_rx_flex.py b/gr-pager/apps/usrp_rx_flex.py
index 7d6345279..73b11f90c 100755
--- a/gr-pager/apps/usrp_rx_flex.py
+++ b/gr-pager/apps/usrp_rx_flex.py
@@ -2,7 +2,7 @@
##################################################
# Gnuradio Python Flow Graph
# Title: USRP FLEX Pager Receiver (Single Channel)
-# Generated: Sun Oct 11 14:15:06 2009
+# Generated: Sat Oct 17 11:46:38 2009
##################################################
from gnuradio import eng_notation
@@ -16,7 +16,7 @@ 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 os, math
import wx
class usrp_rx_flex(grc_wxgui.top_block_gui):
@@ -28,6 +28,7 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
# Variables
##################################################
self.config_filename = config_filename = os.environ["HOME"]+"/.gnuradio/config.conf"
+ self.symbol_rate = symbol_rate = 3200
self._saved_channel_config = ConfigParser.ConfigParser()
self._saved_channel_config.read(config_filename)
try: saved_channel = self._saved_channel_config.getint("gr-pager", "channel")
@@ -38,10 +39,14 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
try: saved_band_freq = self._saved_band_freq_config.getfloat("gr-pager", "band_center")
except: saved_band_freq = 930.5125e6
self.saved_band_freq = saved_band_freq
- self.decim = decim = 16
+ self.deviation = deviation = 4800
+ self.decim = decim = 20
+ self.adc_rate = adc_rate = 64e6
+ self.sample_rate = sample_rate = adc_rate/decim
+ self.passband = passband = 2*(deviation+symbol_rate)
+ self.channel_rate = channel_rate = 8*3200
self.channel = channel = saved_channel
self.band_freq = band_freq = saved_band_freq
- self.adc_rate = adc_rate = 64e6
self._saved_rx_gain_config = ConfigParser.ConfigParser()
self._saved_rx_gain_config.read(config_filename)
try: saved_rx_gain = self._saved_rx_gain_config.getint("gr-pager", "rx_gain")
@@ -52,13 +57,14 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
try: saved_offset = self._saved_offset_config.getfloat("gr-pager", "freq_offset")
except: saved_offset = 0
self.saved_offset = saved_offset
- self.sample_rate = sample_rate = adc_rate/decim
self.freq = freq = band_freq+(channel-61)*25e3
- self.channel_rate = channel_rate = 25e3
+ self.channel_taps = channel_taps = firdes.low_pass(10, sample_rate, passband/2.0, (channel_rate-passband)/2.0)
self.rx_gain = rx_gain = saved_rx_gain
self.offset = offset = saved_offset
+ self.nchan_taps = nchan_taps = len(channel_taps)
+ self.ma_ntaps = ma_ntaps = channel_rate/symbol_rate
self.freq_text = freq_text = freq
- self.channel_taps = channel_taps = firdes.low_pass(10**1, sample_rate, 10e3, 2.5e3)
+ self.demod_k = demod_k = 3*channel_rate/(2*math.pi*deviation)
self.channel_decim = channel_decim = int(sample_rate/channel_rate)
##################################################
@@ -79,7 +85,7 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
value=self.channel,
callback=self.set_channel,
label="Channel",
- converter=forms.float_converter(),
+ converter=forms.int_converter(),
proportion=0,
)
self._channel_slider = forms.slider(
@@ -91,7 +97,7 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
maximum=120,
num_steps=119,
style=wx.SL_HORIZONTAL,
- cast=float,
+ cast=int,
proportion=1,
)
self.GridAdd(_channel_sizer, 0, 1, 1, 1)
@@ -110,7 +116,7 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
value=self.rx_gain,
callback=self.set_rx_gain,
label="Analog Gain",
- converter=forms.float_converter(),
+ converter=forms.int_converter(),
proportion=0,
)
self._rx_gain_slider = forms.slider(
@@ -122,7 +128,7 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
maximum=100,
num_steps=100,
style=wx.SL_HORIZONTAL,
- cast=float,
+ cast=int,
proportion=1,
)
self.GridAdd(_rx_gain_sizer, 0, 4, 1, 1)
@@ -161,7 +167,9 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
##################################################
# Blocks
##################################################
+ self.fm_demod = gr.quadrature_demod_cf(demod_k)
self.gr_freq_xlating_fir_filter_xxx_0 = gr.freq_xlating_fir_filter_ccc(channel_decim, (channel_taps), band_freq-freq+offset, sample_rate)
+ self.gr_moving_average_xx_0 = gr.moving_average_ff(8, 1.0/8.0, 4000)
self.usrp_source = grc_usrp.simple_source_c(which=0, side="A", rx_ant="RXA")
self.usrp_source.set_decim_rate(decim)
self.usrp_source.set_frequency(band_freq, verbose=True)
@@ -200,15 +208,26 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
self.displays.GetPage(0).GridAdd(self.wxgui_fftsink2_1.win, 1, 0, 1, 1)
self.wxgui_scopesink2_0 = scopesink2.scope_sink_c(
self.displays.GetPage(1).GetWin(),
- title="Baseband Waveform",
+ title="Channel Waveform",
sample_rate=channel_rate,
- v_scale=1e3,
+ v_scale=8e3,
t_scale=20.0/channel_rate,
ac_couple=False,
xy_mode=False,
num_inputs=1,
)
self.displays.GetPage(1).GridAdd(self.wxgui_scopesink2_0.win, 0, 0, 1, 1)
+ self.wxgui_scopesink2_0_0 = scopesink2.scope_sink_f(
+ self.displays.GetPage(1).GetWin(),
+ title="Baseband",
+ sample_rate=channel_rate,
+ v_scale=1,
+ t_scale=40.0/channel_rate,
+ ac_couple=False,
+ xy_mode=False,
+ num_inputs=1,
+ )
+ self.displays.GetPage(1).GridAdd(self.wxgui_scopesink2_0_0.win, 1, 0, 1, 1)
##################################################
# Connections
@@ -217,6 +236,9 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
self.connect((self.usrp_source, 0), (self.gr_freq_xlating_fir_filter_xxx_0, 0))
self.connect((self.usrp_source, 0), (self.wxgui_fftsink2_0, 0))
self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.wxgui_scopesink2_0, 0))
+ self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.fm_demod, 0))
+ self.connect((self.fm_demod, 0), (self.gr_moving_average_xx_0, 0))
+ self.connect((self.gr_moving_average_xx_0, 0), (self.wxgui_scopesink2_0_0, 0))
def set_config_filename(self, config_filename):
self.config_filename = config_filename
@@ -245,6 +267,11 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
self._saved_rx_gain_config.set("gr-pager", "rx_gain", str(self.rx_gain))
self._saved_rx_gain_config.write(open(self.config_filename, 'w'))
+ def set_symbol_rate(self, symbol_rate):
+ self.symbol_rate = symbol_rate
+ self.set_ma_ntaps(self.channel_rate/self.symbol_rate)
+ self.set_passband(2*(self.deviation+self.symbol_rate))
+
def set_saved_channel(self, saved_channel):
self.saved_channel = saved_channel
self.set_channel(self.saved_channel)
@@ -253,11 +280,40 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
self.saved_band_freq = saved_band_freq
self.set_band_freq(self.saved_band_freq)
+ def set_deviation(self, deviation):
+ self.deviation = deviation
+ self.set_demod_k(3*self.channel_rate/(2*math.pi*self.deviation))
+ self.set_passband(2*(self.deviation+self.symbol_rate))
+
def set_decim(self, decim):
self.decim = decim
self.set_sample_rate(self.adc_rate/self.decim)
self.usrp_source.set_decim_rate(self.decim)
+ def set_adc_rate(self, adc_rate):
+ self.adc_rate = adc_rate
+ self.set_sample_rate(self.adc_rate/self.decim)
+
+ def set_sample_rate(self, sample_rate):
+ self.sample_rate = sample_rate
+ self.wxgui_fftsink2_0.set_sample_rate(self.sample_rate)
+ self.set_channel_decim(int(self.sample_rate/self.channel_rate))
+ self.set_channel_taps(firdes.low_pass(10, self.sample_rate, self.passband/2.0, (self.channel_rate-self.passband)/2.0))
+
+ def set_passband(self, passband):
+ self.passband = passband
+ self.set_channel_taps(firdes.low_pass(10, self.sample_rate, self.passband/2.0, (self.channel_rate-self.passband)/2.0))
+
+ def set_channel_rate(self, channel_rate):
+ self.channel_rate = channel_rate
+ self.wxgui_scopesink2_0.set_sample_rate(self.channel_rate)
+ self.wxgui_fftsink2_1.set_sample_rate(self.channel_rate)
+ self.set_ma_ntaps(self.channel_rate/self.symbol_rate)
+ self.set_channel_decim(int(self.sample_rate/self.channel_rate))
+ self.set_demod_k(3*self.channel_rate/(2*math.pi*self.deviation))
+ self.set_channel_taps(firdes.low_pass(10, self.sample_rate, self.passband/2.0, (self.channel_rate-self.passband)/2.0))
+ self.wxgui_scopesink2_0_0.set_sample_rate(self.channel_rate)
+
def set_channel(self, channel):
self.channel = channel
self.set_freq(self.band_freq+(self.channel-61)*25e3)
@@ -275,19 +331,15 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
self.set_freq(self.band_freq+(self.channel-61)*25e3)
self.wxgui_fftsink2_0.set_baseband_freq(self.band_freq)
self.usrp_source.set_frequency(self.band_freq)
+ self.gr_freq_xlating_fir_filter_xxx_0.set_center_freq(self.band_freq-self.freq+self.offset)
self._saved_band_freq_config = ConfigParser.ConfigParser()
self._saved_band_freq_config.read(self.config_filename)
if not self._saved_band_freq_config.has_section("gr-pager"):
self._saved_band_freq_config.add_section("gr-pager")
self._saved_band_freq_config.set("gr-pager", "band_center", str(self.band_freq))
self._saved_band_freq_config.write(open(self.config_filename, 'w'))
- self.gr_freq_xlating_fir_filter_xxx_0.set_center_freq(self.band_freq-self.freq+self.offset)
self._band_freq_text_box.set_value(self.band_freq)
- def set_adc_rate(self, adc_rate):
- self.adc_rate = adc_rate
- self.set_sample_rate(self.adc_rate/self.decim)
-
def set_saved_rx_gain(self, saved_rx_gain):
self.saved_rx_gain = saved_rx_gain
self.set_rx_gain(self.saved_rx_gain)
@@ -296,23 +348,16 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
self.saved_offset = saved_offset
self.set_offset(self.saved_offset)
- def set_sample_rate(self, sample_rate):
- self.sample_rate = sample_rate
- self.set_channel_decim(int(self.sample_rate/self.channel_rate))
- self.set_channel_taps(firdes.low_pass(10**1, self.sample_rate, 10e3, 2.5e3))
- self.wxgui_fftsink2_0.set_sample_rate(self.sample_rate)
-
def set_freq(self, freq):
self.freq = freq
- self.wxgui_fftsink2_1.set_baseband_freq(self.freq)
self.gr_freq_xlating_fir_filter_xxx_0.set_center_freq(self.band_freq-self.freq+self.offset)
+ self.wxgui_fftsink2_1.set_baseband_freq(self.freq)
self.set_freq_text(self.freq)
- def set_channel_rate(self, channel_rate):
- self.channel_rate = channel_rate
- self.set_channel_decim(int(self.sample_rate/self.channel_rate))
- self.wxgui_fftsink2_1.set_sample_rate(self.channel_rate)
- self.wxgui_scopesink2_0.set_sample_rate(self.channel_rate)
+ def set_channel_taps(self, channel_taps):
+ self.channel_taps = channel_taps
+ self.gr_freq_xlating_fir_filter_xxx_0.set_taps((self.channel_taps))
+ self.set_nchan_taps(len(self.channel_taps))
def set_rx_gain(self, rx_gain):
self.rx_gain = rx_gain
@@ -328,23 +373,28 @@ class usrp_rx_flex(grc_wxgui.top_block_gui):
def set_offset(self, offset):
self.offset = offset
+ self.gr_freq_xlating_fir_filter_xxx_0.set_center_freq(self.band_freq-self.freq+self.offset)
self._saved_offset_config = ConfigParser.ConfigParser()
self._saved_offset_config.read(self.config_filename)
if not self._saved_offset_config.has_section("gr-pager"):
self._saved_offset_config.add_section("gr-pager")
self._saved_offset_config.set("gr-pager", "freq_offset", str(self.offset))
self._saved_offset_config.write(open(self.config_filename, 'w'))
- self.gr_freq_xlating_fir_filter_xxx_0.set_center_freq(self.band_freq-self.freq+self.offset)
self._offset_slider.set_value(self.offset)
self._offset_text_box.set_value(self.offset)
+ def set_nchan_taps(self, nchan_taps):
+ self.nchan_taps = nchan_taps
+
+ def set_ma_ntaps(self, ma_ntaps):
+ self.ma_ntaps = ma_ntaps
+
def set_freq_text(self, freq_text):
self.freq_text = freq_text
self._freq_text_static_text.set_value(self.freq_text)
- def set_channel_taps(self, channel_taps):
- self.channel_taps = channel_taps
- self.gr_freq_xlating_fir_filter_xxx_0.set_taps((self.channel_taps))
+ def set_demod_k(self, demod_k):
+ self.demod_k = demod_k
def set_channel_decim(self, channel_decim):
self.channel_decim = channel_decim