diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-11-06 12:26:57 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-11-06 13:05:26 -0500 |
commit | 0c9c16fb008b02a5af39fb22e18acfff2dbd933a (patch) | |
tree | 2a1d555a5b496f84eaf7f360b1cc50b64ab0fd03 | |
parent | 463b962fe280c5515947498b4d0f4fd3b5993662 (diff) |
all: Python, GRC, and examples to properly pull blocks from filter and analog.
25 files changed, 535 insertions, 705 deletions
diff --git a/gr-digital/examples/narrowband/rx_voice.py b/gr-digital/examples/narrowband/rx_voice.py index 100caff8ea..079f8cb9b9 100755 --- a/gr-digital/examples/narrowband/rx_voice.py +++ b/gr-digital/examples/narrowband/rx_voice.py @@ -20,7 +20,8 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blks2, audio, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -75,7 +76,7 @@ class my_top_block(gr.top_block): audio_rate = self.audio_tx.sample_rate usrp_rate = self.source.get_sample_rate() rrate = audio_rate / usrp_rate - self.resampler = blks2.pfb_arb_resampler_ccf(rrate) + self.resampler = filter.pfb.arb_resampler_ccf(rrate) self.connect(self.source, self.resampler, self.rxpath) diff --git a/gr-digital/python/qa_constellation.py b/gr-digital/python/qa_constellation.py index 750337a119..9d6f4c6427 100755 --- a/gr-digital/python/qa_constellation.py +++ b/gr-digital/python/qa_constellation.py @@ -23,7 +23,7 @@ import random from cmath import exp, pi, log -from gnuradio import gr, gr_unittest, blks2 +from gnuradio import gr, gr_unittest from utils import mod_codes import digital_swig as digital diff --git a/gr-digital/python/qa_constellation_receiver.py b/gr-digital/python/qa_constellation_receiver.py index 871df2da28..5490f16fdb 100755 --- a/gr-digital/python/qa_constellation_receiver.py +++ b/gr-digital/python/qa_constellation_receiver.py @@ -22,7 +22,7 @@ import random -from gnuradio import gr, blks2, gr_unittest +from gnuradio import gr, gr_unittest from utils import mod_codes, alignment import packet_utils import filter_swig as filter diff --git a/gr-fcd/CMakeLists.txt b/gr-fcd/CMakeLists.txt index 1185b3a32d..a1fcd040f7 100644 --- a/gr-fcd/CMakeLists.txt +++ b/gr-fcd/CMakeLists.txt @@ -36,6 +36,7 @@ if (LINUX) Boost_FOUND ENABLE_GR_CORE ENABLE_GR_AUDIO + ENABLE_GR_ANALOG LIBUSB_FOUND ) else() diff --git a/gr-fcd/examples/grc/fcd_nfm_rx.grc b/gr-fcd/examples/grc/fcd_nfm_rx.grc index 9dac3fcb85..98d06d9ef1 100644 --- a/gr-fcd/examples/grc/fcd_nfm_rx.grc +++ b/gr-fcd/examples/grc/fcd_nfm_rx.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sun May 8 18:05:32 2011</timestamp> + <timestamp>Tue Nov 6 12:24:50 2012</timestamp> <block> <key>options</key> <param> @@ -44,6 +44,10 @@ <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -375,10 +379,10 @@ </param> </block> <block> - <key>low_pass_filter</key> + <key>gr_multiply_const_vxx</key> <param> <key>id</key> - <value>low_pass_filter</value> + <value>gr_multiply_const_vxx_1</value> </param> <param> <key>_enabled</key> @@ -386,43 +390,19 @@ </param> <param> <key>type</key> - <value>fir_filter_ccf</value> - </param> - <param> - <key>decim</key> - <value>1</value> + <value>float</value> </param> <param> - <key>interp</key> - <value>1</value> + <key>const</key> + <value>af_gain</value> </param> <param> - <key>gain</key> + <key>vlen</key> <value>1</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>cutoff_freq</key> - <value>width/2</value> - </param> - <param> - <key>width</key> - <value>trans</value> - </param> - <param> - <key>win</key> - <value>firdes.WIN_HAMMING</value> - </param> - <param> - <key>beta</key> - <value>6.76</value> - </param> - <param> <key>_coordinate</key> - <value>(742, 258)</value> + <value>(674, 507)</value> </param> <param> <key>_rotation</key> @@ -430,26 +410,34 @@ </param> </block> <block> - <key>gr_simple_squelch_cc</key> + <key>audio_sink</key> <param> <key>id</key> - <value>gr_simple_squelch_cc_0</value> + <value>audio_sink</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>threshold</key> - <value>sql_lev</value> + <key>samp_rate</key> + <value>48000</value> </param> <param> - <key>alpha</key> - <value>1</value> + <key>device_name</key> + <value></value> + </param> + <param> + <key>ok_to_block</key> + <value>True</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> </param> <param> <key>_coordinate</key> - <value>(226, 499)</value> + <value>(882, 511)</value> </param> <param> <key>_rotation</key> @@ -457,34 +445,22 @@ </param> </block> <block> - <key>blks2_nbfm_rx</key> + <key>variable</key> <param> <key>id</key> - <value>nbfm_normal</value> + <value>samp_rate</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>audio_rate</key> - <value>48000</value> - </param> - <param> - <key>quad_rate</key> + <key>value</key> <value>96000</value> </param> <param> - <key>tau</key> - <value>75e-6</value> - </param> - <param> - <key>max_dev</key> - <value>5e3</value> - </param> - <param> <key>_coordinate</key> - <value>(441, 483)</value> + <value>(210, 12)</value> </param> <param> <key>_rotation</key> @@ -492,65 +468,54 @@ </param> </block> <block> - <key>gr_multiply_const_vxx</key> + <key>variable_slider</key> <param> <key>id</key> - <value>gr_multiply_const_vxx_1</value> + <value>sql_lev</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>const</key> - <value>af_gain</value> + <key>label</key> + <value>SQL</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>value</key> + <value>-100</value> </param> <param> - <key>_coordinate</key> - <value>(674, 507)</value> + <key>min</key> + <value>-100</value> </param> <param> - <key>_rotation</key> + <key>max</key> <value>0</value> </param> - </block> - <block> - <key>audio_sink</key> <param> - <key>id</key> - <value>audio_sink</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> + <key>num_steps</key> + <value>500</value> </param> <param> - <key>samp_rate</key> - <value>48000</value> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> </param> <param> - <key>device_name</key> - <value></value> + <key>converver</key> + <value>float_converter</value> </param> <param> - <key>ok_to_block</key> - <value>True</value> + <key>grid_pos</key> + <value>7,2,1,1</value> </param> <param> - <key>num_inputs</key> - <value>2</value> + <key>notebook</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(882, 511)</value> + <value>(328, 728)</value> </param> <param> <key>_rotation</key> @@ -561,7 +526,7 @@ <key>variable</key> <param> <key>id</key> - <value>samp_rate</value> + <value>xlate_filter_taps</value> </param> <param> <key>_enabled</key> @@ -569,11 +534,11 @@ </param> <param> <key>value</key> - <value>96000</value> + <value>firdes.low_pass(1, samp_rate, 48000, 5000, firdes.WIN_HAMMING, 6.76)</value> </param> <param> <key>_coordinate</key> - <value>(210, 12)</value> + <value>(428, 294)</value> </param> <param> <key>_rotation</key> @@ -581,78 +546,85 @@ </param> </block> <block> - <key>wxgui_fftsink2</key> + <key>variable_chooser</key> <param> <key>id</key> - <value>fftsink</value> + <value>display_selector</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>label</key> + <value>Spectrum</value> </param> <param> - <key>title</key> - <value></value> + <key>value</key> + <value>0</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> + <key>choices</key> + <value>[0, 1]</value> </param> <param> - <key>baseband_freq</key> - <value>rx_freq*display_selector</value> + <key>labels</key> + <value>['Baseband','RF']</value> </param> <param> - <key>y_per_div</key> - <value>10</value> + <key>type</key> + <value>drop_down</value> </param> <param> - <key>y_divs</key> - <value>10</value> + <key>style</key> + <value>wx.RA_HORIZONTAL</value> </param> <param> - <key>ref_level</key> - <value>0</value> + <key>grid_pos</key> + <value>5,0,1,1</value> </param> <param> - <key>ref_scale</key> - <value>1.0</value> + <key>notebook</key> + <value></value> </param> <param> - <key>fft_size</key> - <value>512</value> + <key>_coordinate</key> + <value>(481, 728)</value> </param> <param> - <key>fft_rate</key> - <value>15</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>variable_text_box</key> <param> - <key>peak_hold</key> - <value>False</value> + <key>id</key> + <value>freq</value> </param> <param> - <key>average</key> + <key>_enabled</key> <value>True</value> </param> <param> - <key>avg_alpha</key> - <value>0.5</value> + <key>label</key> + <value>FCD Freq</value> </param> <param> - <key>win</key> - <value>None</value> + <key>value</key> + <value>144470000</value> </param> <param> - <key>win_size</key> - <value>800,300</value> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>formatter</key> + <value>None</value> </param> <param> <key>grid_pos</key> - <value>0,0,5,4</value> + <value>5,1,1,1</value> </param> <param> <key>notebook</key> @@ -660,7 +632,7 @@ </param> <param> <key>_coordinate</key> - <value>(742, 24)</value> + <value>(339, 9)</value> </param> <param> <key>_rotation</key> @@ -671,7 +643,7 @@ <key>variable_slider</key> <param> <key>id</key> - <value>sql_lev</value> + <value>rf_gain</value> </param> <param> <key>_enabled</key> @@ -679,23 +651,23 @@ </param> <param> <key>label</key> - <value>SQL</value> + <value>RF</value> </param> <param> <key>value</key> - <value>-100</value> + <value>20</value> </param> <param> <key>min</key> - <value>-100</value> + <value>-5</value> </param> <param> <key>max</key> - <value>0</value> + <value>30</value> </param> <param> <key>num_steps</key> - <value>500</value> + <value>35</value> </param> <param> <key>style</key> @@ -707,7 +679,7 @@ </param> <param> <key>grid_pos</key> - <value>7,2,1,1</value> + <value>7,1,1,1</value> </param> <param> <key>notebook</key> @@ -715,7 +687,7 @@ </param> <param> <key>_coordinate</key> - <value>(328, 728)</value> + <value>(11, 725)</value> </param> <param> <key>_rotation</key> @@ -723,22 +695,54 @@ </param> </block> <block> - <key>variable</key> + <key>fcd_source_c</key> <param> <key>id</key> - <value>xlate_filter_taps</value> + <value>fcd_source_c_1</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>firdes.low_pass(1, samp_rate, 48000, 5000, firdes.WIN_HAMMING, 6.76)</value> + <key>device_name</key> + <value>hw:1</value> + </param> + <param> + <key>freq</key> + <value>freq</value> + </param> + <param> + <key>lna</key> + <value>rf_gain</value> + </param> + <param> + <key>mixer</key> + <value>+12</value> + </param> + <param> + <key>ppm</key> + <value>-120</value> + </param> + <param> + <key>dci</key> + <value>0.0</value> + </param> + <param> + <key>dcq</key> + <value>0.0</value> + </param> + <param> + <key>iq_phase</key> + <value>0.0</value> + </param> + <param> + <key>iq_gain</key> + <value>1.0</value> </param> <param> <key>_coordinate</key> - <value>(428, 294)</value> + <value>(165, 157)</value> </param> <param> <key>_rotation</key> @@ -746,93 +750,90 @@ </param> </block> <block> - <key>variable_chooser</key> + <key>wxgui_fftsink2</key> <param> <key>id</key> - <value>display_selector</value> + <value>fftsink</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>Spectrum</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>value</key> - <value>0</value> + <key>title</key> + <value></value> </param> <param> - <key>choices</key> - <value>[0, 1]</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>labels</key> - <value>['Baseband','RF']</value> + <key>baseband_freq</key> + <value>rx_freq*display_selector</value> </param> <param> - <key>type</key> - <value>drop_down</value> + <key>y_per_div</key> + <value>10</value> </param> <param> - <key>style</key> - <value>wx.RA_HORIZONTAL</value> + <key>y_divs</key> + <value>10</value> </param> <param> - <key>grid_pos</key> - <value>5,0,1,1</value> + <key>ref_level</key> + <value>0</value> </param> <param> - <key>notebook</key> - <value></value> + <key>ref_scale</key> + <value>1.0</value> </param> <param> - <key>_coordinate</key> - <value>(481, 728)</value> + <key>fft_size</key> + <value>512</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>fft_rate</key> + <value>15</value> </param> - </block> - <block> - <key>variable_text_box</key> <param> - <key>id</key> - <value>freq</value> + <key>peak_hold</key> + <value>False</value> </param> <param> - <key>_enabled</key> + <key>average</key> <value>True</value> </param> <param> - <key>label</key> - <value>FCD Freq</value> - </param> - <param> - <key>value</key> - <value>144470000</value> + <key>avg_alpha</key> + <value>0.5</value> </param> <param> - <key>converver</key> - <value>float_converter</value> + <key>win</key> + <value>None</value> </param> <param> - <key>formatter</key> - <value>None</value> + <key>win_size</key> + <value>800,300</value> </param> <param> <key>grid_pos</key> - <value>5,1,1,1</value> + <value>0,0,5,4</value> </param> <param> <key>notebook</key> <value></value> </param> <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> - <value>(339, 9)</value> + <value>(742, 24)</value> </param> <param> <key>_rotation</key> @@ -840,10 +841,10 @@ </param> </block> <block> - <key>gr_freq_xlating_fir_filter_xxx</key> + <key>freq_xlating_fir_filter_xxx</key> <param> <key>id</key> - <value>xlating_fir_filter</value> + <value>freq_xlating_fir_filter_xxx_0</value> </param> <param> <key>_enabled</key> @@ -871,7 +872,7 @@ </param> <param> <key>_coordinate</key> - <value>(433, 189)</value> + <value>(422, 173)</value> </param> <param> <key>_rotation</key> @@ -879,105 +880,116 @@ </param> </block> <block> - <key>variable_slider</key> + <key>blks2_nbfm_rx</key> <param> <key>id</key> - <value>rf_gain</value> + <value>nbfm_normal</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>RF</value> + <key>audio_rate</key> + <value>48000</value> </param> <param> - <key>value</key> - <value>20</value> + <key>quad_rate</key> + <value>96000</value> </param> <param> - <key>min</key> - <value>-5</value> + <key>tau</key> + <value>75e-6</value> </param> <param> - <key>max</key> - <value>30</value> + <key>max_dev</key> + <value>5e3</value> </param> <param> - <key>num_steps</key> - <value>35</value> + <key>_coordinate</key> + <value>(441, 483)</value> </param> <param> - <key>style</key> - <value>wx.SL_HORIZONTAL</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>low_pass_filter</key> <param> - <key>converver</key> - <value>float_converter</value> + <key>id</key> + <value>low_pass_filter</value> </param> <param> - <key>grid_pos</key> - <value>7,1,1,1</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>notebook</key> - <value></value> + <key>type</key> + <value>fir_filter_ccf</value> </param> <param> - <key>_coordinate</key> - <value>(11, 725)</value> + <key>decim</key> + <value>1</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>interp</key> + <value>1</value> </param> - </block> - <block> - <key>fcd_source_c</key> <param> - <key>id</key> - <value>fcd_source_c_1</value> + <key>gain</key> + <value>1</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>device_name</key> - <value>hw:1</value> + <key>cutoff_freq</key> + <value>width/2</value> </param> <param> - <key>freq</key> - <value>freq</value> + <key>width</key> + <value>trans</value> </param> <param> - <key>lna</key> - <value>rf_gain</value> + <key>win</key> + <value>firdes.WIN_HAMMING</value> </param> <param> - <key>ppm</key> - <value>-120</value> + <key>beta</key> + <value>6.76</value> </param> <param> - <key>dci</key> - <value>0.0</value> + <key>_coordinate</key> + <value>(742, 258)</value> </param> <param> - <key>dcq</key> - <value>0.0</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_simple_squelch_cc</key> <param> - <key>iq_phase</key> - <value>0.0</value> + <key>id</key> + <value>analog_simple_squelch_cc_0</value> </param> <param> - <key>iq_gain</key> - <value>1.0</value> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>threshold</key> + <value>sql_lev</value> + </param> + <param> + <key>alpha</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(165, 157)</value> + <value>(227, 499)</value> </param> <param> <key>_rotation</key> @@ -985,50 +997,50 @@ </param> </block> <connection> - <source_block_id>xlating_fir_filter</source_block_id> - <sink_block_id>fftsink</sink_block_id> + <source_block_id>gr_multiply_const_vxx_1</source_block_id> + <sink_block_id>audio_sink</sink_block_id> <source_key>0</source_key> - <sink_key>0</sink_key> + <sink_key>1</sink_key> </connection> <connection> - <source_block_id>xlating_fir_filter</source_block_id> - <sink_block_id>low_pass_filter</sink_block_id> + <source_block_id>gr_multiply_const_vxx_1</source_block_id> + <sink_block_id>audio_sink</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>low_pass_filter</source_block_id> - <sink_block_id>gr_simple_squelch_cc_0</sink_block_id> + <source_block_id>nbfm_normal</source_block_id> + <sink_block_id>gr_multiply_const_vxx_1</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_multiply_const_vxx_1</source_block_id> - <sink_block_id>audio_sink</sink_block_id> + <source_block_id>fcd_source_c_1</source_block_id> + <sink_block_id>freq_xlating_fir_filter_xxx_0</sink_block_id> <source_key>0</source_key> - <sink_key>1</sink_key> + <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_multiply_const_vxx_1</source_block_id> - <sink_block_id>audio_sink</sink_block_id> + <source_block_id>freq_xlating_fir_filter_xxx_0</source_block_id> + <sink_block_id>fftsink</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_simple_squelch_cc_0</source_block_id> - <sink_block_id>nbfm_normal</sink_block_id> + <source_block_id>freq_xlating_fir_filter_xxx_0</source_block_id> + <sink_block_id>low_pass_filter</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>nbfm_normal</source_block_id> - <sink_block_id>gr_multiply_const_vxx_1</sink_block_id> + <source_block_id>analog_simple_squelch_cc_0</source_block_id> + <sink_block_id>nbfm_normal</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>fcd_source_c_1</source_block_id> - <sink_block_id>xlating_fir_filter</sink_block_id> + <source_block_id>low_pass_filter</source_block_id> + <sink_block_id>analog_simple_squelch_cc_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-filter/apps/gr_filter_design b/gr-filter/apps/gr_filter_design index cc21ea5e76..6de52f4cb9 100755 --- a/gr-filter/apps/gr_filter_design +++ b/gr-filter/apps/gr_filter_design @@ -2,7 +2,8 @@ import sys, os, re, csv from optparse import OptionParser -from gnuradio import gr, blks2, eng_notation +from gnuradio import gr, eng_notation +from gnuradio import filter try: import scipy @@ -477,8 +478,8 @@ class gr_plot_filter(QtGui.QMainWindow): if(ret): try: - taps = blks2.optfir.low_pass(gain, fs, pb, sb, - ripple, atten) + taps = filter.optfir.low_pass(gain, fs, pb, sb, + ripple, atten) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") @@ -508,8 +509,8 @@ class gr_plot_filter(QtGui.QMainWindow): sb1 = pb1 - tb sb2 = pb2 + tb try: - taps = blks2.optfir.band_pass(gain, fs, sb1, pb1, pb2, sb2, - ripple, atten) + taps = filter.optfir.band_pass(gain, fs, sb1, pb1, pb2, sb2, + ripple, atten) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") @@ -541,8 +542,8 @@ class gr_plot_filter(QtGui.QMainWindow): sb1 = pb1 - tb sb2 = pb2 + tb try: - taps = blks2.optfir.complex_band_pass(gain, fs, sb1, pb1, pb2, sb2, - ripple, atten) + taps = filter.optfir.complex_band_pass(gain, fs, sb1, pb1, pb2, sb2, + ripple, atten) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") @@ -573,8 +574,8 @@ class gr_plot_filter(QtGui.QMainWindow): pb1 = sb1 - tb pb2 = sb2 + tb try: - taps = blks2.optfir.band_reject(gain, fs, pb1, sb1, sb2, pb2, - ripple, atten) + taps = filter.optfir.band_reject(gain, fs, pb1, sb1, sb2, pb2, + ripple, atten) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") @@ -601,8 +602,8 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): try: - taps = blks2.optfir.high_pass(gain, fs, sb, pb, - atten, ripple) + taps = filter.optfir.high_pass(gain, fs, sb, pb, + atten, ripple) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") diff --git a/gr-filter/examples/channelize.py b/gr-filter/examples/channelize.py index 1f784d9b06..1745b3f7af 100755 --- a/gr-filter/examples/channelize.py +++ b/gr-filter/examples/channelize.py @@ -20,22 +20,28 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blks2 +from gnuradio import gr from gnuradio import filter import sys, time try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy from scipy import fftpack except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab from pylab import mlab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) class pfb_top_block(gr.top_block): @@ -66,7 +72,7 @@ class pfb_top_block(gr.top_block): freqs = [-70, -50, -30, -10, 10, 20, 40, 60, 80] for i in xrange(len(freqs)): f = freqs[i] + (M/2-M+i+1)*self._fs - self.signals.append(gr.sig_source_c(self._ifs, gr.GR_SIN_WAVE, f, 1)) + self.signals.append(analog.sig_source_c(self._ifs, analog.GR_SIN_WAVE, f, 1)) self.connect(self.signals[i], (self.add,i)) self.head = gr.head(gr.sizeof_gr_complex, self._N) diff --git a/gr-filter/examples/chirp_channelize.py b/gr-filter/examples/chirp_channelize.py index 3638c55d1a..e52a44dde4 100755 --- a/gr-filter/examples/chirp_channelize.py +++ b/gr-filter/examples/chirp_channelize.py @@ -20,22 +20,28 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blks2 +from gnuradio import gr from gnuradio import filter import sys, time try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy from scipy import fftpack except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab from pylab import mlab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) class pfb_top_block(gr.top_block): @@ -59,7 +65,7 @@ class pfb_top_block(gr.top_block): repeated = True if(repeated): - self.vco_input = gr.sig_source_f(self._fs, gr.GR_SIN_WAVE, 0.25, 110) + self.vco_input = analog.sig_source_f(self._fs, analog.GR_SIN_WAVE, 0.25, 110) else: amp = 100 data = scipy.arange(0, amp, amp/float(self._N)) diff --git a/gr-filter/examples/fmtest.py b/gr-filter/examples/fmtest.py deleted file mode 100755 index 7b7489335b..0000000000 --- a/gr-filter/examples/fmtest.py +++ /dev/null @@ -1,225 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2009,2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, blks2, filter -import sys, math, time - -try: - import scipy - from scipy import fftpack -except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." - sys.exit(1) - -try: - import pylab -except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." - sys.exit(1) - - -class fmtx(gr.hier_block2): - def __init__(self, lo_freq, audio_rate, if_rate): - - gr.hier_block2.__init__(self, "build_fm", - gr.io_signature(1, 1, gr.sizeof_float), - gr.io_signature(1, 1, gr.sizeof_gr_complex)) - - fmtx = blks2.nbfm_tx (audio_rate, if_rate, max_dev=5e3, tau=75e-6) - - # Local oscillator - lo = gr.sig_source_c (if_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - lo_freq, #frequency - 1.0, # amplitude - 0) # DC Offset - mixer = gr.multiply_cc () - - self.connect (self, fmtx, (mixer, 0)) - self.connect (lo, (mixer, 1)) - self.connect (mixer, self) - -class fmtest(gr.top_block): - def __init__(self): - gr.top_block.__init__(self) - - self._nsamples = 1000000 - self._audio_rate = 8000 - - # Set up N channels with their own baseband and IF frequencies - self._N = 5 - chspacing = 16000 - freq = [10, 20, 30, 40, 50] - f_lo = [0, 1*chspacing, -1*chspacing, 2*chspacing, -2*chspacing] - - self._if_rate = 4*self._N*self._audio_rate - - # Create a signal source and frequency modulate it - self.sum = gr.add_cc () - for n in xrange(self._N): - sig = gr.sig_source_f(self._audio_rate, gr.GR_SIN_WAVE, freq[n], 0.5) - fm = fmtx(f_lo[n], self._audio_rate, self._if_rate) - self.connect(sig, fm) - self.connect(fm, (self.sum, n)) - - self.head = gr.head(gr.sizeof_gr_complex, self._nsamples) - self.snk_tx = gr.vector_sink_c() - self.channel = filter.channel_model(0.1) - - self.connect(self.sum, self.head, self.channel, self.snk_tx) - - - # Design the channlizer - self._M = 10 - bw = chspacing/2.0 - t_bw = chspacing/10.0 - self._chan_rate = self._if_rate / self._M - self._taps = filter.firdes.low_pass_2(1, self._if_rate, bw, t_bw, - attenuation_dB=100, - window=filter.firdes.WIN_BLACKMAN_hARRIS) - tpc = math.ceil(float(len(self._taps)) / float(self._M)) - - print "Number of taps: ", len(self._taps) - print "Number of channels: ", self._M - print "Taps per channel: ", tpc - - self.pfb = filter.pfb.channelizer_ccf(self._M, self._taps) - - self.connect(self.channel, self.pfb) - - # Create a file sink for each of M output channels of the filter and connect it - self.fmdet = list() - self.squelch = list() - self.snks = list() - for i in xrange(self._M): - self.fmdet.append(blks2.nbfm_rx(self._audio_rate, self._chan_rate)) - self.squelch.append(blks2.standard_squelch(self._audio_rate*10)) - self.snks.append(gr.vector_sink_f()) - self.connect((self.pfb, i), self.fmdet[i], self.squelch[i], self.snks[i]) - - def num_tx_channels(self): - return self._N - - def num_rx_channels(self): - return self._M - -def main(): - - fm = fmtest() - - tstart = time.time() - fm.run() - tend = time.time() - - if 1: - fig1 = pylab.figure(1, figsize=(12,10), facecolor="w") - fig2 = pylab.figure(2, figsize=(12,10), facecolor="w") - fig3 = pylab.figure(3, figsize=(12,10), facecolor="w") - - Ns = 10000 - Ne = 100000 - - fftlen = 8192 - winfunc = scipy.blackman - - # Plot transmitted signal - fs = fm._if_rate - - d = fm.snk_tx.data()[Ns:Ns+Ne] - sp1_f = fig1.add_subplot(2, 1, 1) - - X,freq = sp1_f.psd(d, NFFT=fftlen, noverlap=fftlen/4, Fs=fs, - window = lambda d: d*winfunc(fftlen), - visible=False) - X_in = 10.0*scipy.log10(abs(fftpack.fftshift(X))) - f_in = scipy.arange(-fs/2.0, fs/2.0, fs/float(X_in.size)) - p1_f = sp1_f.plot(f_in, X_in, "b") - sp1_f.set_xlim([min(f_in), max(f_in)+1]) - sp1_f.set_ylim([-120.0, 20.0]) - - sp1_f.set_title("Input Signal", weight="bold") - sp1_f.set_xlabel("Frequency (Hz)") - sp1_f.set_ylabel("Power (dBW)") - - Ts = 1.0/fs - Tmax = len(d)*Ts - - t_in = scipy.arange(0, Tmax, Ts) - x_in = scipy.array(d) - sp1_t = fig1.add_subplot(2, 1, 2) - p1_t = sp1_t.plot(t_in, x_in.real, "b-o") - #p1_t = sp1_t.plot(t_in, x_in.imag, "r-o") - sp1_t.set_ylim([-5, 5]) - - # Set up the number of rows and columns for plotting the subfigures - Ncols = int(scipy.floor(scipy.sqrt(fm.num_rx_channels()))) - Nrows = int(scipy.floor(fm.num_rx_channels() / Ncols)) - if(fm.num_rx_channels() % Ncols != 0): - Nrows += 1 - - # Plot each of the channels outputs. Frequencies on Figure 2 and - # time signals on Figure 3 - fs_o = fm._audio_rate - for i in xrange(len(fm.snks)): - # remove issues with the transients at the beginning - # also remove some corruption at the end of the stream - # this is a bug, probably due to the corner cases - d = fm.snks[i].data()[Ns:Ne] - - sp2_f = fig2.add_subplot(Nrows, Ncols, 1+i) - X,freq = sp2_f.psd(d, NFFT=fftlen, noverlap=fftlen/4, Fs=fs_o, - window = lambda d: d*winfunc(fftlen), - visible=False) - #X_o = 10.0*scipy.log10(abs(fftpack.fftshift(X))) - X_o = 10.0*scipy.log10(abs(X)) - #f_o = scipy.arange(-fs_o/2.0, fs_o/2.0, fs_o/float(X_o.size)) - f_o = scipy.arange(0, fs_o/2.0, fs_o/2.0/float(X_o.size)) - p2_f = sp2_f.plot(f_o, X_o, "b") - sp2_f.set_xlim([min(f_o), max(f_o)+0.1]) - sp2_f.set_ylim([-120.0, 20.0]) - sp2_f.grid(True) - - sp2_f.set_title(("Channel %d" % i), weight="bold") - sp2_f.set_xlabel("Frequency (kHz)") - sp2_f.set_ylabel("Power (dBW)") - - - Ts = 1.0/fs_o - Tmax = len(d)*Ts - t_o = scipy.arange(0, Tmax, Ts) - - x_t = scipy.array(d) - sp2_t = fig3.add_subplot(Nrows, Ncols, 1+i) - p2_t = sp2_t.plot(t_o, x_t.real, "b") - p2_t = sp2_t.plot(t_o, x_t.imag, "r") - sp2_t.set_xlim([min(t_o), max(t_o)+1]) - sp2_t.set_ylim([-1, 1]) - - sp2_t.set_xlabel("Time (s)") - sp2_t.set_ylabel("Amplitude") - - - pylab.show() - - -if __name__ == "__main__": - main() diff --git a/gr-filter/examples/synth_to_chan.py b/gr-filter/examples/synth_to_chan.py index b5f4c958ef..bd39a17e59 100755 --- a/gr-filter/examples/synth_to_chan.py +++ b/gr-filter/examples/synth_to_chan.py @@ -25,15 +25,21 @@ from gnuradio import filter import sys try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) def main(): @@ -46,8 +52,8 @@ def main(): sigs = list() fmtx = list() for fi in freqs: - s = gr.sig_source_f(fs, gr.GR_SIN_WAVE, fi, 1) - fm = blks2.nbfm_tx (fs, 4*fs, max_dev=10000, tau=75e-6) + s = analog.sig_source_f(fs, gr.GR_SIN_WAVE, fi, 1) + fm = analog.nbfm_tx(fs, 4*fs, max_dev=10000, tau=75e-6) sigs.append(s) fmtx.append(fm) @@ -62,7 +68,7 @@ def main(): noise_level = 0.01 head = gr.head(gr.sizeof_gr_complex, N) - noise = gr.noise_source_c(gr.GR_GAUSSIAN, noise_level) + noise = analog.noise_source_c(gr.GR_GAUSSIAN, noise_level) addnoise = gr.add_cc() snk_synth = gr.vector_sink_c() diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt index 8d5c3a8849..23fef3a485 100644 --- a/gr-uhd/CMakeLists.txt +++ b/gr-uhd/CMakeLists.txt @@ -32,6 +32,8 @@ GR_REGISTER_COMPONENT("gr-uhd" ENABLE_GR_UHD Boost_FOUND UHD_FOUND ENABLE_GR_CORE + ENABLE_GR_FILTER + ENABLE_GR_ANALOG ) GR_SET_GLOBAL(GR_UHD_INCLUDE_DIRS diff --git a/gr-uhd/apps/uhd_rx_nogui b/gr-uhd/apps/uhd_rx_nogui index cb6238353e..c348ba23f5 100755 --- a/gr-uhd/apps/uhd_rx_nogui +++ b/gr-uhd/apps/uhd_rx_nogui @@ -20,7 +20,8 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gru, uhd, optfir, audio, blks2 +from gnuradio import gr, gru, uhd, audio, blks2 +from gnuradio import filter from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option @@ -70,9 +71,9 @@ blocks. # (device_rate, channel_rate, audio_rate, channel_pass, channel_stop, demod) demod_params = { - 'AM' : (256e3, 16e3, 16e3, 5000, 8000, blks2.demod_10k0a3e_cf), - 'FM' : (256e3, 32e3, 8e3, 8000, 9000, blks2.demod_20k0f3e_cf), - 'WFM' : (320e3, 320e3, 32e3, 80000, 115000, blks2.demod_200kf3e_cf) + 'AM' : (256e3, 16e3, 16e3, 5000, 8000, analog.demod_10k0a3e_cf), + 'FM' : (256e3, 32e3, 8e3, 8000, 9000, analog.demod_20k0f3e_cf), + 'WFM' : (320e3, 320e3, 32e3, 80000, 115000, analog.demod_200kf3e_cf) } class uhd_src(gr.hier_block2): @@ -105,7 +106,7 @@ class uhd_src(gr.hier_block2): # Resampler to get to exactly samp_rate no matter what dev_rate is self._rrate = samp_rate / dev_rate - self._resamp = blks2.pfb_arb_resampler_ccf(self._rrate) + self._resamp = filter.pfb.arb_resampler_ccf(self._rrate) # If no gain specified, set to midrange gain_range = self._src.get_gain_range() @@ -143,22 +144,22 @@ class app_top_block(gr.top_block): channel_decim = int(if_rate // channel_rate) audio_decim = int(channel_rate // audio_rate) - CHAN_taps = optfir.low_pass(1.0, # Filter gain - if_rate, # Sample rate - channel_pass, # One sided modulation bandwidth - channel_stop, # One sided channel bandwidth - 0.1, # Passband ripple - 60) # Stopband attenuation + CHAN_taps = filter.optfir.low_pass(1.0, # Filter gain + if_rate, # Sample rate + channel_pass, # One sided modulation bandwidth + channel_stop, # One sided channel bandwidth + 0.1, # Passband ripple + 60) # Stopband attenuation - CHAN = gr.freq_xlating_fir_filter_ccf(channel_decim, # Decimation rate - CHAN_taps, # Filter taps - 0.0, # Offset frequency - if_rate) # Sample rate + CHAN = filter.freq_xlating_fir_filter_ccf(channel_decim, # Decimation rate + CHAN_taps, # Filter taps + 0.0, # Offset frequency + if_rate) # Sample rate - RFSQL = gr.pwr_squelch_cc(options.rf_squelch, # Power threshold - 125.0/channel_rate, # Time constant - int(channel_rate/20), # 50ms rise/fall - False) # Zero, not gate output + RFSQL = analog.pwr_squelch_cc(options.rf_squelch, # Power threshold + 125.0/channel_rate, # Time constant + int(channel_rate/20), # 50ms rise/fall + False) # Zero, not gate output AGC = analog.agc_cc(1.0/channel_rate, # Time constant 1.0, # Reference power @@ -174,8 +175,8 @@ class app_top_block(gr.top_block): # Optionally add CTCSS and RSAMP if needed tail = DEMOD if options.ctcss != None and options.ctcss > 60.0: - CTCSS = gr.ctcss_squelch_ff(audio_rate, # Sample rate - options.ctcss) # Squelch tone + CTCSS = analog.ctcss_squelch_ff(audio_rate, # Sample rate + options.ctcss) # Squelch tone self.connect(DEMOD, CTCSS) tail = CTCSS diff --git a/gr-uhd/doc/uhd.dox b/gr-uhd/doc/uhd.dox index f03705fe18..4cd30a86b6 100644 --- a/gr-uhd/doc/uhd.dox +++ b/gr-uhd/doc/uhd.dox @@ -92,10 +92,10 @@ resampler to take care of the difference. actual_rate = self.u.get_samp_rate() resample = desired_rate / actual_rate - # Use the blks2 version and pass only the resample factor. + # Use the filter.pfb version and pass only the resample factor. # This block builds a half-band filter for you - self.resampler = blks2.pfb_arb_resampler_ccf(resample) + self.resampler = filter.pfb.arb_resampler_ccf(resample) \endcode */ diff --git a/gr-uhd/examples/python/fm_tx4.py b/gr-uhd/examples/python/fm_tx4.py index 255b436f56..ae3e1b94f3 100755 --- a/gr-uhd/examples/python/fm_tx4.py +++ b/gr-uhd/examples/python/fm_tx4.py @@ -34,7 +34,7 @@ audio_to_file.py from gnuradio import gr, eng_notation from gnuradio import uhd -from gnuradio import blks2 +from gnuradio import analog from gnuradio.eng_option import eng_option from optparse import OptionParser import math @@ -62,19 +62,19 @@ class pipeline(gr.hier_block2): sys.exit(1) print audio_rate, if_rate - fmtx = blks2.nbfm_tx (audio_rate, if_rate, max_dev=5e3, tau=75e-6) + fmtx = analog.nbfm_tx(audio_rate, if_rate, max_dev=5e3, tau=75e-6) # Local oscillator - lo = gr.sig_source_c (if_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - lo_freq, #frequency - 1.0, # amplitude - 0) # DC Offset - mixer = gr.multiply_cc () - - self.connect (src, fmtx, (mixer, 0)) - self.connect (lo, (mixer, 1)) - self.connect (mixer, self) + lo = analog.sig_source_c(if_rate, # sample rate + analog.GR_SIN_WAVE, # waveform type + lo_freq, # frequency + 1.0, # amplitude + 0) # DC Offset + mixer = gr.multiply_cc() + + self.connect(src, fmtx, (mixer, 0)) + self.connect(lo, (mixer, 1)) + self.connect(mixer, self) class fm_tx_block(stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): diff --git a/gr-uhd/examples/python/fm_tx_2_daughterboards.py b/gr-uhd/examples/python/fm_tx_2_daughterboards.py index d98d655ab1..f896be6d04 100755 --- a/gr-uhd/examples/python/fm_tx_2_daughterboards.py +++ b/gr-uhd/examples/python/fm_tx_2_daughterboards.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -30,7 +30,9 @@ Side A is 600 Hz tone. Side B is 350 + 440 Hz tones. """ -from gnuradio import gr, uhd, blks2 +from gnuradio import gr, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_notation import num_to_str, str_to_num from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -47,11 +49,11 @@ class example_signal_0(gr.hier_block2): gr.io_signature(0, 0, 0), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature - src = gr.sig_source_c (sample_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - 600, # frequency - 1.0, # amplitude - 0) # DC Offset + src = analog.sig_source_c(sample_rate, # sample rate + analog.GR_SIN_WAVE, # waveform type + 600, # frequency + 1.0, # amplitude + 0) # DC Offset self.connect(src, self) @@ -65,17 +67,17 @@ class example_signal_1(gr.hier_block2): gr.io_signature(0, 0, 0), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature - src0 = gr.sig_source_c (sample_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - 350, # frequency - 1.0, # amplitude - 0) # DC Offset - - src1 = gr.sig_source_c (sample_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - 440, # frequency - 1.0, # amplitude - 0) # DC Offset + src0 = analog.sig_source_c(sample_rate, # sample rate + analog.GR_SIN_WAVE, # waveform type + 350, # frequency + 1.0, # amplitude + 0) # DC Offset + + src1 = analog.sig_source_c(sample_rate, # sample rate + analog.GR_SIN_WAVE, # waveform type + 440, # frequency + 1.0, # amplitude + 0) # DC Offset sum = gr.add_cc() self.connect(src0, (sum, 0)) self.connect(src1, (sum, 1)) @@ -86,7 +88,7 @@ class my_top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self) - usage="%prog: [options] tx-freq0 tx-freq1" + usage = "%prog: [options] tx-freq0 tx-freq1" parser = OptionParser (option_class=eng_option, usage=usage) parser.add_option("-a", "--args", type="string", default="", help="UHD device address args [default=%default]") @@ -158,7 +160,7 @@ class my_top_block(gr.top_block): # Correct for any difference in requested and actual rates rrate = self.usrp_rate / dev_rate - resamp = blks2.pfb_arb_resampler_ccf(rrate) + resamp = filter.pfb.arb_resampler_ccf(rrate) # and wire them up self.connect(intl, resamp, self.u) diff --git a/gr-uhd/examples/python/usrp_am_mw_rcv.py b/gr-uhd/examples/python/usrp_am_mw_rcv.py index 6965ef5af9..a389e173f8 100755 --- a/gr-uhd/examples/python/usrp_am_mw_rcv.py +++ b/gr-uhd/examples/python/usrp_am_mw_rcv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,11 +20,11 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, eng_notation, optfir +from gnuradio import gr, eng_notation +from gnuradio import filter from gnuradio import analog from gnuradio import audio from gnuradio import uhd -from gnuradio import blks2 from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -97,36 +97,36 @@ class wfm_rx_block (stdgui2.std_top_block): # Resample signal to exactly self.usrp_rate # FIXME: make one of the follow-on filters an arb resampler rrate = usrp_rate / dev_rate - self.resamp = blks2.pfb_arb_resampler_ccf(rrate) + self.resamp = filter.pfb.arb_resampler_ccf(rrate) - chan_filt_coeffs = gr.firdes.low_pass_2 (1, # gain - usrp_rate, # sampling rate - 8e3, # passband cutoff - 4e3, # transition bw - 60) # stopband attenuation + chan_filt_coeffs = filter.firdes.low_pass_2(1, # gain + usrp_rate, # sampling rate + 8e3, # passband cutoff + 4e3, # transition bw + 60) # stopband attenuation if self.use_IF: # Turn If to baseband and filter. - self.chan_filt = gr.freq_xlating_fir_filter_ccf (chanfilt_decim, - chan_filt_coeffs, - self.IF_freq, - usrp_rate) + self.chan_filt = filter.freq_xlating_fir_filter_ccf(chanfilt_decim, + chan_filt_coeffs, + self.IF_freq, + usrp_rate) else: - self.chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs) + self.chan_filt = filter.fir_filter_ccf(chanfilt_decim, chan_filt_coeffs) self.agc = analog.agc_cc(0.1, 1, 1, 100000) self.am_demod = gr.complex_to_mag() self.volume_control = gr.multiply_const_ff(self.vol) - audio_filt_coeffs = gr.firdes.low_pass_2 (1, # gain - demod_rate, # sampling rate - 8e3, # passband cutoff - 2e3, # transition bw - 60) # stopband attenuation - self.audio_filt=gr.fir_filter_fff(audio_decim, audio_filt_coeffs) + audio_filt_coeffs = filter.firdes.low_pass_2(1, # gain + demod_rate, # sampling rate + 8e3, # passband cutoff + 2e3, # transition bw + 60) # stopband attenuation + self.audio_filt = filter.fir_filter_fff(audio_decim, audio_filt_coeffs) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), + self.audio_sink = audio.sink(int (audio_rate), options.audio_output, False) # ok_to_block diff --git a/gr-uhd/examples/python/usrp_nbfm_ptt.py b/gr-uhd/examples/python/usrp_nbfm_ptt.py index af4c214795..d377e3a0a2 100755 --- a/gr-uhd/examples/python/usrp_nbfm_ptt.py +++ b/gr-uhd/examples/python/usrp_nbfm_ptt.py @@ -25,7 +25,8 @@ import sys import wx from optparse import OptionParser -from gnuradio import gr, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import stdgui2, fftsink2, scopesink2, slider, form @@ -317,15 +318,15 @@ class transmit_path(gr.hier_block2): audio_taps = convolve(array(lpf),array(hpf)) self.audio_filt = gr.fir_filter_fff(1,audio_taps) - self.pl = blks2.ctcss_gen_f(self.audio_rate,123.0) + self.pl = analog.ctcss_gen_f(self.audio_rate,123.0) self.add_pl = gr.add_ff() self.connect(self.pl,(self.add_pl,1)) - self.fmtx = blks2.nbfm_tx(self.audio_rate, self.if_rate) + self.fmtx = analog.nbfm_tx(self.audio_rate, self.if_rate) self.amp = gr.multiply_const_cc (self.normal_gain) rrate = dev_rate / self.if_rate - self.resamp = blks2.pfb_arb_resampler_ccf(rrate) + self.resamp = filter.pfb.arb_resampler_ccf(rrate) self.connect(self.audio, self.audio_amp, self.audio_filt, (self.add_pl,0), self.fmtx, self.amp, @@ -395,23 +396,23 @@ class receive_path(gr.hier_block2): gr.firdes.WIN_HANN) # filter type rrate = self.quad_rate / dev_rate - self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.resamp = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) # instantiate the guts of the single channel receiver - self.fmrx = blks2.nbfm_rx(self.audio_rate, self.quad_rate) + self.fmrx = analog.nbfm_rx(self.audio_rate, self.quad_rate) # standard squelch block - self.squelch = blks2.standard_squelch(self.audio_rate) + self.squelch = analog.standard_squelch(self.audio_rate) # audio gain / mute block self._audio_gain = gr.multiply_const_ff(1.0) # sound card as final sink - audio_sink = audio.sink (int(self.audio_rate), audio_output) + audio_sink = audio.sink(int(self.audio_rate), audio_output) # now wire it all together - self.connect (self.u, self.resamp, self.fmrx, self.squelch, - self._audio_gain, audio_sink) + self.connect(self.u, self.resamp, self.fmrx, self.squelch, + self._audio_gain, audio_sink) if gain is None: # if no gain was specified, use the mid-point in dB diff --git a/gr-uhd/examples/python/usrp_nbfm_rcv.py b/gr-uhd/examples/python/usrp_nbfm_rcv.py index 4a8340ec7b..1a06e7d06d 100755 --- a/gr-uhd/examples/python/usrp_nbfm_rcv.py +++ b/gr-uhd/examples/python/usrp_nbfm_rcv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005,2007,2011 Free Software Foundation, Inc. +# Copyright 2005,2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -285,21 +287,21 @@ class receive_path(gr.hier_block2): # Create filter to get actual channel we want nfilts = 32 - chan_coeffs = gr.firdes.low_pass (nfilts, # gain - nfilts*dev_rate, # sampling rate - 8e3, # low pass cutoff freq - 2e3, # width of trans. band - gr.firdes.WIN_HANN) # filter type + chan_coeffs = filter.firdes.low_pass(nfilts, # gain + nfilts*dev_rate, # sampling rate + 8e3, # low pass cutoff freq + 2e3, # width of trans. band + filter.firdes.WIN_HANN) # filter type rrate = self.quad_rate / dev_rate - self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.resamp = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) if USE_SIMPLE_SQUELCH: - self.squelch = gr.simple_squelch_cc(20) + self.squelch = analog.simple_squelch_cc(20) else: - self.squelch = blks2.standard_squelch(self.audio_rate) + self.squelch = analog.standard_squelch(self.audio_rate) # instantiate the guts of the single channel receiver - self.fmrx = blks2.nbfm_rx(self.audio_rate, self.quad_rate) + self.fmrx = analog.nbfm_rx(self.audio_rate, self.quad_rate) # audio gain / mute block self._audio_gain = gr.multiply_const_ff(1.0) diff --git a/gr-uhd/examples/python/usrp_wfm_rcv.py b/gr-uhd/examples/python/usrp_wfm_rcv.py index a7d114d8cc..824af8975c 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2009,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2009,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, optfir, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -88,27 +90,27 @@ class wfm_rx_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = optfir.low_pass (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 80e3, # passband cutoff - 115e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation + chan_coeffs = filter.optfir.low_pass(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 80e3, # passband cutoff + 115e3, # stopband cutoff + 0.1, # passband ripple + 60) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv (demod_rate, audio_decim) + self.guts = analog.wfm_rcv(demod_rate, audio_decim) self.volume_control = gr.multiply_const_ff(self.vol) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), - options.audio_output, - False) # ok_to_block + self.audio_sink = audio.sink(int (audio_rate), + options.audio_output, + False) # ok_to_block # now wire it all together - self.connect (self.u, self.chan_filt, self.guts, - self.volume_control, self.audio_sink) + self.connect(self.u, self.chan_filt, self.guts, + self.volume_control, self.audio_sink) self._build_gui(vbox, usrp_rate, demod_rate, audio_rate) diff --git a/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py index f7e72ae6f9..e76c78e017 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from optparse import OptionParser import sys @@ -94,12 +96,12 @@ class wfm_rx_block (gr.top_block): # taps for channel filter nfilts = 32 - chan_coeffs = optfir.low_pass (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 80e3, # passband cutoff - 115e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation + chan_coeffs = filter.optfir.low_pass(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 80e3, # passband cutoff + 115e3, # stopband cutoff + 0.1, # passband ripple + 60) # stopband attenuation rrate = usrp_rate / dev_rate # set front end PLL to middle frequency @@ -111,8 +113,8 @@ class wfm_rx_block (gr.top_block): options.gain = float(g.start()+g.stop())/2.0 for n in range(2): - chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) - guts = blks2.wfm_rcv (demod_rate, audio_decim) + chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) + guts = analog.wfm_rcv(demod_rate, audio_decim) volume_control = gr.multiply_const_ff(self.vol) #self.connect((self.di, n), chan_filt) diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py index b794825727..97bd2b2d32 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form, scopesink2 @@ -90,31 +92,31 @@ class wfm_rx_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = gr.firdes.low_pass_2(10*nfilts, # gain - nfilts*usrp_rate, # sampling rate - 90e3, # passband cutoff - 30e3, # transition bw - 70) # stopband attenuation + chan_coeffs = filter.firdes.low_pass_2(10*nfilts, # gain + nfilts*usrp_rate, # sampling rate + 90e3, # passband cutoff + 30e3, # transition bw + 70) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv_fmdet (demod_rate, audio_decim) + self.guts = analog.wfm_rcv_fmdet (demod_rate, audio_decim) chan_rate = audio_rate / (demod_rate/audio_decim) - self.rchan_filt = blks2.pfb_arb_resampler_fff(chan_rate) - self.lchan_filt = blks2.pfb_arb_resampler_fff(chan_rate) + self.rchan_filt = filter.pfb.arb_resampler_fff(chan_rate) + self.lchan_filt = filter.pfb.arb_resampler_fff(chan_rate) # FIXME rework {add,multiply}_const_* to handle multiple streams self.volume_control_l = gr.multiply_const_ff(self.vol) self.volume_control_r = gr.multiply_const_ff(self.vol) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), - options.audio_output, - False) # ok_to_block + self.audio_sink = audio.sink(int (audio_rate), + options.audio_output, + False) # ok_to_block # now wire it all together - self.connect (self.u, self.chan_filt, self.guts) + self.connect(self.u, self.chan_filt, self.guts) self.connect((self.guts, 0), self.lchan_filt, self.volume_control_l, (self.audio_sink,0)) self.connect((self.guts, 1), self.rchan_filt, diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py index 6e9c830c61..f2271fb6db 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, optfir, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -82,16 +84,16 @@ class wfm_rx_block (gr.top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = optfir.low_pass (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 80e3, # passband cutoff - 115e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation + chan_coeffs = filter.optfir.low_pass(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 80e3, # passband cutoff + 115e3, # stopband cutoff + 0.1, # passband ripple + 60) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv (demod_rate, audio_decim) + self.guts = analog.wfm_rcv(demod_rate, audio_decim) self.volume_control = gr.multiply_const_ff(1) @@ -101,8 +103,8 @@ class wfm_rx_block (gr.top_block): False) # ok_to_block # now wire it all together - self.connect (self.u, self.chan_filt, self.guts, - self.volume_control, self.audio_sink) + self.connect(self.u, self.chan_filt, self.guts, + self.volume_control, self.audio_sink) if options.gain is None: # if no gain was specified, use the mid-point in dB diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py index a5c78cb24b..8cd3d5ab13 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate @@ -90,20 +92,20 @@ class wfm_rx_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = gr.firdes.low_pass_2 (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 90e3, # passband cutoff - 30e3, # stopband cutoff - 70) # stopband attenuation + chan_coeffs = filter.firdes.low_pass_2(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 90e3, # passband cutoff + 30e3, # stopband cutoff + 70) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv_pll (demod_rate, audio_decim) + self.guts = analog.wfm_rcv_pll(demod_rate, audio_decim) chan_rate = audio_rate / (demod_rate/audio_decim) - self.rchan_filt = blks2.pfb_arb_resampler_fff(chan_rate) - self.lchan_filt = blks2.pfb_arb_resampler_fff(chan_rate) + self.rchan_filt = filter.pfb.arb_resampler_fff(chan_rate) + self.lchan_filt = filter.pfb.arb_resampler_fff(chan_rate) # FIXME rework {add,multiply}_const_* to handle multiple streams self.volume_control_l = gr.multiply_const_ff(self.vol) diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py index 0e93e22fcd..68ff27ff30 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2006,2007,2011 Free Software Foundation, Inc. +# Copyright 2006,2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -50,7 +50,9 @@ OFDM. """ -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -121,19 +123,19 @@ class wfm_rx_sca_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = optfir.low_pass (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 100e3, # passband cutoff - 140e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation + chan_coeffs = filter.optfir.low_pass(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 100e3, # passband cutoff + 140e3, # stopband cutoff + 0.1, # passband ripple + 60) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) - + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) + #Create demodulator block for Main FM Channel max_dev = 75e3 fm_demod_gain = demod_rate/(2*math.pi*max_dev) - self.fm_demod = gr.quadrature_demod_cf (fm_demod_gain) + self.fm_demod = analog.quadrature_demod_cf(fm_demod_gain) # Note - deemphasis is not applied to the Main FM Channel as # main audio is not decoded @@ -143,20 +145,20 @@ class wfm_rx_sca_block (stdgui2.std_top_block): max_sca_dev = 6e3 # Create filter to get SCA channel we want - sca_chan_coeffs = gr.firdes.low_pass (1.0, # gain - demod_rate, # sampling rate - max_sca_dev, # cutoff freq - max_sca_dev/3, # trans. band - gr.firdes.WIN_HANN) # filter type + sca_chan_coeffs = filter.firdes.low_pass(1.0, # gain + demod_rate, # sampling rate + max_sca_dev, # cutoff freq + max_sca_dev/3, # trans. band + analog.firdes.WIN_HANN) # filter type - self.ddc = gr.freq_xlating_fir_filter_fcf(sca_chanfilt_decim, # decim rate - sca_chan_coeffs, # taps - 0, # freq translation amount (Gets set by the UI) - demod_rate) # input sample rate + self.ddc = filter.freq_xlating_fir_filter_fcf(sca_chanfilt_decim, # decim rate + sca_chan_coeffs, # taps + 0, # freq translation amount (Gets set by the UI) + demod_rate) # input sample rate #Create demodulator block for SCA Channel sca_demod_gain = sca_demod_rate/(2*math.pi*max_sca_dev) - self.fm_demod_sca = gr.quadrature_demod_cf (sca_demod_gain) + self.fm_demod_sca = analog.quadrature_demod_cf(sca_demod_gain) # SCA analog audio is bandwidth limited to 5 KHz @@ -166,31 +168,31 @@ class wfm_rx_sca_block (stdgui2.std_top_block): sca_tau = 150e-6 # compute FIR filter taps for SCA audio filter - audio_coeffs = gr.firdes.low_pass (1.0, # gain - sca_demod_rate, # sampling rate - max_sca_audio_freq, # cutoff freq - max_sca_audio_freq/2.5, # trans. band - gr.firdes.WIN_HAMMING) + audio_coeffs = filter.firdes.low_pass(1.0, # gain + sca_demod_rate, # sampling rate + max_sca_audio_freq, # cutoff freq + max_sca_audio_freq/2.5, # trans. band + filter.firdes.WIN_HAMMING) # input: float; output: float - self.audio_filter = gr.fir_filter_fff (audio_decim, audio_coeffs) + self.audio_filter = filter.fir_filter_fff(audio_decim, audio_coeffs) # Create deemphasis block that is applied after SCA demodulation - self.deemph = blks2.fm_deemph (audio_rate, sca_tau) + self.deemph = analog.fm_deemph(audio_rate, sca_tau) self.volume_control = gr.multiply_const_ff(self.vol) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), - options.audio_output, - False) # ok_to_block + self.audio_sink = audio.sink(int (audio_rate), + options.audio_output, + False) # ok_to_block # now wire it all together - self.connect (self.u, self.chan_filt, self.fm_demod, - self.ddc, self.fm_demod_sca) - self.connect (self.fm_demod_sca, self.audio_filter, - self.deemph, self.volume_control, - self.audio_sink) + self.connect(self.u, self.chan_filt, self.fm_demod, + self.ddc, self.fm_demod_sca) + self.connect(self.fm_demod_sca, self.audio_filter, + self.deemph, self.volume_control, + self.audio_sink) self._build_gui(vbox, usrp_rate, demod_rate, sca_demod_rate, audio_rate) diff --git a/gr-uhd/examples/python/usrp_wxapt_rcv.py b/gr-uhd/examples/python/usrp_wxapt_rcv.py index 5cceca1e98..ef774e2a07 100755 --- a/gr-uhd/examples/python/usrp_wxapt_rcv.py +++ b/gr-uhd/examples/python/usrp_wxapt_rcv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -88,24 +90,24 @@ class wxapt_rx_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = gr.firdes.low_pass_2 (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 40e3, # passband cutoff - 20e3, # transition bw - 60) # stopband attenuation + chan_coeffs = filter.firdes.low_pass_2(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 40e3, # passband cutoff + 20e3, # transition bw + 60) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv (demod_rate, audio_decim) + self.guts = analog.wfm_rcv(demod_rate, audio_decim) self.volume_control = gr.multiply_const_ff(self.vol) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), options.audio_output) + self.audio_sink = audio.sink(int (audio_rate), options.audio_output) # now wire it all together - self.connect (self.u, self.chan_filt, self.guts, - self.volume_control, self.audio_sink) + self.connect(self.u, self.chan_filt, self.guts, + self.volume_control, self.audio_sink) self._build_gui(vbox, usrp_rate, demod_rate, audio_rate) |