diff options
-rw-r--r-- | gnuradio-examples/grc/CMakeLists.txt | 42 | ||||
-rw-r--r-- | gr-audio/CMakeLists.txt | 12 | ||||
-rw-r--r-- | gr-audio/examples/c++/CMakeLists.txt | 6 | ||||
-rw-r--r-- | gr-audio/examples/grc/CMakeLists.txt | 27 | ||||
-rw-r--r-- | gr-audio/examples/grc/cvsd_sweep.grc (renamed from gnuradio-examples/grc/audio/cvsd_sweep.grc) | 0 | ||||
-rw-r--r-- | gr-audio/examples/grc/dial_tone.grc (renamed from gnuradio-examples/grc/audio/dial_tone.grc) | 0 | ||||
-rw-r--r-- | gr-audio/examples/python/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gr-digital/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gr-digital/examples/CMakeLists.txt | 6 | ||||
-rw-r--r-- | gr-fcd/CMakeLists.txt | 12 | ||||
-rw-r--r-- | gr-fcd/examples/c++/CMakeLists.txt (renamed from gr-fcd/examples/CMakeLists.txt) | 12 | ||||
-rw-r--r-- | gr-fcd/examples/c++/fcd_nfm_rx.cc (renamed from gr-fcd/examples/fcd_nfm_rx.cc) | 0 | ||||
-rw-r--r-- | gr-fcd/examples/grc/CMakeLists.txt | 26 | ||||
-rw-r--r-- | gr-fcd/examples/grc/fcd_apt_rx.grc (renamed from gr-fcd/examples/fcd_apt_rx.grc) | 0 | ||||
-rw-r--r-- | gr-fcd/examples/grc/fcd_fft_wx.grc (renamed from gr-fcd/examples/fcd_fft_wx.grc) | 0 | ||||
-rw-r--r-- | gr-fcd/examples/grc/fcd_nfm_rx.grc (renamed from gr-fcd/examples/fcd_nfm_rx.grc) | 0 | ||||
-rw-r--r-- | gr-noaa/CMakeLists.txt | 4 | ||||
-rwxr-xr-x | gr-noaa/apps/file_rx_hrpt.py | 239 | ||||
-rwxr-xr-x | gr-noaa/apps/hrpt_decode.py | 98 | ||||
-rwxr-xr-x | gr-noaa/apps/hrpt_demod.py | 161 | ||||
-rwxr-xr-x | gr-noaa/apps/usrp_rx_hrpt.py | 462 | ||||
-rwxr-xr-x | gr-noaa/apps/usrp_rx_hrpt_nogui.py | 268 | ||||
-rw-r--r-- | gr-noaa/examples/CMakeLists.txt (renamed from gr-noaa/apps/CMakeLists.txt) | 18 | ||||
-rw-r--r-- | gr-noaa/examples/file_rx_hrpt.grc (renamed from gr-noaa/apps/file_rx_hrpt.grc) | 0 | ||||
-rw-r--r-- | gr-noaa/examples/hrpt_decode.grc (renamed from gr-noaa/apps/hrpt_decode.grc) | 0 | ||||
-rw-r--r-- | gr-noaa/examples/hrpt_demod.grc (renamed from gr-noaa/apps/hrpt_demod.grc) | 0 | ||||
-rw-r--r-- | gr-noaa/examples/usrp_rx_hrpt.grc (renamed from gr-noaa/apps/usrp_rx_hrpt.grc) | 0 | ||||
-rw-r--r-- | gr-noaa/examples/usrp_rx_hrpt_nogui.grc (renamed from gr-noaa/apps/usrp_rx_hrpt_nogui.grc) | 0 | ||||
-rw-r--r-- | gr-pager/apps/CMakeLists.txt | 6 | ||||
-rwxr-xr-x | gr-pager/apps/usrp_flex (renamed from gr-pager/apps/usrp_flex.py) | 0 | ||||
-rwxr-xr-x | gr-pager/apps/usrp_flex_all (renamed from gr-pager/apps/usrp_flex_all.py) | 0 | ||||
-rwxr-xr-x | gr-pager/apps/usrp_flex_band (renamed from gr-pager/apps/usrp_flex_band.py) | 0 | ||||
-rw-r--r-- | gr-qtgui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gr-qtgui/examples/CMakeLists.txt | 4 | ||||
-rw-r--r-- | gr-shd/apps/CMakeLists.txt | 6 | ||||
-rwxr-xr-x | gr-shd/apps/shd_fft (renamed from gr-shd/apps/shd_fft.py) | 0 | ||||
-rwxr-xr-x | gr-shd/apps/shd_rx_cfile (renamed from gr-shd/apps/shd_rx_cfile.py) | 0 | ||||
-rwxr-xr-x | gr-shd/apps/shd_siggen (renamed from gr-shd/apps/shd_siggen.py) | 0 | ||||
-rw-r--r-- | gr-trellis/CMakeLists.txt | 5 | ||||
-rw-r--r-- | gr-trellis/src/examples/grc/CMakeLists.txt | 30 | ||||
-rw-r--r-- | gr-trellis/src/examples/grc/interference_cancellation.grc (renamed from gnuradio-examples/grc/trellis/interference_cancellation.grc) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/grc/pccc.grc (renamed from gnuradio-examples/grc/trellis/pccc.grc) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/grc/pccc1.grc (renamed from gnuradio-examples/grc/trellis/pccc1.grc) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/grc/readme.txt (renamed from gnuradio-examples/grc/trellis/readme.txt) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/grc/sccc.grc (renamed from gnuradio-examples/grc/trellis/sccc.grc) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/grc/sccc1.grc (renamed from gnuradio-examples/grc/trellis/sccc1.grc) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/CMakeLists.txt (renamed from gr-trellis/src/examples/CMakeLists.txt) | 4 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/README (renamed from gr-trellis/src/examples/README) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn1o2_128.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn1o2_16.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn1o2_4.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn1o2_8.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn1o2_8.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn2o3_16.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn2o3_16.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn2o3_4.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msb.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn2o3_4_msb.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msbG.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn2o3_4_msbG.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn2o3_8.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn2o3_8.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/awgn2o4_4.fsm (renamed from gr-trellis/src/examples/fsm_files/awgn2o4_4.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/disconnected.fsm (renamed from gr-trellis/src/examples/fsm_files/disconnected.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/irregular.fsm (renamed from gr-trellis/src/examples/fsm_files/irregular.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/joint_16_16.fsm (renamed from gr-trellis/src/examples/fsm_files/joint_16_16.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/joint_4_16.fsm (renamed from gr-trellis/src/examples/fsm_files/joint_4_16.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/rep3.fsm (renamed from gr-trellis/src/examples/fsm_files/rep3.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/rep5.fsm (renamed from gr-trellis/src/examples/fsm_files/rep5.fsm) | 0 | ||||
-rw-r--r-- | gr-trellis/src/examples/python/fsm_files/simple.fsm (renamed from gr-trellis/src/examples/fsm_files/simple.fsm) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/fsm_utils.py (renamed from gr-trellis/src/examples/fsm_utils.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_cpm.py (renamed from gr-trellis/src/examples/test_cpm.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_pccc_turbo1.py (renamed from gr-trellis/src/examples/test_pccc_turbo1.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_sccc_hard.py (renamed from gr-trellis/src/examples/test_sccc_hard.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_sccc_soft.py (renamed from gr-trellis/src/examples/test_sccc_soft.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_sccc_turbo.py (renamed from gr-trellis/src/examples/test_sccc_turbo.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_sccc_turbo1.py (renamed from gr-trellis/src/examples/test_sccc_turbo1.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_sccc_turbo2.py (renamed from gr-trellis/src/examples/test_sccc_turbo2.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_tcm.py (renamed from gr-trellis/src/examples/test_tcm.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_tcm_bit.py (renamed from gr-trellis/src/examples/test_tcm_bit.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_tcm_combined.py (renamed from gr-trellis/src/examples/test_tcm_combined.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_tcm_parallel.py (renamed from gr-trellis/src/examples/test_tcm_parallel.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_turbo_equalization.py (renamed from gr-trellis/src/examples/test_turbo_equalization.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_turbo_equalization1.py (renamed from gr-trellis/src/examples/test_turbo_equalization1.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_turbo_equalization2.py (renamed from gr-trellis/src/examples/test_turbo_equalization2.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_viterbi_equalization.py (renamed from gr-trellis/src/examples/test_viterbi_equalization.py) | 0 | ||||
-rwxr-xr-x | gr-trellis/src/examples/python/test_viterbi_equalization1.py (renamed from gr-trellis/src/examples/test_viterbi_equalization1.py) | 0 | ||||
-rw-r--r-- | gr-uhd/CMakeLists.txt | 13 | ||||
-rw-r--r-- | gr-uhd/apps/CMakeLists.txt | 17 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_fft (renamed from gr-uhd/apps/uhd_fft.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_rx_cfile (renamed from gr-uhd/apps/uhd_rx_cfile.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_rx_nogui (renamed from gr-uhd/apps/uhd_rx_nogui.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_siggen | 51 | ||||
-rw-r--r--[-rwxr-xr-x] | gr-uhd/apps/uhd_siggen_base.py (renamed from gr-uhd/apps/uhd_siggen.py) | 4 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_siggen_gui (renamed from gr-uhd/apps/uhd_siggen_gui.py) | 2 | ||||
-rw-r--r-- | gr-uhd/examples/c++/CMakeLists.txt (renamed from gr-uhd/examples/CMakeLists.txt) | 30 | ||||
-rw-r--r-- | gr-uhd/examples/c++/tag_sink_demo.h (renamed from gr-uhd/examples/tag_sink_demo.h) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/c++/tag_source_demo.h (renamed from gr-uhd/examples/tag_source_demo.h) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/c++/tags_demo.cc (renamed from gr-uhd/examples/tags_demo.cc) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/grc/CMakeLists.txt | 31 | ||||
-rw-r--r-- | gr-uhd/examples/grc/uhd_const_wave.grc (renamed from gnuradio-examples/grc/uhd/uhd_const_wave.grc) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/grc/uhd_dpsk_mod.grc (renamed from gnuradio-examples/grc/uhd/uhd_dpsk_mod.grc) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/grc/uhd_fft.grc (renamed from gnuradio-examples/grc/uhd/uhd_fft.grc) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/grc/uhd_rx_dpsk.grc (renamed from gnuradio-examples/grc/uhd/uhd_rx_dpsk.grc) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/grc/uhd_two_tone_loopback.grc (renamed from gnuradio-examples/grc/uhd/uhd_two_tone_loopback.grc) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/grc/uhd_tx_dpsk.grc (renamed from gnuradio-examples/grc/uhd/uhd_tx_dpsk.grc) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/grc/uhd_wbfm_receive.grc (renamed from gnuradio-examples/grc/uhd/uhd_wbfm_receive.grc) | 0 | ||||
-rw-r--r-- | gr-uhd/examples/python/CMakeLists.txt | 42 | ||||
-rwxr-xr-x | gr-uhd/examples/python/fm_tx4.py (renamed from gr-uhd/examples/fm_tx4.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/fm_tx_2_daughterboards.py (renamed from gr-uhd/examples/fm_tx_2_daughterboards.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/max_power.py (renamed from gr-uhd/examples/max_power.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_am_mw_rcv.py (renamed from gr-uhd/examples/usrp_am_mw_rcv.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_nbfm_ptt.py (renamed from gr-uhd/examples/usrp_nbfm_ptt.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_nbfm_rcv.py (renamed from gr-uhd/examples/usrp_nbfm_rcv.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_spectrum_sense.py (renamed from gr-uhd/examples/usrp_spectrum_sense.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_tv_rcv.py (renamed from gr-uhd/examples/usrp_tv_rcv.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_tv_rcv_nogui.py (renamed from gr-uhd/examples/usrp_tv_rcv_nogui.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_wfm_rcv.py (renamed from gr-uhd/examples/usrp_wfm_rcv.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py (renamed from gr-uhd/examples/usrp_wfm_rcv2_nogui.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py (renamed from gr-uhd/examples/usrp_wfm_rcv_fmdet.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_wfm_rcv_nogui.py (renamed from gr-uhd/examples/usrp_wfm_rcv_nogui.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_wfm_rcv_pll.py (renamed from gr-uhd/examples/usrp_wfm_rcv_pll.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_wfm_rcv_sca.py (renamed from gr-uhd/examples/usrp_wfm_rcv_sca.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/examples/python/usrp_wxapt_rcv.py (renamed from gr-uhd/examples/usrp_wxapt_rcv.py) | 0 | ||||
-rw-r--r-- | gr-utils/src/python/CMakeLists.txt | 30 | ||||
-rw-r--r-- | gr-utils/src/python/README.plot | 95 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_filter_design (renamed from gr-utils/src/python/gr_filter_design.py) | 0 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_char (renamed from gr-utils/src/python/gr_plot_char.py) | 0 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_const (renamed from gr-utils/src/python/gr_plot_const.py) | 0 | ||||
-rw-r--r-- | gr-utils/src/python/gr_plot_fft | 42 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_fft_c (renamed from gr-utils/src/python/gr_plot_fft_f.py) | 8 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_fft_f (renamed from gr-utils/src/python/gr_plot_fft_c.py) | 8 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_float (renamed from gr-utils/src/python/gr_plot_float.py) | 0 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_int (renamed from gr-utils/src/python/gr_plot_int.py) | 0 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_iq (renamed from gr-utils/src/python/gr_plot_iq.py) | 0 | ||||
-rw-r--r-- | gr-utils/src/python/gr_plot_psd | 42 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_psd_c (renamed from gr-utils/src/python/gr_plot_psd_c.py) | 8 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_psd_f (renamed from gr-utils/src/python/gr_plot_psd_f.py) | 6 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_qt (renamed from gr-utils/src/python/gr_plot_qt.py) | 2 | ||||
-rwxr-xr-x | gr-utils/src/python/gr_plot_short (renamed from gr-utils/src/python/gr_plot_short.py) | 0 | ||||
-rwxr-xr-x | gr-utils/src/python/plot_fft_base.py (renamed from gr-utils/src/python/gr_plot_fft.py) | 41 | ||||
-rwxr-xr-x | gr-utils/src/python/plot_psd_base.py (renamed from gr-utils/src/python/gr_plot_psd.py) | 53 | ||||
-rw-r--r-- | gr-vocoder/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gr-vocoder/examples/CMakeLists.txt | 2 |
139 files changed, 548 insertions, 1435 deletions
diff --git a/gnuradio-examples/grc/CMakeLists.txt b/gnuradio-examples/grc/CMakeLists.txt index 75f10d86a..680172cfa 100644 --- a/gnuradio-examples/grc/CMakeLists.txt +++ b/gnuradio-examples/grc/CMakeLists.txt @@ -17,15 +17,6 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# AUDIO -install( - FILES - audio/cvsd_sweep.grc - audio/dial_tone.grc - DESTINATION ${GR_PKG_DATA_DIR}/examples/grc/audio - COMPONENT "gnuadio-examples" -) - # DEMOD install( FILES @@ -33,7 +24,7 @@ install( demod/mpsk_demod.grc demod/pam_sync.grc demod/pam_timing.grc - DESTINATION ${GR_PKG_DATA_DIR}/examples/grc/demod + DESTINATION ${GR_PKG_DATA_DIR}/examples/demod COMPONENT "gnuadio-examples" ) @@ -43,34 +34,7 @@ install( simple/ber_simulation.grc simple/dpsk_loopback.grc simple/variable_config.grc - DESTINATION ${GR_PKG_DATA_DIR}/examples/grc/simple - COMPONENT "gnuadio-examples" -) - -# TRELLIS -install( - FILES - trellis/interference_cancellation.grc - trellis/pccc1.grc - trellis/pccc.grc - trellis/sccc1.grc - trellis/sccc.grc - trellis/readme.txt - DESTINATION ${GR_PKG_DATA_DIR}/examples/grc/trellis - COMPONENT "gnuadio-examples" -) - -# UHD -install( - FILES - uhd/uhd_const_wave.grc - uhd/uhd_dpsk_mod.grc - uhd/uhd_fft.grc - uhd/uhd_rx_dpsk.grc - uhd/uhd_two_tone_loopback.grc - uhd/uhd_tx_dpsk.grc - uhd/uhd_wbfm_receive.grc - DESTINATION ${GR_PKG_DATA_DIR}/examples/grc/uhd + DESTINATION ${GR_PKG_DATA_DIR}/examples/simple COMPONENT "gnuadio-examples" ) @@ -81,6 +45,6 @@ install( xmlrpc/xmlrpc_client.grc xmlrpc/xmlrpc_client_script.py xmlrpc/xmlrpc_server.grc - DESTINATION ${GR_PKG_DATA_DIR}/examples/grc/xmlrpc + DESTINATION ${GR_PKG_DATA_DIR}/examples/xmlrpc COMPONENT "gnuadio-examples" ) diff --git a/gr-audio/CMakeLists.txt b/gr-audio/CMakeLists.txt index 7038b9b0f..f9975cf08 100644 --- a/gr-audio/CMakeLists.txt +++ b/gr-audio/CMakeLists.txt @@ -33,6 +33,8 @@ GR_REGISTER_COMPONENT("gr-audio" ENABLE_GR_AUDIO GR_SET_GLOBAL(GR_AUDIO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include) +SET(GR_PKG_AUDIO_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/audio) + ######################################################################## # Begin conditional configuration ######################################################################## @@ -65,6 +67,13 @@ CPACK_COMPONENT("audio_python" DEPENDS "core_python;audio_runtime" ) +CPACK_COMPONENT("audio_examples" + GROUP "Audio" + DISPLAY_NAME "Examples" + DESCRIPTION "Example programs" + DEPENDS "audio_runtime" +) + CPACK_COMPONENT("audio_swig" GROUP "Audio" DISPLAY_NAME "SWIG" @@ -77,12 +86,13 @@ CPACK_COMPONENT("audio_swig" ######################################################################## add_subdirectory(include) add_subdirectory(lib) -add_subdirectory(examples/c++) add_subdirectory(doc) +add_subdirectory(examples/c++) if(ENABLE_PYTHON) add_subdirectory(swig) add_subdirectory(grc) add_subdirectory(examples/python) + add_subdirectory(examples/grc) endif(ENABLE_PYTHON) ######################################################################## diff --git a/gr-audio/examples/c++/CMakeLists.txt b/gr-audio/examples/c++/CMakeLists.txt index 38490cce8..28bbc52a5 100644 --- a/gr-audio/examples/c++/CMakeLists.txt +++ b/gr-audio/examples/c++/CMakeLists.txt @@ -21,3 +21,9 @@ include_directories(${GR_AUDIO_INCLUDE_DIRS}) include_directories(${GNURADIO_CORE_INCLUDE_DIRS}) add_executable(dial_tone dial_tone.cc) target_link_libraries(dial_tone gnuradio-audio) + +INSTALL(TARGETS + dial_tone + DESTINATION ${GR_PKG_AUDIO_EXAMPLES_DIR} + COMPONENT "audio_examples" +) diff --git a/gr-audio/examples/grc/CMakeLists.txt b/gr-audio/examples/grc/CMakeLists.txt new file mode 100644 index 000000000..179b42fcc --- /dev/null +++ b/gr-audio/examples/grc/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright 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. + +install( + FILES + cvsd_sweep.grc + dial_tone.grc + DESTINATION ${GR_PKG_AUDIO_EXAMPLES_DIR} + COMPONENT "audio_python" +) + diff --git a/gnuradio-examples/grc/audio/cvsd_sweep.grc b/gr-audio/examples/grc/cvsd_sweep.grc index b645b747a..b645b747a 100644 --- a/gnuradio-examples/grc/audio/cvsd_sweep.grc +++ b/gr-audio/examples/grc/cvsd_sweep.grc diff --git a/gnuradio-examples/grc/audio/dial_tone.grc b/gr-audio/examples/grc/dial_tone.grc index ac8cbef27..ac8cbef27 100644 --- a/gnuradio-examples/grc/audio/dial_tone.grc +++ b/gr-audio/examples/grc/dial_tone.grc diff --git a/gr-audio/examples/python/CMakeLists.txt b/gr-audio/examples/python/CMakeLists.txt index 86ba86ac0..24e29e234 100644 --- a/gr-audio/examples/python/CMakeLists.txt +++ b/gr-audio/examples/python/CMakeLists.txt @@ -32,6 +32,6 @@ GR_PYTHON_INSTALL(PROGRAMS noise.py spectrum_inversion.py test_resampler.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/audio + DESTINATION ${GR_PKG_AUDIO_EXAMPLES_DIR} COMPONENT "audio_python" ) diff --git a/gr-digital/CMakeLists.txt b/gr-digital/CMakeLists.txt index 099af0869..eb7ed67e1 100644 --- a/gr-digital/CMakeLists.txt +++ b/gr-digital/CMakeLists.txt @@ -39,6 +39,8 @@ GR_SET_GLOBAL(GR_DIGITAL_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/swig ) +SET(GR_PKG_DIGITAL_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/digital) + ######################################################################## # Begin conditional configuration ######################################################################## diff --git a/gr-digital/examples/CMakeLists.txt b/gr-digital/examples/CMakeLists.txt index 5c652fc83..12fca6009 100644 --- a/gr-digital/examples/CMakeLists.txt +++ b/gr-digital/examples/CMakeLists.txt @@ -26,7 +26,7 @@ GR_PYTHON_INSTALL(PROGRAMS run_length.py gen_whitener.py snr_estimators.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/digital + DESTINATION ${GR_PKG_DIGITAL_EXAMPLES_DIR} COMPONENT "digital_python" ) @@ -41,7 +41,7 @@ GR_PYTHON_INSTALL(PROGRAMS narrowband/digital_bert_rx.py narrowband/digital_bert_tx.py narrowband/tunnel.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/digital/narrowband + DESTINATION ${GR_PKG_DIGITAL_EXAMPLES_DIR}/narrowband COMPONENT "digital_python" ) @@ -55,6 +55,6 @@ GR_PYTHON_INSTALL(PROGRAMS ofdm/transmit_path.py ofdm/tunnel.py ofdm/uhd_interface.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/digital/ofdm + DESTINATION ${GR_PKG_DIGITAL_EXAMPLES_DIR}/ofdm COMPONENT "digital_python" ) diff --git a/gr-fcd/CMakeLists.txt b/gr-fcd/CMakeLists.txt index e454c01fa..10dd8b8cd 100644 --- a/gr-fcd/CMakeLists.txt +++ b/gr-fcd/CMakeLists.txt @@ -51,6 +51,8 @@ GR_SET_GLOBAL(GR_FCD_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include/fcd ) +SET(GR_PKG_FCD_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/fcd) + ######################################################################## # Begin conditional configuration ######################################################################## @@ -83,6 +85,13 @@ CPACK_COMPONENT("fcd_python" DEPENDS "core_python;fcd_runtime" ) +CPACK_COMPONENT("fcd_examples" + GROUP "FCD" + DISPLAY_NAME "Examples" + DESCRIPTION "Example programs" + DEPENDS "fcd_runtime" +) + CPACK_COMPONENT("fcd_swig" GROUP "FCD" DISPLAY_NAME "SWIG" @@ -99,8 +108,9 @@ if(ENABLE_PYTHON) add_subdirectory(swig) add_subdirectory(python) add_subdirectory(grc) + add_subdirectory(examples/grc) endif(ENABLE_PYTHON) -add_subdirectory(examples) +add_subdirectory(examples/c++) add_subdirectory(doc) ######################################################################## diff --git a/gr-fcd/examples/CMakeLists.txt b/gr-fcd/examples/c++/CMakeLists.txt index 477a6311b..05574f4a8 100644 --- a/gr-fcd/examples/CMakeLists.txt +++ b/gr-fcd/examples/c++/CMakeLists.txt @@ -26,16 +26,6 @@ target_link_libraries(fcd_nfm_rx gnuradio-fcd) INSTALL(TARGETS fcd_nfm_rx - DESTINATION ${GR_PKG_DATA_DIR}/examples/fcd + DESTINATION ${GR_PKG_FCD_EXAMPLES_DIR} COMPONENT "fcd_examples" ) - -if(ENABLE_PYTHON) - INSTALL(FILES - fcd_apt_rx.grc - fcd_fft_wx.grc - fcd_nfm_rx.grc - DESTINATION ${GR_PKG_DATA_DIR}/examples/fcd - COMPONENT "fcd_examples" - ) -endif() diff --git a/gr-fcd/examples/fcd_nfm_rx.cc b/gr-fcd/examples/c++/fcd_nfm_rx.cc index 97ef7cf19..97ef7cf19 100644 --- a/gr-fcd/examples/fcd_nfm_rx.cc +++ b/gr-fcd/examples/c++/fcd_nfm_rx.cc diff --git a/gr-fcd/examples/grc/CMakeLists.txt b/gr-fcd/examples/grc/CMakeLists.txt new file mode 100644 index 000000000..e33fdf182 --- /dev/null +++ b/gr-fcd/examples/grc/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright 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. + +INSTALL(FILES + fcd_apt_rx.grc + fcd_fft_wx.grc + fcd_nfm_rx.grc + DESTINATION ${GR_PKG_FCD_EXAMPLES_DIR} + COMPONENT "fcd_examples" +)
\ No newline at end of file diff --git a/gr-fcd/examples/fcd_apt_rx.grc b/gr-fcd/examples/grc/fcd_apt_rx.grc index c4d3e64d1..c4d3e64d1 100644 --- a/gr-fcd/examples/fcd_apt_rx.grc +++ b/gr-fcd/examples/grc/fcd_apt_rx.grc diff --git a/gr-fcd/examples/fcd_fft_wx.grc b/gr-fcd/examples/grc/fcd_fft_wx.grc index c045bbfa2..c045bbfa2 100644 --- a/gr-fcd/examples/fcd_fft_wx.grc +++ b/gr-fcd/examples/grc/fcd_fft_wx.grc diff --git a/gr-fcd/examples/fcd_nfm_rx.grc b/gr-fcd/examples/grc/fcd_nfm_rx.grc index 9dac3fcb8..9dac3fcb8 100644 --- a/gr-fcd/examples/fcd_nfm_rx.grc +++ b/gr-fcd/examples/grc/fcd_nfm_rx.grc diff --git a/gr-noaa/CMakeLists.txt b/gr-noaa/CMakeLists.txt index a3a5d56db..fc10caff4 100644 --- a/gr-noaa/CMakeLists.txt +++ b/gr-noaa/CMakeLists.txt @@ -35,6 +35,8 @@ GR_SET_GLOBAL(GR_NOAA_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/lib ) +SET(GR_PKG_NOAA_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/noaa) + ######################################################################## # Begin conditional configuration ######################################################################## @@ -81,7 +83,7 @@ add_subdirectory(lib) if(ENABLE_PYTHON) add_subdirectory(swig) add_subdirectory(grc) - add_subdirectory(apps) + add_subdirectory(examples) endif(ENABLE_PYTHON) ######################################################################## diff --git a/gr-noaa/apps/file_rx_hrpt.py b/gr-noaa/apps/file_rx_hrpt.py deleted file mode 100755 index fcd1832f6..000000000 --- a/gr-noaa/apps/file_rx_hrpt.py +++ /dev/null @@ -1,239 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: USRP HRPT Receiver -# Generated: Thu Oct 27 13:48:25 2011 -################################################## - -from gnuradio import digital -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from optparse import OptionParser -import ConfigParser -import math, os - -class file_rx_hrpt(gr.top_block): - - def __init__(self): - gr.top_block.__init__(self, "USRP HRPT Receiver") - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 4e6 - self.sps = sps = sample_rate/sym_rate - self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(config_filename) - try: pll_alpha = self._pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha') - except: pll_alpha = 0.01 - self.pll_alpha = pll_alpha - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(config_filename) - try: output_filename = self._output_filename_config.get('usrp_rx_hrpt', 'filename') - except: output_filename = 'frames.hrpt' - self.output_filename = output_filename - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(config_filename) - try: gain = self._gain_config.getfloat('usrp_rx_hrpt', 'gain') - except: gain = 35 - self.gain = gain - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(config_filename) - try: freq = self._freq_config.getfloat('usrp_rx_hrpt', 'freq') - except: freq = 1698e6 - self.freq = freq - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(config_filename) - try: clock_alpha = self._clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha') - except: clock_alpha = 0.01 - self.clock_alpha = clock_alpha - - ################################################## - # Blocks - ################################################## - self.throttle = gr.throttle(gr.sizeof_short*1, 2*sample_rate) - self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) - self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.gr_interleaved_short_to_complex_0 = gr.interleaved_short_to_complex() - self.gr_file_source_0 = gr.file_source(gr.sizeof_short*1, "input_filename", False) - self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename) - self.frame_sink.set_unbuffered(False) - self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) - self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() - self.deframer = noaa.hrpt_deframer() - self.decoder = noaa.hrpt_decoder(True,True) - self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - - ################################################## - # Connections - ################################################## - self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) - self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.agc, 0), (self.pll, 0)) - self.connect((self.deframer, 0), (self.decoder, 0)) - self.connect((self.deframer, 0), (self.frame_sink, 0)) - self.connect((self.gr_interleaved_short_to_complex_0, 0), (self.agc, 0)) - self.connect((self.throttle, 0), (self.gr_interleaved_short_to_complex_0, 0)) - self.connect((self.gr_file_source_0, 0), (self.throttle, 0)) - self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) - self.connect((self.digital_binary_slicer_fb_0, 0), (self.deframer, 0)) - - def get_sym_rate(self): - return self.sym_rate - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sample_rate(self): - return self.sample_rate - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) - - def get_config_filename(self): - return self.config_filename - - def set_config_filename(self, config_filename): - self.config_filename = config_filename - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(self.config_filename) - if not self._freq_config.has_section('usrp_rx_hrpt'): - self._freq_config.add_section('usrp_rx_hrpt') - self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._freq_config.write(open(self.config_filename, 'w')) - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(self.config_filename) - if not self._gain_config.has_section('usrp_rx_hrpt'): - self._gain_config.add_section('usrp_rx_hrpt') - self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._gain_config.write(open(self.config_filename, 'w')) - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(self.config_filename) - if not self._pll_alpha_config.has_section('usrp_rx_hrpt'): - self._pll_alpha_config.add_section('usrp_rx_hrpt') - self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._pll_alpha_config.write(open(self.config_filename, 'w')) - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(self.config_filename) - if not self._clock_alpha_config.has_section('usrp_rx_hrpt'): - self._clock_alpha_config.add_section('usrp_rx_hrpt') - self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._clock_alpha_config.write(open(self.config_filename, 'w')) - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - - def get_pll_alpha(self): - return self.pll_alpha - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - self.pll.set_alpha(self.pll_alpha) - self.pll.set_beta(self.pll_alpha**2/4.0) - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(self.config_filename) - if not self._pll_alpha_config.has_section('usrp_rx_hrpt'): - self._pll_alpha_config.add_section('usrp_rx_hrpt') - self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._pll_alpha_config.write(open(self.config_filename, 'w')) - - def get_output_filename(self): - return self.output_filename - - def set_output_filename(self, output_filename): - self.output_filename = output_filename - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - - def get_max_clock_offset(self): - return self.max_clock_offset - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def get_max_carrier_offset(self): - return self.max_carrier_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - self.pll.set_max_offset(self.max_carrier_offset) - - def get_hs(self): - return self.hs - - def set_hs(self, hs): - self.hs = hs - self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs) - - def get_gain(self): - return self.gain - - def set_gain(self, gain): - self.gain = gain - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(self.config_filename) - if not self._gain_config.has_section('usrp_rx_hrpt'): - self._gain_config.add_section('usrp_rx_hrpt') - self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._gain_config.write(open(self.config_filename, 'w')) - - def get_freq(self): - return self.freq - - def set_freq(self, freq): - self.freq = freq - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(self.config_filename) - if not self._freq_config.has_section('usrp_rx_hrpt'): - self._freq_config.add_section('usrp_rx_hrpt') - self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._freq_config.write(open(self.config_filename, 'w')) - - def get_clock_alpha(self): - return self.clock_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - self.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) - self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(self.config_filename) - if not self._clock_alpha_config.has_section('usrp_rx_hrpt'): - self._clock_alpha_config.add_section('usrp_rx_hrpt') - self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._clock_alpha_config.write(open(self.config_filename, 'w')) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - (options, args) = parser.parse_args() - tb = file_rx_hrpt() - tb.start() - raw_input('Press Enter to quit: ') - tb.stop() - diff --git a/gr-noaa/apps/hrpt_decode.py b/gr-noaa/apps/hrpt_decode.py deleted file mode 100755 index 158780b17..000000000 --- a/gr-noaa/apps/hrpt_decode.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: Hrpt Decode -# Generated: Sun Nov 8 10:49:01 2009 -################################################## - -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from optparse import OptionParser -import math, os - -class hrpt_decode(gr.top_block): - - def __init__(self, decim=32, pll_alpha=0.01, clock_alpha=0.01, input_filename="frames.hrpt"): - gr.top_block.__init__(self, "Hrpt Decode") - - ################################################## - # Parameters - ################################################## - self.decim = decim - self.pll_alpha = pll_alpha - self.clock_alpha = clock_alpha - self.input_filename = input_filename - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 64e6/decim - self.sps = sps = sample_rate/sym_rate - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - - ################################################## - # Blocks - ################################################## - self.decoder = noaa.hrpt_decoder(True,True) - self.file_source = gr.file_source(gr.sizeof_short*1, input_filename, False) - - ################################################## - # Connections - ################################################## - self.connect((self.file_source, 0), (self.decoder, 0)) - - def set_decim(self, decim): - self.decim = decim - self.set_sample_rate(64e6/self.decim) - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - - def set_input_filename(self, input_filename): - self.input_filename = input_filename - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - - def set_hs(self, hs): - self.hs = hs - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - parser.add_option("-d", "--decim", dest="decim", type="intx", default=32, - help="Set decim [default=%default]") - parser.add_option("-p", "--pll-alpha", dest="pll_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set pll_alpha [default=%default]") - parser.add_option("-s", "--clock-alpha", dest="clock_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set clock_alpha [default=%default]") - parser.add_option("-F", "--input-filename", dest="input_filename", type="string", default="frames.hrpt", - help="Set frames.hrpt [default=%default]") - (options, args) = parser.parse_args() - tb = hrpt_decode(decim=options.decim, pll_alpha=options.pll_alpha, clock_alpha=options.clock_alpha, input_filename=options.input_filename) - tb.run() - diff --git a/gr-noaa/apps/hrpt_demod.py b/gr-noaa/apps/hrpt_demod.py deleted file mode 100755 index 38b4b2fe3..000000000 --- a/gr-noaa/apps/hrpt_demod.py +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: Hrpt Demod -# Generated: Thu Oct 27 13:51:59 2011 -################################################## - -from gnuradio import digital -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from optparse import OptionParser -import math, os - -class hrpt_demod(gr.top_block): - - def __init__(self, input_filename="usrp.dat", output_filename="frames.dat", decim=32, pll_alpha=0.01, clock_alpha=0.01): - gr.top_block.__init__(self, "Hrpt Demod") - - ################################################## - # Parameters - ################################################## - self.input_filename = input_filename - self.output_filename = output_filename - self.decim = decim - self.pll_alpha = pll_alpha - self.clock_alpha = clock_alpha - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 4e6 - self.sps = sps = sample_rate/sym_rate - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - - ################################################## - # Blocks - ################################################## - self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) - self.noaa_hrpt_deframer_0 = noaa.hrpt_deframer() - self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.gr_file_sink_0 = gr.file_sink(gr.sizeof_short*1, output_filename) - self.gr_file_sink_0.set_unbuffered(False) - self.file_source = gr.file_source(gr.sizeof_short*1, input_filename, False) - self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) - self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() - self.decoder = noaa.hrpt_decoder(True,False) - self.cs2cf = gr.interleaved_short_to_complex() - self.agc = gr.agc_cc(1e-5, 1.0, 1.0/32768.0, 1.0) - - ################################################## - # Connections - ################################################## - self.connect((self.file_source, 0), (self.cs2cf, 0)) - self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.cs2cf, 0), (self.agc, 0)) - self.connect((self.agc, 0), (self.pll, 0)) - self.connect((self.noaa_hrpt_deframer_0, 0), (self.gr_file_sink_0, 0)) - self.connect((self.noaa_hrpt_deframer_0, 0), (self.decoder, 0)) - self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) - self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) - self.connect((self.digital_binary_slicer_fb_0, 0), (self.noaa_hrpt_deframer_0, 0)) - - def get_input_filename(self): - return self.input_filename - - def set_input_filename(self, input_filename): - self.input_filename = input_filename - - def get_output_filename(self): - return self.output_filename - - def set_output_filename(self, output_filename): - self.output_filename = output_filename - - def get_decim(self): - return self.decim - - def set_decim(self, decim): - self.decim = decim - - def get_pll_alpha(self): - return self.pll_alpha - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - self.pll.set_alpha(self.pll_alpha) - self.pll.set_beta(self.pll_alpha**2/4.0) - - def get_clock_alpha(self): - return self.clock_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - self.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) - self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) - - def get_sym_rate(self): - return self.sym_rate - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sample_rate(self): - return self.sample_rate - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) - - def get_max_clock_offset(self): - return self.max_clock_offset - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def get_max_carrier_offset(self): - return self.max_carrier_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - self.pll.set_max_offset(self.max_carrier_offset) - - def get_hs(self): - return self.hs - - def set_hs(self, hs): - self.hs = hs - self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - parser.add_option("-F", "--input-filename", dest="input_filename", type="string", default="usrp.dat", - help="Set usrp.dat [default=%default]") - parser.add_option("-o", "--output-filename", dest="output_filename", type="string", default="frames.dat", - help="Set frames.dat [default=%default]") - parser.add_option("-d", "--decim", dest="decim", type="intx", default=32, - help="Set None [default=%default]") - parser.add_option("-p", "--pll-alpha", dest="pll_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set None [default=%default]") - parser.add_option("-s", "--clock-alpha", dest="clock_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set None [default=%default]") - (options, args) = parser.parse_args() - tb = hrpt_demod(input_filename=options.input_filename, output_filename=options.output_filename, decim=options.decim, pll_alpha=options.pll_alpha, clock_alpha=options.clock_alpha) - tb.run() - diff --git a/gr-noaa/apps/usrp_rx_hrpt.py b/gr-noaa/apps/usrp_rx_hrpt.py deleted file mode 100755 index e603e768e..000000000 --- a/gr-noaa/apps/usrp_rx_hrpt.py +++ /dev/null @@ -1,462 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: USRP HRPT Receiver -# Generated: Thu Oct 27 13:26:42 2011 -################################################## - -from gnuradio import digital -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio import uhd -from gnuradio import window -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from gnuradio.wxgui import fftsink2 -from gnuradio.wxgui import forms -from gnuradio.wxgui import scopesink2 -from grc_gnuradio import wxgui as grc_wxgui -from optparse import OptionParser -import ConfigParser -import math, os -import wx - -class usrp_rx_hrpt(grc_wxgui.top_block_gui): - - def __init__(self): - grc_wxgui.top_block_gui.__init__(self, title="USRP HRPT Receiver") - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 4e6 - self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' - self.sps = sps = sample_rate/sym_rate - self._saved_pll_alpha_config = ConfigParser.ConfigParser() - self._saved_pll_alpha_config.read(config_filename) - try: saved_pll_alpha = self._saved_pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha') - except: saved_pll_alpha = 0.01 - self.saved_pll_alpha = saved_pll_alpha - self._saved_gain_config = ConfigParser.ConfigParser() - self._saved_gain_config.read(config_filename) - try: saved_gain = self._saved_gain_config.getfloat('usrp_rx_hrpt', 'gain') - except: saved_gain = 35 - self.saved_gain = saved_gain - self._saved_freq_config = ConfigParser.ConfigParser() - self._saved_freq_config.read(config_filename) - try: saved_freq = self._saved_freq_config.getfloat('usrp_rx_hrpt', 'freq') - except: saved_freq = 1698e6 - self.saved_freq = saved_freq - self._saved_clock_alpha_config = ConfigParser.ConfigParser() - self._saved_clock_alpha_config.read(config_filename) - try: saved_clock_alpha = self._saved_clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha') - except: saved_clock_alpha = 0.01 - self.saved_clock_alpha = saved_clock_alpha - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(config_filename) - try: addr = self._addr_config.get('usrp_rx_hrpt', 'addr') - except: addr = "" - self.addr = addr - self.rate_text = rate_text = sample_rate - self.pll_alpha = pll_alpha = saved_pll_alpha - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(config_filename) - try: output_filename = self._output_filename_config.get('usrp_rx_hrpt', 'filename') - except: output_filename = 'frames.hrpt' - self.output_filename = output_filename - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - self.gain = gain = saved_gain - self.freq = freq = saved_freq - self.clock_alpha = clock_alpha = saved_clock_alpha - self.addr_text = addr_text = addr - - ################################################## - # Blocks - ################################################## - self._freq_text_box = forms.text_box( - parent=self.GetWin(), - value=self.freq, - callback=self.set_freq, - label="Frequency", - converter=forms.float_converter(), - ) - self.GridAdd(self._freq_text_box, 0, 0, 1, 1) - self.displays = self.displays = wx.Notebook(self.GetWin(), style=wx.NB_TOP) - self.displays.AddPage(grc_wxgui.Panel(self.displays), "Spectrum") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "Demod") - self.GridAdd(self.displays, 2, 0, 1, 4) - _clock_alpha_sizer = wx.BoxSizer(wx.VERTICAL) - self._clock_alpha_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_clock_alpha_sizer, - value=self.clock_alpha, - callback=self.set_clock_alpha, - label="Clock Alpha", - converter=forms.float_converter(), - proportion=0, - ) - self._clock_alpha_slider = forms.slider( - parent=self.GetWin(), - sizer=_clock_alpha_sizer, - value=self.clock_alpha, - callback=self.set_clock_alpha, - minimum=0.0, - maximum=0.5, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_clock_alpha_sizer, 0, 3, 1, 1) - self.uhd_usrp_source_0 = uhd.usrp_source( - device_addr=addr, - io_type=uhd.io_type.COMPLEX_FLOAT32, - num_channels=1, - ) - self.uhd_usrp_source_0.set_samp_rate(sample_rate) - self.uhd_usrp_source_0.set_center_freq(freq, 0) - self.uhd_usrp_source_0.set_gain(0, 0) - self.rx_fft = fftsink2.fft_sink_c( - self.displays.GetPage(0).GetWin(), - baseband_freq=freq, - y_per_div=5, - y_divs=8, - ref_level=-5, - ref_scale=2.0, - sample_rate=sample_rate, - fft_size=1024, - fft_rate=15, - average=True, - avg_alpha=0.1, - title="RX Spectrum", - peak_hold=False, - size=(640, 360), - ) - self.displays.GetPage(0).GridAdd(self.rx_fft.win, 0, 0, 1, 1) - self._rate_text_static_text = forms.static_text( - parent=self.GetWin(), - value=self.rate_text, - callback=self.set_rate_text, - label="Baseband Rate", - converter=forms.float_converter(), - ) - self.GridAdd(self._rate_text_static_text, 1, 1, 1, 1) - _pll_alpha_sizer = wx.BoxSizer(wx.VERTICAL) - self._pll_alpha_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_pll_alpha_sizer, - value=self.pll_alpha, - callback=self.set_pll_alpha, - label="PLL Alpha", - converter=forms.float_converter(), - proportion=0, - ) - self._pll_alpha_slider = forms.slider( - parent=self.GetWin(), - sizer=_pll_alpha_sizer, - value=self.pll_alpha, - callback=self.set_pll_alpha, - minimum=0.0, - maximum=0.5, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_pll_alpha_sizer, 0, 2, 1, 1) - self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) - self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - _gain_sizer = wx.BoxSizer(wx.VERTICAL) - self._gain_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_gain_sizer, - value=self.gain, - callback=self.set_gain, - label="RX Gain", - converter=forms.float_converter(), - proportion=0, - ) - self._gain_slider = forms.slider( - parent=self.GetWin(), - sizer=_gain_sizer, - value=self.gain, - callback=self.set_gain, - minimum=0, - maximum=100, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_gain_sizer, 0, 1, 1, 1) - self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename) - self.frame_sink.set_unbuffered(False) - self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) - self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() - self.demod_scope = scopesink2.scope_sink_f( - self.displays.GetPage(1).GetWin(), - title="Post-Demod", - sample_rate=sym_rate*2.0, - v_scale=0.5, - v_offset=0, - t_scale=10.0/sym_rate, - ac_couple=False, - xy_mode=False, - num_inputs=1, - trig_mode=gr.gr_TRIG_MODE_AUTO, - y_axis_label="Counts", - ) - self.displays.GetPage(1).GridAdd(self.demod_scope.win, 0, 0, 1, 1) - self.deframer = noaa.hrpt_deframer() - self.decoder = noaa.hrpt_decoder(True,True) - self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - self._addr_text_static_text = forms.static_text( - parent=self.GetWin(), - value=self.addr_text, - callback=self.set_addr_text, - label="USRP Addr", - converter=forms.str_converter(), - ) - self.GridAdd(self._addr_text_static_text, 1, 0, 1, 1) - - ################################################## - # Connections - ################################################## - self.connect((self.deframer, 0), (self.frame_sink, 0)) - self.connect((self.deframer, 0), (self.decoder, 0)) - self.connect((self.agc, 0), (self.pll, 0)) - self.connect((self.agc, 0), (self.rx_fft, 0)) - self.connect((self.uhd_usrp_source_0, 0), (self.agc, 0)) - self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.gr_moving_average_xx_0, 0), (self.demod_scope, 0)) - self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) - self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) - self.connect((self.digital_binary_slicer_fb_0, 0), (self.deframer, 0)) - - def get_sym_rate(self): - return self.sym_rate - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - self.demod_scope.set_sample_rate(self.sym_rate*2.0) - - def get_sample_rate(self): - return self.sample_rate - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - self.rx_fft.set_sample_rate(self.sample_rate) - self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) - self.set_rate_text(self.sample_rate) - - def get_config_filename(self): - return self.config_filename - - def set_config_filename(self, config_filename): - self.config_filename = config_filename - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(self.config_filename) - if not self._addr_config.has_section('usrp_rx_hrpt'): - self._addr_config.add_section('usrp_rx_hrpt') - self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) - self._addr_config.write(open(self.config_filename, 'w')) - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - self._saved_clock_alpha_config = ConfigParser.ConfigParser() - self._saved_clock_alpha_config.read(self.config_filename) - if not self._saved_clock_alpha_config.has_section('usrp_rx_hrpt'): - self._saved_clock_alpha_config.add_section('usrp_rx_hrpt') - self._saved_clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._saved_clock_alpha_config.write(open(self.config_filename, 'w')) - self._saved_pll_alpha_config = ConfigParser.ConfigParser() - self._saved_pll_alpha_config.read(self.config_filename) - if not self._saved_pll_alpha_config.has_section('usrp_rx_hrpt'): - self._saved_pll_alpha_config.add_section('usrp_rx_hrpt') - self._saved_pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._saved_pll_alpha_config.write(open(self.config_filename, 'w')) - self._saved_gain_config = ConfigParser.ConfigParser() - self._saved_gain_config.read(self.config_filename) - if not self._saved_gain_config.has_section('usrp_rx_hrpt'): - self._saved_gain_config.add_section('usrp_rx_hrpt') - self._saved_gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._saved_gain_config.write(open(self.config_filename, 'w')) - self._saved_freq_config = ConfigParser.ConfigParser() - self._saved_freq_config.read(self.config_filename) - if not self._saved_freq_config.has_section('usrp_rx_hrpt'): - self._saved_freq_config.add_section('usrp_rx_hrpt') - self._saved_freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._saved_freq_config.write(open(self.config_filename, 'w')) - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) - - def get_saved_pll_alpha(self): - return self.saved_pll_alpha - - def set_saved_pll_alpha(self, saved_pll_alpha): - self.saved_pll_alpha = saved_pll_alpha - self.set_pll_alpha(self.saved_pll_alpha) - - def get_saved_gain(self): - return self.saved_gain - - def set_saved_gain(self, saved_gain): - self.saved_gain = saved_gain - self.set_gain(self.saved_gain) - - def get_saved_freq(self): - return self.saved_freq - - def set_saved_freq(self, saved_freq): - self.saved_freq = saved_freq - self.set_freq(self.saved_freq) - - def get_saved_clock_alpha(self): - return self.saved_clock_alpha - - def set_saved_clock_alpha(self, saved_clock_alpha): - self.saved_clock_alpha = saved_clock_alpha - self.set_clock_alpha(self.saved_clock_alpha) - - def get_addr(self): - return self.addr - - def set_addr(self, addr): - self.addr = addr - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(self.config_filename) - if not self._addr_config.has_section('usrp_rx_hrpt'): - self._addr_config.add_section('usrp_rx_hrpt') - self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) - self._addr_config.write(open(self.config_filename, 'w')) - self.set_addr_text(self.addr) - - def get_rate_text(self): - return self.rate_text - - def set_rate_text(self, rate_text): - self.rate_text = rate_text - self._rate_text_static_text.set_value(self.rate_text) - - def get_pll_alpha(self): - return self.pll_alpha - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - self._pll_alpha_slider.set_value(self.pll_alpha) - self._pll_alpha_text_box.set_value(self.pll_alpha) - self.pll.set_alpha(self.pll_alpha) - self.pll.set_beta(self.pll_alpha**2/4.0) - self._saved_pll_alpha_config = ConfigParser.ConfigParser() - self._saved_pll_alpha_config.read(self.config_filename) - if not self._saved_pll_alpha_config.has_section('usrp_rx_hrpt'): - self._saved_pll_alpha_config.add_section('usrp_rx_hrpt') - self._saved_pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._saved_pll_alpha_config.write(open(self.config_filename, 'w')) - - def get_output_filename(self): - return self.output_filename - - def set_output_filename(self, output_filename): - self.output_filename = output_filename - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - - def get_max_clock_offset(self): - return self.max_clock_offset - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def get_max_carrier_offset(self): - return self.max_carrier_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - self.pll.set_max_offset(self.max_carrier_offset) - - def get_hs(self): - return self.hs - - def set_hs(self, hs): - self.hs = hs - self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs) - - def get_gain(self): - return self.gain - - def set_gain(self, gain): - self.gain = gain - self._gain_slider.set_value(self.gain) - self._gain_text_box.set_value(self.gain) - self._saved_gain_config = ConfigParser.ConfigParser() - self._saved_gain_config.read(self.config_filename) - if not self._saved_gain_config.has_section('usrp_rx_hrpt'): - self._saved_gain_config.add_section('usrp_rx_hrpt') - self._saved_gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._saved_gain_config.write(open(self.config_filename, 'w')) - - def get_freq(self): - return self.freq - - def set_freq(self, freq): - self.freq = freq - self._freq_text_box.set_value(self.freq) - self.rx_fft.set_baseband_freq(self.freq) - self.uhd_usrp_source_0.set_center_freq(self.freq, 0) - self._saved_freq_config = ConfigParser.ConfigParser() - self._saved_freq_config.read(self.config_filename) - if not self._saved_freq_config.has_section('usrp_rx_hrpt'): - self._saved_freq_config.add_section('usrp_rx_hrpt') - self._saved_freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._saved_freq_config.write(open(self.config_filename, 'w')) - - def get_clock_alpha(self): - return self.clock_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - self._clock_alpha_slider.set_value(self.clock_alpha) - self._clock_alpha_text_box.set_value(self.clock_alpha) - self._saved_clock_alpha_config = ConfigParser.ConfigParser() - self._saved_clock_alpha_config.read(self.config_filename) - if not self._saved_clock_alpha_config.has_section('usrp_rx_hrpt'): - self._saved_clock_alpha_config.add_section('usrp_rx_hrpt') - self._saved_clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._saved_clock_alpha_config.write(open(self.config_filename, 'w')) - self.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) - self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) - - def get_addr_text(self): - return self.addr_text - - def set_addr_text(self, addr_text): - self.addr_text = addr_text - self._addr_text_static_text.set_value(self.addr_text) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - (options, args) = parser.parse_args() - tb = usrp_rx_hrpt() - tb.Run(True) - diff --git a/gr-noaa/apps/usrp_rx_hrpt_nogui.py b/gr-noaa/apps/usrp_rx_hrpt_nogui.py deleted file mode 100755 index 4fc5642ff..000000000 --- a/gr-noaa/apps/usrp_rx_hrpt_nogui.py +++ /dev/null @@ -1,268 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: USRP HRPT Receiver -# Generated: Thu Oct 27 13:49:01 2011 -################################################## - -from gnuradio import digital -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio import uhd -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from optparse import OptionParser -import ConfigParser -import math, os - -class usrp_rx_hrpt_nogui(gr.top_block): - - def __init__(self): - gr.top_block.__init__(self, "USRP HRPT Receiver") - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 4e6 - self.sps = sps = sample_rate/sym_rate - self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(config_filename) - try: pll_alpha = self._pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha') - except: pll_alpha = 0.01 - self.pll_alpha = pll_alpha - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(config_filename) - try: output_filename = self._output_filename_config.get('usrp_rx_hrpt', 'filename') - except: output_filename = 'frames.hrpt' - self.output_filename = output_filename - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(config_filename) - try: gain = self._gain_config.getfloat('usrp_rx_hrpt', 'gain') - except: gain = 35 - self.gain = gain - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(config_filename) - try: freq = self._freq_config.getfloat('usrp_rx_hrpt', 'freq') - except: freq = 1698e6 - self.freq = freq - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(config_filename) - try: clock_alpha = self._clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha') - except: clock_alpha = 0.01 - self.clock_alpha = clock_alpha - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(config_filename) - try: addr = self._addr_config.get('usrp_rx_hrpt', 'addr') - except: addr = "" - self.addr = addr - - ################################################## - # Blocks - ################################################## - self.uhd_usrp_source_0 = uhd.usrp_source( - device_addr=addr, - io_type=uhd.io_type.COMPLEX_FLOAT32, - num_channels=1, - ) - self.uhd_usrp_source_0.set_samp_rate(sample_rate) - self.uhd_usrp_source_0.set_center_freq(freq, 0) - self.uhd_usrp_source_0.set_gain(0, 0) - self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) - self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename) - self.frame_sink.set_unbuffered(False) - self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) - self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() - self.deframer = noaa.hrpt_deframer() - self.decoder = noaa.hrpt_decoder(True,True) - self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - - ################################################## - # Connections - ################################################## - self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) - self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.uhd_usrp_source_0, 0), (self.agc, 0)) - self.connect((self.agc, 0), (self.pll, 0)) - self.connect((self.digital_binary_slicer_fb_0, 0), (self.deframer, 0)) - self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) - self.connect((self.deframer, 0), (self.decoder, 0)) - self.connect((self.deframer, 0), (self.frame_sink, 0)) - - def get_sym_rate(self): - return self.sym_rate - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sample_rate(self): - return self.sample_rate - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) - - def get_config_filename(self): - return self.config_filename - - def set_config_filename(self, config_filename): - self.config_filename = config_filename - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(self.config_filename) - if not self._clock_alpha_config.has_section('usrp_rx_hrpt'): - self._clock_alpha_config.add_section('usrp_rx_hrpt') - self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._clock_alpha_config.write(open(self.config_filename, 'w')) - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(self.config_filename) - if not self._pll_alpha_config.has_section('usrp_rx_hrpt'): - self._pll_alpha_config.add_section('usrp_rx_hrpt') - self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._pll_alpha_config.write(open(self.config_filename, 'w')) - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(self.config_filename) - if not self._gain_config.has_section('usrp_rx_hrpt'): - self._gain_config.add_section('usrp_rx_hrpt') - self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._gain_config.write(open(self.config_filename, 'w')) - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(self.config_filename) - if not self._freq_config.has_section('usrp_rx_hrpt'): - self._freq_config.add_section('usrp_rx_hrpt') - self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._freq_config.write(open(self.config_filename, 'w')) - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(self.config_filename) - if not self._addr_config.has_section('usrp_rx_hrpt'): - self._addr_config.add_section('usrp_rx_hrpt') - self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) - self._addr_config.write(open(self.config_filename, 'w')) - - def get_pll_alpha(self): - return self.pll_alpha - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(self.config_filename) - if not self._pll_alpha_config.has_section('usrp_rx_hrpt'): - self._pll_alpha_config.add_section('usrp_rx_hrpt') - self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._pll_alpha_config.write(open(self.config_filename, 'w')) - self.pll.set_alpha(self.pll_alpha) - self.pll.set_beta(self.pll_alpha**2/4.0) - - def get_output_filename(self): - return self.output_filename - - def set_output_filename(self, output_filename): - self.output_filename = output_filename - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - - def get_max_clock_offset(self): - return self.max_clock_offset - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def get_max_carrier_offset(self): - return self.max_carrier_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - self.pll.set_max_offset(self.max_carrier_offset) - - def get_hs(self): - return self.hs - - def set_hs(self, hs): - self.hs = hs - self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs) - - def get_gain(self): - return self.gain - - def set_gain(self, gain): - self.gain = gain - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(self.config_filename) - if not self._gain_config.has_section('usrp_rx_hrpt'): - self._gain_config.add_section('usrp_rx_hrpt') - self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._gain_config.write(open(self.config_filename, 'w')) - - def get_freq(self): - return self.freq - - def set_freq(self, freq): - self.freq = freq - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(self.config_filename) - if not self._freq_config.has_section('usrp_rx_hrpt'): - self._freq_config.add_section('usrp_rx_hrpt') - self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._freq_config.write(open(self.config_filename, 'w')) - self.uhd_usrp_source_0.set_center_freq(self.freq, 0) - - def get_clock_alpha(self): - return self.clock_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(self.config_filename) - if not self._clock_alpha_config.has_section('usrp_rx_hrpt'): - self._clock_alpha_config.add_section('usrp_rx_hrpt') - self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._clock_alpha_config.write(open(self.config_filename, 'w')) - self.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) - self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) - - def get_addr(self): - return self.addr - - def set_addr(self, addr): - self.addr = addr - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(self.config_filename) - if not self._addr_config.has_section('usrp_rx_hrpt'): - self._addr_config.add_section('usrp_rx_hrpt') - self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) - self._addr_config.write(open(self.config_filename, 'w')) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - (options, args) = parser.parse_args() - tb = usrp_rx_hrpt_nogui() - tb.start() - raw_input('Press Enter to quit: ') - tb.stop() - diff --git a/gr-noaa/apps/CMakeLists.txt b/gr-noaa/examples/CMakeLists.txt index 233f0ee5f..6994148df 100644 --- a/gr-noaa/apps/CMakeLists.txt +++ b/gr-noaa/examples/CMakeLists.txt @@ -17,15 +17,13 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -include(GrPython) - -GR_PYTHON_INSTALL( - PROGRAMS - hrpt_decode.py - hrpt_demod.py - file_rx_hrpt.py - usrp_rx_hrpt.py - usrp_rx_hrpt_nogui.py - DESTINATION ${GR_RUNTIME_DIR} +INSTALL( + FILES + hrpt_decode.grc + hrpt_demod.grc + file_rx_hrpt.grc + usrp_rx_hrpt.grc + usrp_rx_hrpt_nogui.grc + DESTINATION ${GR_PKG_NOAA_EXAMPLES_DIR} COMPONENT "noaa_python" ) diff --git a/gr-noaa/apps/file_rx_hrpt.grc b/gr-noaa/examples/file_rx_hrpt.grc index 4097e83d3..4097e83d3 100644 --- a/gr-noaa/apps/file_rx_hrpt.grc +++ b/gr-noaa/examples/file_rx_hrpt.grc diff --git a/gr-noaa/apps/hrpt_decode.grc b/gr-noaa/examples/hrpt_decode.grc index 39fe195d1..39fe195d1 100644 --- a/gr-noaa/apps/hrpt_decode.grc +++ b/gr-noaa/examples/hrpt_decode.grc diff --git a/gr-noaa/apps/hrpt_demod.grc b/gr-noaa/examples/hrpt_demod.grc index f5833b864..f5833b864 100644 --- a/gr-noaa/apps/hrpt_demod.grc +++ b/gr-noaa/examples/hrpt_demod.grc diff --git a/gr-noaa/apps/usrp_rx_hrpt.grc b/gr-noaa/examples/usrp_rx_hrpt.grc index 26af48ff0..26af48ff0 100644 --- a/gr-noaa/apps/usrp_rx_hrpt.grc +++ b/gr-noaa/examples/usrp_rx_hrpt.grc diff --git a/gr-noaa/apps/usrp_rx_hrpt_nogui.grc b/gr-noaa/examples/usrp_rx_hrpt_nogui.grc index 5936c94c8..5936c94c8 100644 --- a/gr-noaa/apps/usrp_rx_hrpt_nogui.grc +++ b/gr-noaa/examples/usrp_rx_hrpt_nogui.grc diff --git a/gr-pager/apps/CMakeLists.txt b/gr-pager/apps/CMakeLists.txt index 1965c6e66..5fa926031 100644 --- a/gr-pager/apps/CMakeLists.txt +++ b/gr-pager/apps/CMakeLists.txt @@ -21,9 +21,9 @@ include(GrPython) GR_PYTHON_INSTALL( PROGRAMS - usrp_flex.py - usrp_flex_all.py - usrp_flex_band.py + usrp_flex + usrp_flex_all + usrp_flex_band DESTINATION ${GR_RUNTIME_DIR} COMPONENT "pager_python" ) diff --git a/gr-pager/apps/usrp_flex.py b/gr-pager/apps/usrp_flex index 7d0d66a95..7d0d66a95 100755 --- a/gr-pager/apps/usrp_flex.py +++ b/gr-pager/apps/usrp_flex diff --git a/gr-pager/apps/usrp_flex_all.py b/gr-pager/apps/usrp_flex_all index 36bd90034..36bd90034 100755 --- a/gr-pager/apps/usrp_flex_all.py +++ b/gr-pager/apps/usrp_flex_all diff --git a/gr-pager/apps/usrp_flex_band.py b/gr-pager/apps/usrp_flex_band index 63fb93fa1..63fb93fa1 100755 --- a/gr-pager/apps/usrp_flex_band.py +++ b/gr-pager/apps/usrp_flex_band diff --git a/gr-qtgui/CMakeLists.txt b/gr-qtgui/CMakeLists.txt index a8fead401..32bf5bfcb 100644 --- a/gr-qtgui/CMakeLists.txt +++ b/gr-qtgui/CMakeLists.txt @@ -57,6 +57,8 @@ GR_SET_GLOBAL(GR_QTGUI_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/lib ) +SET(GR_PKG_QTGUI_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/qt-gui) + ######################################################################## # Begin conditional configuration ######################################################################## diff --git a/gr-qtgui/examples/CMakeLists.txt b/gr-qtgui/examples/CMakeLists.txt index 30fdc5e75..4622bec29 100644 --- a/gr-qtgui/examples/CMakeLists.txt +++ b/gr-qtgui/examples/CMakeLists.txt @@ -24,6 +24,6 @@ GR_PYTHON_INSTALL(PROGRAMS pyqt_example_f.py pyqt_time_c.py pyqt_time_f.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/qt-gui - COMPONENT "gnuradio_examples" + DESTINATION ${GR_PKG_QTGUI_EXAMPLES_DIR} + COMPONENT "qtgui_python" ) diff --git a/gr-shd/apps/CMakeLists.txt b/gr-shd/apps/CMakeLists.txt index 3930abb57..d36121da1 100644 --- a/gr-shd/apps/CMakeLists.txt +++ b/gr-shd/apps/CMakeLists.txt @@ -24,9 +24,9 @@ include(GrPython) ######################################################################## GR_PYTHON_INSTALL( PROGRAMS - shd_fft.py - shd_rx_cfile.py - shd_siggen.py + shd_fft + shd_rx_cfile + shd_siggen DESTINATION ${GR_RUNTIME_DIR} COMPONENT "shd_python" ) diff --git a/gr-shd/apps/shd_fft.py b/gr-shd/apps/shd_fft index 46832784d..46832784d 100755 --- a/gr-shd/apps/shd_fft.py +++ b/gr-shd/apps/shd_fft diff --git a/gr-shd/apps/shd_rx_cfile.py b/gr-shd/apps/shd_rx_cfile index 007bc809f..007bc809f 100755 --- a/gr-shd/apps/shd_rx_cfile.py +++ b/gr-shd/apps/shd_rx_cfile diff --git a/gr-shd/apps/shd_siggen.py b/gr-shd/apps/shd_siggen index 112eeea15..112eeea15 100755 --- a/gr-shd/apps/shd_siggen.py +++ b/gr-shd/apps/shd_siggen diff --git a/gr-trellis/CMakeLists.txt b/gr-trellis/CMakeLists.txt index dc077571c..4e0ddc4eb 100644 --- a/gr-trellis/CMakeLists.txt +++ b/gr-trellis/CMakeLists.txt @@ -37,6 +37,8 @@ GR_SET_GLOBAL(GR_TRELLIS_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src/lib ) +SET(GR_PKG_TRELLIS_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/trellis) + ######################################################################## # Begin conditional configuration ######################################################################## @@ -97,7 +99,8 @@ add_subdirectory(doc) if(ENABLE_PYTHON) add_subdirectory(grc) add_subdirectory(src/python) - add_subdirectory(src/examples) + add_subdirectory(src/examples/python) + add_subdirectory(src/examples/grc) endif(ENABLE_PYTHON) ######################################################################## diff --git a/gr-trellis/src/examples/grc/CMakeLists.txt b/gr-trellis/src/examples/grc/CMakeLists.txt new file mode 100644 index 000000000..51197a9f4 --- /dev/null +++ b/gr-trellis/src/examples/grc/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright 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. + +install( + FILES + interference_cancellation.grc + pccc1.grc + pccc.grc + sccc1.grc + sccc.grc + readme.txt + DESTINATION ${GR_PKG_TRELLIS_EXAMPLES_DIR} + COMPONENT "trellis-examples" +) diff --git a/gnuradio-examples/grc/trellis/interference_cancellation.grc b/gr-trellis/src/examples/grc/interference_cancellation.grc index 7674b4bf1..7674b4bf1 100644 --- a/gnuradio-examples/grc/trellis/interference_cancellation.grc +++ b/gr-trellis/src/examples/grc/interference_cancellation.grc diff --git a/gnuradio-examples/grc/trellis/pccc.grc b/gr-trellis/src/examples/grc/pccc.grc index c3111c321..c3111c321 100644 --- a/gnuradio-examples/grc/trellis/pccc.grc +++ b/gr-trellis/src/examples/grc/pccc.grc diff --git a/gnuradio-examples/grc/trellis/pccc1.grc b/gr-trellis/src/examples/grc/pccc1.grc index 15a63707e..15a63707e 100644 --- a/gnuradio-examples/grc/trellis/pccc1.grc +++ b/gr-trellis/src/examples/grc/pccc1.grc diff --git a/gnuradio-examples/grc/trellis/readme.txt b/gr-trellis/src/examples/grc/readme.txt index 9c7363af8..9c7363af8 100644 --- a/gnuradio-examples/grc/trellis/readme.txt +++ b/gr-trellis/src/examples/grc/readme.txt diff --git a/gnuradio-examples/grc/trellis/sccc.grc b/gr-trellis/src/examples/grc/sccc.grc index e8f656f63..e8f656f63 100644 --- a/gnuradio-examples/grc/trellis/sccc.grc +++ b/gr-trellis/src/examples/grc/sccc.grc diff --git a/gnuradio-examples/grc/trellis/sccc1.grc b/gr-trellis/src/examples/grc/sccc1.grc index 0be59d0c4..0be59d0c4 100644 --- a/gnuradio-examples/grc/trellis/sccc1.grc +++ b/gr-trellis/src/examples/grc/sccc1.grc diff --git a/gr-trellis/src/examples/CMakeLists.txt b/gr-trellis/src/examples/python/CMakeLists.txt index 0d9589908..e2c7e70ff 100644 --- a/gr-trellis/src/examples/CMakeLists.txt +++ b/gr-trellis/src/examples/python/CMakeLists.txt @@ -33,7 +33,7 @@ GR_PYTHON_INSTALL( test_turbo_equalization.py test_turbo_equalization1.py test_turbo_equalization2.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/trellis + DESTINATION ${GR_PKG_TRELLIS_EXAMPLES_DIR} COMPONENT "trellis_examples" ) @@ -59,6 +59,6 @@ install( fsm_files/rep3.fsm fsm_files/rep5.fsm fsm_files/simple.fsm - DESTINATION ${GR_PKG_DATA_DIR}/examples/trellis/fsm_files + DESTINATION ${GR_PKG_TRELLIS_EXAMPLES_DIR}/fsm_files COMPONENT "trellis_examples" ) diff --git a/gr-trellis/src/examples/README b/gr-trellis/src/examples/python/README index bd28e3d61..bd28e3d61 100644 --- a/gr-trellis/src/examples/README +++ b/gr-trellis/src/examples/python/README diff --git a/gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm b/gr-trellis/src/examples/python/fsm_files/awgn1o2_128.fsm index bb79c59da..bb79c59da 100644 --- a/gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn1o2_128.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm b/gr-trellis/src/examples/python/fsm_files/awgn1o2_16.fsm index cdab41359..cdab41359 100644 --- a/gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn1o2_16.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm b/gr-trellis/src/examples/python/fsm_files/awgn1o2_4.fsm index fb316b5ef..fb316b5ef 100644 --- a/gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn1o2_4.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn1o2_8.fsm b/gr-trellis/src/examples/python/fsm_files/awgn1o2_8.fsm index 604bac6c2..604bac6c2 100644 --- a/gr-trellis/src/examples/fsm_files/awgn1o2_8.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn1o2_8.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_16.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_16.fsm index 9630cd9af..9630cd9af 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_16.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_16.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4.fsm index 3ac57be18..3ac57be18 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_4_msb.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msb.fsm index 551b71101..551b71101 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_4_msb.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msb.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_4_msbG.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msbG.fsm index 8956c53da..8956c53da 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_4_msbG.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_4_msbG.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o3_8.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o3_8.fsm index 34deeb68c..34deeb68c 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o3_8.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o3_8.fsm diff --git a/gr-trellis/src/examples/fsm_files/awgn2o4_4.fsm b/gr-trellis/src/examples/python/fsm_files/awgn2o4_4.fsm index a895be896..a895be896 100644 --- a/gr-trellis/src/examples/fsm_files/awgn2o4_4.fsm +++ b/gr-trellis/src/examples/python/fsm_files/awgn2o4_4.fsm diff --git a/gr-trellis/src/examples/fsm_files/disconnected.fsm b/gr-trellis/src/examples/python/fsm_files/disconnected.fsm index 847963e7b..847963e7b 100644 --- a/gr-trellis/src/examples/fsm_files/disconnected.fsm +++ b/gr-trellis/src/examples/python/fsm_files/disconnected.fsm diff --git a/gr-trellis/src/examples/fsm_files/irregular.fsm b/gr-trellis/src/examples/python/fsm_files/irregular.fsm index 80b82b889..80b82b889 100644 --- a/gr-trellis/src/examples/fsm_files/irregular.fsm +++ b/gr-trellis/src/examples/python/fsm_files/irregular.fsm diff --git a/gr-trellis/src/examples/fsm_files/joint_16_16.fsm b/gr-trellis/src/examples/python/fsm_files/joint_16_16.fsm index 3dae314b6..3dae314b6 100644 --- a/gr-trellis/src/examples/fsm_files/joint_16_16.fsm +++ b/gr-trellis/src/examples/python/fsm_files/joint_16_16.fsm diff --git a/gr-trellis/src/examples/fsm_files/joint_4_16.fsm b/gr-trellis/src/examples/python/fsm_files/joint_4_16.fsm index 8f2cdab81..8f2cdab81 100644 --- a/gr-trellis/src/examples/fsm_files/joint_4_16.fsm +++ b/gr-trellis/src/examples/python/fsm_files/joint_4_16.fsm diff --git a/gr-trellis/src/examples/fsm_files/rep3.fsm b/gr-trellis/src/examples/python/fsm_files/rep3.fsm index ef1bd1f02..ef1bd1f02 100644 --- a/gr-trellis/src/examples/fsm_files/rep3.fsm +++ b/gr-trellis/src/examples/python/fsm_files/rep3.fsm diff --git a/gr-trellis/src/examples/fsm_files/rep5.fsm b/gr-trellis/src/examples/python/fsm_files/rep5.fsm index 2aa5d77cf..2aa5d77cf 100644 --- a/gr-trellis/src/examples/fsm_files/rep5.fsm +++ b/gr-trellis/src/examples/python/fsm_files/rep5.fsm diff --git a/gr-trellis/src/examples/fsm_files/simple.fsm b/gr-trellis/src/examples/python/fsm_files/simple.fsm index f27f6b4b0..f27f6b4b0 100644 --- a/gr-trellis/src/examples/fsm_files/simple.fsm +++ b/gr-trellis/src/examples/python/fsm_files/simple.fsm diff --git a/gr-trellis/src/examples/fsm_utils.py b/gr-trellis/src/examples/python/fsm_utils.py index e9243f899..e9243f899 100755 --- a/gr-trellis/src/examples/fsm_utils.py +++ b/gr-trellis/src/examples/python/fsm_utils.py diff --git a/gr-trellis/src/examples/test_cpm.py b/gr-trellis/src/examples/python/test_cpm.py index 06d54b1a6..06d54b1a6 100755 --- a/gr-trellis/src/examples/test_cpm.py +++ b/gr-trellis/src/examples/python/test_cpm.py diff --git a/gr-trellis/src/examples/test_pccc_turbo1.py b/gr-trellis/src/examples/python/test_pccc_turbo1.py index 7f1ea26ae..7f1ea26ae 100755 --- a/gr-trellis/src/examples/test_pccc_turbo1.py +++ b/gr-trellis/src/examples/python/test_pccc_turbo1.py diff --git a/gr-trellis/src/examples/test_sccc_hard.py b/gr-trellis/src/examples/python/test_sccc_hard.py index e732ac2c0..e732ac2c0 100755 --- a/gr-trellis/src/examples/test_sccc_hard.py +++ b/gr-trellis/src/examples/python/test_sccc_hard.py diff --git a/gr-trellis/src/examples/test_sccc_soft.py b/gr-trellis/src/examples/python/test_sccc_soft.py index 1c71e4ca7..1c71e4ca7 100755 --- a/gr-trellis/src/examples/test_sccc_soft.py +++ b/gr-trellis/src/examples/python/test_sccc_soft.py diff --git a/gr-trellis/src/examples/test_sccc_turbo.py b/gr-trellis/src/examples/python/test_sccc_turbo.py index b1007a864..b1007a864 100755 --- a/gr-trellis/src/examples/test_sccc_turbo.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo.py diff --git a/gr-trellis/src/examples/test_sccc_turbo1.py b/gr-trellis/src/examples/python/test_sccc_turbo1.py index ad2ed6bf9..ad2ed6bf9 100755 --- a/gr-trellis/src/examples/test_sccc_turbo1.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo1.py diff --git a/gr-trellis/src/examples/test_sccc_turbo2.py b/gr-trellis/src/examples/python/test_sccc_turbo2.py index fdb92adc8..fdb92adc8 100755 --- a/gr-trellis/src/examples/test_sccc_turbo2.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo2.py diff --git a/gr-trellis/src/examples/test_tcm.py b/gr-trellis/src/examples/python/test_tcm.py index 62fd5135e..62fd5135e 100755 --- a/gr-trellis/src/examples/test_tcm.py +++ b/gr-trellis/src/examples/python/test_tcm.py diff --git a/gr-trellis/src/examples/test_tcm_bit.py b/gr-trellis/src/examples/python/test_tcm_bit.py index cc5caefbc..cc5caefbc 100755 --- a/gr-trellis/src/examples/test_tcm_bit.py +++ b/gr-trellis/src/examples/python/test_tcm_bit.py diff --git a/gr-trellis/src/examples/test_tcm_combined.py b/gr-trellis/src/examples/python/test_tcm_combined.py index 55a3043b8..55a3043b8 100755 --- a/gr-trellis/src/examples/test_tcm_combined.py +++ b/gr-trellis/src/examples/python/test_tcm_combined.py diff --git a/gr-trellis/src/examples/test_tcm_parallel.py b/gr-trellis/src/examples/python/test_tcm_parallel.py index 2b722c09e..2b722c09e 100755 --- a/gr-trellis/src/examples/test_tcm_parallel.py +++ b/gr-trellis/src/examples/python/test_tcm_parallel.py diff --git a/gr-trellis/src/examples/test_turbo_equalization.py b/gr-trellis/src/examples/python/test_turbo_equalization.py index 6fa6749f0..6fa6749f0 100755 --- a/gr-trellis/src/examples/test_turbo_equalization.py +++ b/gr-trellis/src/examples/python/test_turbo_equalization.py diff --git a/gr-trellis/src/examples/test_turbo_equalization1.py b/gr-trellis/src/examples/python/test_turbo_equalization1.py index 15a8f6809..15a8f6809 100755 --- a/gr-trellis/src/examples/test_turbo_equalization1.py +++ b/gr-trellis/src/examples/python/test_turbo_equalization1.py diff --git a/gr-trellis/src/examples/test_turbo_equalization2.py b/gr-trellis/src/examples/python/test_turbo_equalization2.py index 7e4341cba..7e4341cba 100755 --- a/gr-trellis/src/examples/test_turbo_equalization2.py +++ b/gr-trellis/src/examples/python/test_turbo_equalization2.py diff --git a/gr-trellis/src/examples/test_viterbi_equalization.py b/gr-trellis/src/examples/python/test_viterbi_equalization.py index d290a0d0a..d290a0d0a 100755 --- a/gr-trellis/src/examples/test_viterbi_equalization.py +++ b/gr-trellis/src/examples/python/test_viterbi_equalization.py diff --git a/gr-trellis/src/examples/test_viterbi_equalization1.py b/gr-trellis/src/examples/python/test_viterbi_equalization1.py index 41f777551..41f777551 100755 --- a/gr-trellis/src/examples/test_viterbi_equalization1.py +++ b/gr-trellis/src/examples/python/test_viterbi_equalization1.py diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt index 4f4503234..3ba4f5342 100644 --- a/gr-uhd/CMakeLists.txt +++ b/gr-uhd/CMakeLists.txt @@ -39,6 +39,8 @@ GR_SET_GLOBAL(GR_UHD_INCLUDE_DIRS ${UHD_INCLUDE_DIRS} ) +SET(GR_PKG_UHD_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/uhd) + ######################################################################## # Begin conditional configuration ######################################################################## @@ -71,6 +73,13 @@ CPACK_COMPONENT("uhd_python" DEPENDS "core_python;uhd_runtime" ) +CPACK_COMPONENT("uhd_examples" + GROUP "UHD" + DISPLAY_NAME "Examples" + DESCRIPTION "Example programs" + DEPENDS "uhd_runtime" +) + CPACK_COMPONENT("uhd_swig" GROUP "UHD" DISPLAY_NAME "SWIG" @@ -83,12 +92,14 @@ CPACK_COMPONENT("uhd_swig" ######################################################################## add_subdirectory(include) add_subdirectory(lib) -add_subdirectory(examples) add_subdirectory(doc) +add_subdirectory(examples/c++) if(ENABLE_PYTHON) add_subdirectory(swig) add_subdirectory(grc) add_subdirectory(apps) + add_subdirectory(examples/python) + add_subdirectory(examples/grc) endif(ENABLE_PYTHON) ######################################################################## diff --git a/gr-uhd/apps/CMakeLists.txt b/gr-uhd/apps/CMakeLists.txt index 20ae8993f..1d68c00ac 100644 --- a/gr-uhd/apps/CMakeLists.txt +++ b/gr-uhd/apps/CMakeLists.txt @@ -23,12 +23,19 @@ include(GrPython) # Install some uhd apps ######################################################################## GR_PYTHON_INSTALL( + FILES + uhd_siggen_base.py + DESTINATION ${GR_PYTHON_DIR}/gnuradio/uhd + COMPONENT "uhd_python" +) + +GR_PYTHON_INSTALL( PROGRAMS - uhd_fft.py - uhd_rx_cfile.py - uhd_siggen.py - uhd_siggen_gui.py - uhd_rx_nogui.py + uhd_fft + uhd_rx_cfile + uhd_siggen + uhd_siggen_gui + uhd_rx_nogui DESTINATION ${GR_RUNTIME_DIR} COMPONENT "uhd_python" ) diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft index 39ba3838e..39ba3838e 100755 --- a/gr-uhd/apps/uhd_fft.py +++ b/gr-uhd/apps/uhd_fft diff --git a/gr-uhd/apps/uhd_rx_cfile.py b/gr-uhd/apps/uhd_rx_cfile index a61361e43..a61361e43 100755 --- a/gr-uhd/apps/uhd_rx_cfile.py +++ b/gr-uhd/apps/uhd_rx_cfile diff --git a/gr-uhd/apps/uhd_rx_nogui.py b/gr-uhd/apps/uhd_rx_nogui index bcb52c619..bcb52c619 100755 --- a/gr-uhd/apps/uhd_rx_nogui.py +++ b/gr-uhd/apps/uhd_rx_nogui diff --git a/gr-uhd/apps/uhd_siggen b/gr-uhd/apps/uhd_siggen new file mode 100755 index 000000000..26e0d79a4 --- /dev/null +++ b/gr-uhd/apps/uhd_siggen @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# +# Copyright 2008,2009,2011,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 +from gnuradio.uhd import uhd_siggen_base as uhd_siggen +import sys + +def main(): + if gr.enable_realtime_scheduling() != gr.RT_OK: + print "Note: failed to enable realtime scheduling, continuing" + + # Grab command line options and create top block + try: + (options, args) = uhd_siggen.get_options() + tb = uhd_siggen.top_block(options, args) + + except RuntimeError, e: + print e + sys.exit(1) + + tb.start() + raw_input('Press Enter to quit: ') + tb.stop() + tb.wait() + +# Make sure to create the top block (tb) within a function: +# That code in main will allow tb to go out of scope on return, +# which will call the decontructor on usrp and stop transmit. +# Whats odd is that grc works fine with tb in the __main__, +# perhaps its because the try/except clauses around tb. +if __name__ == "__main__": + main() diff --git a/gr-uhd/apps/uhd_siggen.py b/gr-uhd/apps/uhd_siggen_base.py index e1af586ae..5ec4fc5fb 100755..100644 --- a/gr-uhd/apps/uhd_siggen.py +++ b/gr-uhd/apps/uhd_siggen_base.py @@ -344,7 +344,7 @@ def get_options(): # If this script is executed, the following runs. If it is imported, # the below does not run. -def main(): +def test_main(): if gr.enable_realtime_scheduling() != gr.RT_OK: print "Note: failed to enable realtime scheduling, continuing" @@ -368,4 +368,4 @@ def main(): # Whats odd is that grc works fine with tb in the __main__, # perhaps its because the try/except clauses around tb. if __name__ == "__main__": - main() + test_main() diff --git a/gr-uhd/apps/uhd_siggen_gui.py b/gr-uhd/apps/uhd_siggen_gui index 2ef6ea40f..861f18944 100755 --- a/gr-uhd/apps/uhd_siggen_gui.py +++ b/gr-uhd/apps/uhd_siggen_gui @@ -24,7 +24,7 @@ import wx from gnuradio import gr from gnuradio.gr.pubsub import pubsub from gnuradio.wxgui import gui, forms -import uhd_siggen +from gnuradio.uhd import uhd_siggen_base as uhd_siggen import sys, math class app_gui(pubsub): diff --git a/gr-uhd/examples/CMakeLists.txt b/gr-uhd/examples/c++/CMakeLists.txt index 91e2dfdaf..25645117c 100644 --- a/gr-uhd/examples/CMakeLists.txt +++ b/gr-uhd/examples/c++/CMakeLists.txt @@ -38,30 +38,8 @@ link_directories(${Boost_LIBRARY_DIRS}) add_executable(tags_demo tags_demo.cc) target_link_libraries(tags_demo gnuradio-uhd) -######################################################################## -# Python examples -######################################################################## -if(ENABLE_PYTHON) -GR_PYTHON_INSTALL( - PROGRAMS - fm_tx4.py - fm_tx_2_daughterboards.py - max_power.py - usrp_am_mw_rcv.py - usrp_nbfm_ptt.py - usrp_nbfm_rcv.py - usrp_spectrum_sense.py - usrp_tv_rcv_nogui.py - usrp_tv_rcv.py - usrp_wfm_rcv2_nogui.py - usrp_wfm_rcv_fmdet.py - usrp_wfm_rcv_nogui.py - usrp_wfm_rcv_pll.py - usrp_wfm_rcv.py - usrp_wfm_rcv_sca.py - usrp_wxapt_rcv.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/uhd - COMPONENT "uhd_python" +INSTALL(TARGETS + tags_demo + DESTINATION ${GR_PKG_UHD_EXAMPLES_DIR} + COMPONENT "uhd_examples" ) - -endif(ENABLE_PYTHON) diff --git a/gr-uhd/examples/tag_sink_demo.h b/gr-uhd/examples/c++/tag_sink_demo.h index 7d49bd971..7d49bd971 100644 --- a/gr-uhd/examples/tag_sink_demo.h +++ b/gr-uhd/examples/c++/tag_sink_demo.h diff --git a/gr-uhd/examples/tag_source_demo.h b/gr-uhd/examples/c++/tag_source_demo.h index 9743c3407..9743c3407 100644 --- a/gr-uhd/examples/tag_source_demo.h +++ b/gr-uhd/examples/c++/tag_source_demo.h diff --git a/gr-uhd/examples/tags_demo.cc b/gr-uhd/examples/c++/tags_demo.cc index f7442f098..f7442f098 100644 --- a/gr-uhd/examples/tags_demo.cc +++ b/gr-uhd/examples/c++/tags_demo.cc diff --git a/gr-uhd/examples/grc/CMakeLists.txt b/gr-uhd/examples/grc/CMakeLists.txt new file mode 100644 index 000000000..06c233d45 --- /dev/null +++ b/gr-uhd/examples/grc/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright 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. + +install( + FILES + uhd_const_wave.grc + uhd_dpsk_mod.grc + uhd_fft.grc + uhd_rx_dpsk.grc + uhd_two_tone_loopback.grc + uhd_tx_dpsk.grc + uhd_wbfm_receive.grc + DESTINATION ${GR_PKG_UHD_EXAMPLES_DIR} + COMPONENT "uhd_python" +) diff --git a/gnuradio-examples/grc/uhd/uhd_const_wave.grc b/gr-uhd/examples/grc/uhd_const_wave.grc index c64721c83..c64721c83 100644 --- a/gnuradio-examples/grc/uhd/uhd_const_wave.grc +++ b/gr-uhd/examples/grc/uhd_const_wave.grc diff --git a/gnuradio-examples/grc/uhd/uhd_dpsk_mod.grc b/gr-uhd/examples/grc/uhd_dpsk_mod.grc index 18ae9c3db..18ae9c3db 100644 --- a/gnuradio-examples/grc/uhd/uhd_dpsk_mod.grc +++ b/gr-uhd/examples/grc/uhd_dpsk_mod.grc diff --git a/gnuradio-examples/grc/uhd/uhd_fft.grc b/gr-uhd/examples/grc/uhd_fft.grc index 29c375065..29c375065 100644 --- a/gnuradio-examples/grc/uhd/uhd_fft.grc +++ b/gr-uhd/examples/grc/uhd_fft.grc diff --git a/gnuradio-examples/grc/uhd/uhd_rx_dpsk.grc b/gr-uhd/examples/grc/uhd_rx_dpsk.grc index 73848ff3c..73848ff3c 100644 --- a/gnuradio-examples/grc/uhd/uhd_rx_dpsk.grc +++ b/gr-uhd/examples/grc/uhd_rx_dpsk.grc diff --git a/gnuradio-examples/grc/uhd/uhd_two_tone_loopback.grc b/gr-uhd/examples/grc/uhd_two_tone_loopback.grc index 8bcbc0792..8bcbc0792 100644 --- a/gnuradio-examples/grc/uhd/uhd_two_tone_loopback.grc +++ b/gr-uhd/examples/grc/uhd_two_tone_loopback.grc diff --git a/gnuradio-examples/grc/uhd/uhd_tx_dpsk.grc b/gr-uhd/examples/grc/uhd_tx_dpsk.grc index 281ba8429..281ba8429 100644 --- a/gnuradio-examples/grc/uhd/uhd_tx_dpsk.grc +++ b/gr-uhd/examples/grc/uhd_tx_dpsk.grc diff --git a/gnuradio-examples/grc/uhd/uhd_wbfm_receive.grc b/gr-uhd/examples/grc/uhd_wbfm_receive.grc index 62658a2eb..62658a2eb 100644 --- a/gnuradio-examples/grc/uhd/uhd_wbfm_receive.grc +++ b/gr-uhd/examples/grc/uhd_wbfm_receive.grc diff --git a/gr-uhd/examples/python/CMakeLists.txt b/gr-uhd/examples/python/CMakeLists.txt new file mode 100644 index 000000000..7642b536b --- /dev/null +++ b/gr-uhd/examples/python/CMakeLists.txt @@ -0,0 +1,42 @@ +# Copyright 2011 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. + +include(GrPython) + +GR_PYTHON_INSTALL( + PROGRAMS + fm_tx4.py + fm_tx_2_daughterboards.py + max_power.py + usrp_am_mw_rcv.py + usrp_nbfm_ptt.py + usrp_nbfm_rcv.py + usrp_spectrum_sense.py + usrp_tv_rcv_nogui.py + usrp_tv_rcv.py + usrp_wfm_rcv2_nogui.py + usrp_wfm_rcv_fmdet.py + usrp_wfm_rcv_nogui.py + usrp_wfm_rcv_pll.py + usrp_wfm_rcv.py + usrp_wfm_rcv_sca.py + usrp_wxapt_rcv.py + DESTINATION ${GR_PKG_UHD_EXAMPLES_DIR} + COMPONENT "uhd_python" +) diff --git a/gr-uhd/examples/fm_tx4.py b/gr-uhd/examples/python/fm_tx4.py index aecb35b54..aecb35b54 100755 --- a/gr-uhd/examples/fm_tx4.py +++ b/gr-uhd/examples/python/fm_tx4.py diff --git a/gr-uhd/examples/fm_tx_2_daughterboards.py b/gr-uhd/examples/python/fm_tx_2_daughterboards.py index c0a7112de..c0a7112de 100755 --- a/gr-uhd/examples/fm_tx_2_daughterboards.py +++ b/gr-uhd/examples/python/fm_tx_2_daughterboards.py diff --git a/gr-uhd/examples/max_power.py b/gr-uhd/examples/python/max_power.py index a849432ee..a849432ee 100755 --- a/gr-uhd/examples/max_power.py +++ b/gr-uhd/examples/python/max_power.py diff --git a/gr-uhd/examples/usrp_am_mw_rcv.py b/gr-uhd/examples/python/usrp_am_mw_rcv.py index 85ffd7632..85ffd7632 100755 --- a/gr-uhd/examples/usrp_am_mw_rcv.py +++ b/gr-uhd/examples/python/usrp_am_mw_rcv.py diff --git a/gr-uhd/examples/usrp_nbfm_ptt.py b/gr-uhd/examples/python/usrp_nbfm_ptt.py index 075604af3..075604af3 100755 --- a/gr-uhd/examples/usrp_nbfm_ptt.py +++ b/gr-uhd/examples/python/usrp_nbfm_ptt.py diff --git a/gr-uhd/examples/usrp_nbfm_rcv.py b/gr-uhd/examples/python/usrp_nbfm_rcv.py index 6fdf95a30..6fdf95a30 100755 --- a/gr-uhd/examples/usrp_nbfm_rcv.py +++ b/gr-uhd/examples/python/usrp_nbfm_rcv.py diff --git a/gr-uhd/examples/usrp_spectrum_sense.py b/gr-uhd/examples/python/usrp_spectrum_sense.py index 355a55a98..355a55a98 100755 --- a/gr-uhd/examples/usrp_spectrum_sense.py +++ b/gr-uhd/examples/python/usrp_spectrum_sense.py diff --git a/gr-uhd/examples/usrp_tv_rcv.py b/gr-uhd/examples/python/usrp_tv_rcv.py index 700915bf8..700915bf8 100755 --- a/gr-uhd/examples/usrp_tv_rcv.py +++ b/gr-uhd/examples/python/usrp_tv_rcv.py diff --git a/gr-uhd/examples/usrp_tv_rcv_nogui.py b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py index 870e65b27..870e65b27 100755 --- a/gr-uhd/examples/usrp_tv_rcv_nogui.py +++ b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py diff --git a/gr-uhd/examples/usrp_wfm_rcv.py b/gr-uhd/examples/python/usrp_wfm_rcv.py index f6c5cf853..f6c5cf853 100755 --- a/gr-uhd/examples/usrp_wfm_rcv.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv.py diff --git a/gr-uhd/examples/usrp_wfm_rcv2_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py index b70334f30..b70334f30 100755 --- a/gr-uhd/examples/usrp_wfm_rcv2_nogui.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py diff --git a/gr-uhd/examples/usrp_wfm_rcv_fmdet.py b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py index 9649857c0..9649857c0 100755 --- a/gr-uhd/examples/usrp_wfm_rcv_fmdet.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py diff --git a/gr-uhd/examples/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py index f0195bcb5..f0195bcb5 100755 --- a/gr-uhd/examples/usrp_wfm_rcv_nogui.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py diff --git a/gr-uhd/examples/usrp_wfm_rcv_pll.py b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py index b0744b00b..b0744b00b 100755 --- a/gr-uhd/examples/usrp_wfm_rcv_pll.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py diff --git a/gr-uhd/examples/usrp_wfm_rcv_sca.py b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py index 224f30cf8..224f30cf8 100755 --- a/gr-uhd/examples/usrp_wfm_rcv_sca.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py diff --git a/gr-uhd/examples/usrp_wxapt_rcv.py b/gr-uhd/examples/python/usrp_wxapt_rcv.py index d9b1a0188..d9b1a0188 100755 --- a/gr-uhd/examples/usrp_wxapt_rcv.py +++ b/gr-uhd/examples/python/usrp_wxapt_rcv.py diff --git a/gr-utils/src/python/CMakeLists.txt b/gr-utils/src/python/CMakeLists.txt index fba0d57a5..90caeb234 100644 --- a/gr-utils/src/python/CMakeLists.txt +++ b/gr-utils/src/python/CMakeLists.txt @@ -25,6 +25,8 @@ include(GrPython) GR_PYTHON_INSTALL( FILES plot_data.py + plot_fft_base.py + plot_psd_base.py pyqt_plot.py pyqt_filter.py DESTINATION ${GR_PYTHON_DIR}/gnuradio @@ -34,20 +36,20 @@ GR_PYTHON_INSTALL( GR_PYTHON_INSTALL( PROGRAMS create-gnuradio-out-of-tree-project - gr_plot_char.py - gr_plot_const.py - gr_plot_fft.py - gr_plot_fft_c.py - gr_plot_fft_f.py - gr_plot_psd.py - gr_plot_psd_c.py - gr_plot_psd_f.py - gr_plot_float.py - gr_plot_int.py - gr_plot_iq.py - gr_plot_short.py - gr_plot_qt.py - gr_filter_design.py + gr_plot_char + gr_plot_const + gr_plot_fft + gr_plot_fft_c + gr_plot_fft_f + gr_plot_psd + gr_plot_psd_c + gr_plot_psd_f + gr_plot_float + gr_plot_int + gr_plot_iq + gr_plot_short + gr_plot_qt + gr_filter_design DESTINATION ${GR_RUNTIME_DIR} COMPONENT "utils" ) diff --git a/gr-utils/src/python/README.plot b/gr-utils/src/python/README.plot index 0c4657ba9..60f14c669 100644 --- a/gr-utils/src/python/README.plot +++ b/gr-utils/src/python/README.plot @@ -1,40 +1,97 @@ -* gr_plot_*.py: -These are a collection of Python scripts to enable viewing and analysis of files produced by GNU Radio flow graphs. Most of them work off complex data produced by digital waveforms. +* gr_plot_*: +These are a collection of Python scripts to enable viewing and +analysis of files produced by GNU Radio flow graphs. Most of them work +off complex data produced by digital waveforms. -** gr_plot_float.py: -Takes a GNU Radio floating point binary file and displays the samples versus time. You can set the block size to specify how many points to read in at a time and the start position in the file. +** gr_plot_float: +Takes a GNU Radio floating point binary file and displays the samples +versus time. You can set the block size to specify how many points to +read in at a time and the start position in the file. -By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples. +By default, the system assumes a sample rate of 1, so in time, each +sample is plotted versus the sample number. To set a true time axis, +set the sample rate (-R or --sample-rate) to the sample rate used when +capturing the samples. -** gr_plot_iq.py: -Takes a GNU Radio complex binary file and displays the I&Q data versus time. You can set the block size to specify how many points to read in at a time and the start position in the file. +** gr_plot_iq: +Takes a GNU Radio complex binary file and displays the I&Q data versus +time. You can set the block size to specify how many points to read in +at a time and the start position in the file. -By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples. +By default, the system assumes a sample rate of 1, so in time, each +sample is plotted versus the sample number. To set a true time axis, +set the sample rate (-R or --sample-rate) to the sample rate used when +capturing the samples. -** gr_plot_const.py: -Takes a GNU Radio complex binary file and displays the I&Q data versus time and the constellation plot (I vs. Q). You can set the block size to specify how many points to read in at a time and the start position in the file. +** gr_plot_const: +Takes a GNU Radio complex binary file and displays the I&Q data versus +time and the constellation plot (I vs. Q). You can set the block size +to specify how many points to read in at a time and the start position +in the file. -By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples. +By default, the system assumes a sample rate of 1, so in time, each +sample is plotted versus the sample number. To set a true time axis, +set the sample rate (-R or --sample-rate) to the sample rate used when +capturing the samples. -** gr_plot_fft_c.py: -Takes a GNU Radio complex binary file and displays the I&Q data versus time as well as the frequency domain (FFT) plot. The y-axis values are plotted assuming volts as the amplitude of the I&Q streams and converted into dBm in the frequency domain (the 1/N power adjustment out of the FFT is performed internally). +** gr_plot_fft_c: +Takes a GNU Radio complex binary file and displays the I&Q data versus +time as well as the frequency domain (FFT) plot. The y-axis values are +plotted assuming volts as the amplitude of the I&Q streams and +converted into dBm in the frequency domain (the 1/N power adjustment +out of the FFT is performed internally). -The script plots a certain block of data at a time, specified on the command line as -B or --block. This value defaults to 1000. The start position in the file can be set by specifying -s or --start and defaults to 0 (the start of the file). +The script plots a certain block of data at a time, specified on the +command line as -B or --block. This value defaults to 1000. The start +position in the file can be set by specifying -s or --start and +defaults to 0 (the start of the file). -By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time and frequency axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples. +By default, the system assumes a sample rate of 1, so in time, each +sample is plotted versus the sample number. To set a true time and +frequency axis, set the sample rate (-R or --sample-rate) to the +sample rate used when capturing the samples. -** gr_plot_fft_f.py: -Takes a GNU Radio floating point binary file and displays the samples versus time as well as the frequency domain (FFT) plot. The y-axis values are plotted assuming volts as the amplitude of the I&Q streams and converted into dBm in the frequency domain (the 1/N power adjustment out of the FFT is performed internally). +** gr_plot_fft_f: +Takes a GNU Radio floating point binary file and displays the samples +versus time as well as the frequency domain (FFT) plot. The y-axis +values are plotted assuming volts as the amplitude of the I&Q streams +and converted into dBm in the frequency domain (the 1/N power +adjustment out of the FFT is performed internally). -The script plots a certain block of data at a time, specified on the command line as -B or --block. This value defaults to 1000. The start position in the file can be set by specifying -s or --start and defaults to 0 (the start of the file). +The script plots a certain block of data at a time, specified on the +command line as -B or --block. This value defaults to 1000. The start +position in the file can be set by specifying -s or --start and +defaults to 0 (the start of the file). -By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time and frequency axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples. +By default, the system assumes a sample rate of 1, so in time, each +sample is plotted versus the sample number. To set a true time and +frequency axis, set the sample rate (-R or --sample-rate) to the +sample rate used when capturing the samples. + + +** gr_plot_fft: +Takes a GNU Radio binary file (the datatype is specified using the -d +option and defaults to complex64) and displays the samples versus time +as well as the frequency domain (FFT) plot. The y-axis values are +plotted assuming volts as the amplitude of the I&Q streams and +converted into dBm in the frequency domain (the 1/N power adjustment +out of the FFT is performed internally). + +The script plots a certain block of data at a time, specified on the +command line as -B or --block. This value defaults to 1000. The start +position in the file can be set by specifying -s or --start and +defaults to 0 (the start of the file). + +By default, the system assumes a sample rate of 1, so in time, each +sample is plotted versus the sample number. To set a true time and +frequency axis, set the sample rate (-R or --sample-rate) to the +sample rate used when capturing the samples. diff --git a/gr-utils/src/python/gr_filter_design.py b/gr-utils/src/python/gr_filter_design index e8703db4f..e8703db4f 100755 --- a/gr-utils/src/python/gr_filter_design.py +++ b/gr-utils/src/python/gr_filter_design diff --git a/gr-utils/src/python/gr_plot_char.py b/gr-utils/src/python/gr_plot_char index 87a323c9c..87a323c9c 100755 --- a/gr-utils/src/python/gr_plot_char.py +++ b/gr-utils/src/python/gr_plot_char diff --git a/gr-utils/src/python/gr_plot_const.py b/gr-utils/src/python/gr_plot_const index 8873e5b7e..8873e5b7e 100755 --- a/gr-utils/src/python/gr_plot_const.py +++ b/gr-utils/src/python/gr_plot_const diff --git a/gr-utils/src/python/gr_plot_fft b/gr-utils/src/python/gr_plot_fft new file mode 100644 index 000000000..6859ea471 --- /dev/null +++ b/gr-utils/src/python/gr_plot_fft @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# +# Copyright 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.plot_fft_base import plot_fft_base + +# This is a wrapper program for plot_fft_base. It handles any data +# type and defaults to complex64. + +def main(): + parser = plot_fft_base.setup_options() + (options, args) = parser.parse_args () + if len(args) != 1: + parser.print_help() + raise SystemExit, 1 + filename = args[0] + + dc = plot_fft_base(options.data_type, filename, options) + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + pass diff --git a/gr-utils/src/python/gr_plot_fft_f.py b/gr-utils/src/python/gr_plot_fft_c index f50358f01..e4ee9c5a9 100755 --- a/gr-utils/src/python/gr_plot_fft_f.py +++ b/gr-utils/src/python/gr_plot_fft_c @@ -20,10 +20,12 @@ # Boston, MA 02110-1301, USA. # -import gr_plot_fft +from gnuradio.plot_fft_base import plot_fft_base + +# This is a wrapper program for plot_fft_base specifically for complex data def main(): - parser = gr_plot_fft.setup_options() + parser = plot_fft_base.setup_options() parser.remove_option("--data-type") (options, args) = parser.parse_args () @@ -32,7 +34,7 @@ def main(): raise SystemExit, 1 filename = args[0] - dc = gr_plot_fft.gr_plot_fft("float32", filename, options) + dc = plot_fft_base("complex64", filename, options) if __name__ == "__main__": try: diff --git a/gr-utils/src/python/gr_plot_fft_c.py b/gr-utils/src/python/gr_plot_fft_f index de59b36c9..66c75a8ff 100755 --- a/gr-utils/src/python/gr_plot_fft_c.py +++ b/gr-utils/src/python/gr_plot_fft_f @@ -20,10 +20,12 @@ # Boston, MA 02110-1301, USA. # -import gr_plot_fft +from gnuradio.plot_fft_base import plot_fft_base + +# This is a wrapper program for plot_fft_base specifically for float data def main(): - parser = gr_plot_fft.setup_options() + parser = plot_fft_base.setup_options() parser.remove_option("--data-type") (options, args) = parser.parse_args () @@ -32,7 +34,7 @@ def main(): raise SystemExit, 1 filename = args[0] - dc = gr_plot_fft.gr_plot_fft("complex64", filename, options) + dc = plot_fft_base("float32", filename, options) if __name__ == "__main__": try: diff --git a/gr-utils/src/python/gr_plot_float.py b/gr-utils/src/python/gr_plot_float index e5c22a315..e5c22a315 100755 --- a/gr-utils/src/python/gr_plot_float.py +++ b/gr-utils/src/python/gr_plot_float diff --git a/gr-utils/src/python/gr_plot_int.py b/gr-utils/src/python/gr_plot_int index b44d4360a..b44d4360a 100755 --- a/gr-utils/src/python/gr_plot_int.py +++ b/gr-utils/src/python/gr_plot_int diff --git a/gr-utils/src/python/gr_plot_iq.py b/gr-utils/src/python/gr_plot_iq index 316e60a75..316e60a75 100755 --- a/gr-utils/src/python/gr_plot_iq.py +++ b/gr-utils/src/python/gr_plot_iq diff --git a/gr-utils/src/python/gr_plot_psd b/gr-utils/src/python/gr_plot_psd new file mode 100644 index 000000000..658e7b297 --- /dev/null +++ b/gr-utils/src/python/gr_plot_psd @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# +# Copyright 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.plot_psd_base import plot_psd_base + +# This is a wrapper program for plot_psd_base. It handles any data +# type and defaults to complex64. + +def main(): + parser = plot_psd_base.setup_options() + (options, args) = parser.parse_args () + if len(args) != 1: + parser.print_help() + raise SystemExit, 1 + filename = args[0] + + dc = plot_psd_base(options.data_type, filename, options) + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + pass diff --git a/gr-utils/src/python/gr_plot_psd_c.py b/gr-utils/src/python/gr_plot_psd_c index 1edc04c2b..192f263ec 100755 --- a/gr-utils/src/python/gr_plot_psd_c.py +++ b/gr-utils/src/python/gr_plot_psd_c @@ -21,12 +21,12 @@ # from optparse import OptionParser -import gr_plot_psd +from gnuradio.plot_psd_base import plot_psd_base -# This is a wrapper program for gr_plot_psd specifically for complex data +# This is a wrapper program for plot_psd_base specifically for complex data def main(): - parser = gr_plot_psd.setup_options() + parser = plot_psd_base.setup_options() parser.remove_option("--data-type") (options, args) = parser.parse_args () @@ -35,7 +35,7 @@ def main(): raise SystemExit, 1 filename = args[0] - dc = gr_plot_psd.gr_plot_psd("complex64", filename, options) + dc = plot_psd_base("complex64", filename, options) if __name__ == "__main__": try: diff --git a/gr-utils/src/python/gr_plot_psd_f.py b/gr-utils/src/python/gr_plot_psd_f index bad6788c3..fab312645 100755 --- a/gr-utils/src/python/gr_plot_psd_f.py +++ b/gr-utils/src/python/gr_plot_psd_f @@ -21,12 +21,12 @@ # from optparse import OptionParser -import gr_plot_psd +from gnuradio.plot_psd_base import plot_psd_base # This is a wrapper program for gr_plot_psd specifically for floating point data def main(): - parser = gr_plot_psd.setup_options() + parser = plot_psd_base.setup_options() parser.remove_option("--data-type") (options, args) = parser.parse_args () @@ -35,7 +35,7 @@ def main(): raise SystemExit, 1 filename = args[0] - dc = gr_plot_psd.gr_plot_psd("float32", filename, options) + dc = plot_psd_base("float32", filename, options) if __name__ == "__main__": try: diff --git a/gr-utils/src/python/gr_plot_qt.py b/gr-utils/src/python/gr_plot_qt index f3dc472f5..937d0014b 100755 --- a/gr-utils/src/python/gr_plot_qt.py +++ b/gr-utils/src/python/gr_plot_qt @@ -28,7 +28,7 @@ except ImportError: try: # FIXME: reenable this before committing #from gnuradio.pyqt_plot import Ui_MainWindow - from pyqt_plot import Ui_MainWindow + from gnuradio.pyqt_plot import Ui_MainWindow except ImportError: print "Could not import from pyqt_plot. Please build with \"pyuic4 pyqt_plot.ui -o pyqt_plot.py\"" raise SystemExit, 1 diff --git a/gr-utils/src/python/gr_plot_short.py b/gr-utils/src/python/gr_plot_short index 3466e0b7d..3466e0b7d 100755 --- a/gr-utils/src/python/gr_plot_short.py +++ b/gr-utils/src/python/gr_plot_short diff --git a/gr-utils/src/python/gr_plot_fft.py b/gr-utils/src/python/plot_fft_base.py index ba3901e03..0b5df504b 100755 --- a/gr-utils/src/python/gr_plot_fft.py +++ b/gr-utils/src/python/plot_fft_base.py @@ -35,7 +35,7 @@ except ImportError: from optparse import OptionParser -class gr_plot_fft: +class plot_fft_base: def __init__(self, datatype, filename, options): self.hfile = open(filename, "r") self.block_length = options.block @@ -96,7 +96,7 @@ class gr_plot_fft: def dofft(self, iq): N = len(iq) - iq_fft = fftpack.fftshift(scipy.fft(iq)) # fft and shift axis + iq_fft = scipy.fftpack.fftshift(scipy.fft(iq)) # fft and shift axis iq_fft = 20*scipy.log10(abs((iq_fft+1e-15)/N)) # convert to decibels, adjust power # adding 1e-15 (-300 dB) to protect against value errors if an item in iq_fft is 0 return iq_fft @@ -206,37 +206,38 @@ class gr_plot_fft: self.hfile.seek(-self.hfile.tell(),1) self.get_data() self.update_plots() - + + @staticmethod + def setup_options(): + usage="%prog: [options] input_filename" + description = "Takes a GNU Radio complex binary file and displays the I&Q data versus time as well as the frequency domain (FFT) plot. The y-axis values are plotted assuming volts as the amplitude of the I&Q streams and converted into dBm in the frequency domain (the 1/N power adjustment out of the FFT is performed internally). The script plots a certain block of data at a time, specified on the command line as -B or --block. This value defaults to 1000. The start position in the file can be set by specifying -s or --start and defaults to 0 (the start of the file). By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time and frequency axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples." + + parser = OptionParser(conflict_handler="resolve", usage=usage, description=description) + parser.add_option("-d", "--data-type", type="string", default="complex64", + help="Specify the data type (complex64, float32, (u)int32, (u)int16, (u)int8) [default=%default]") + parser.add_option("-B", "--block", type="int", default=1000, + help="Specify the block size [default=%default]") + parser.add_option("-s", "--start", type="int", default=0, + help="Specify where to start in the file [default=%default]") + parser.add_option("-R", "--sample-rate", type="float", default=1.0, + help="Set the sampler rate of the data [default=%default]") + return parser + def find(item_in, list_search): try: return list_search.index(item_in) != None except ValueError: return False -def setup_options(): - usage="%prog: [options] input_filename" - description = "Takes a GNU Radio complex binary file and displays the I&Q data versus time as well as the frequency domain (FFT) plot. The y-axis values are plotted assuming volts as the amplitude of the I&Q streams and converted into dBm in the frequency domain (the 1/N power adjustment out of the FFT is performed internally). The script plots a certain block of data at a time, specified on the command line as -B or --block. This value defaults to 1000. The start position in the file can be set by specifying -s or --start and defaults to 0 (the start of the file). By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time and frequency axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples." - - parser = OptionParser(conflict_handler="resolve", usage=usage, description=description) - parser.add_option("-d", "--data-type", type="string", default="complex64", - help="Specify the data type (complex64, float32, (u)int32, (u)int16, (u)int8) [default=%default]") - parser.add_option("-B", "--block", type="int", default=1000, - help="Specify the block size [default=%default]") - parser.add_option("-s", "--start", type="int", default=0, - help="Specify where to start in the file [default=%default]") - parser.add_option("-R", "--sample-rate", type="float", default=1.0, - help="Set the sampler rate of the data [default=%default]") - return parser - def main(): - parser = setup_options() + parser = plot_fft_base.setup_options() (options, args) = parser.parse_args () if len(args) != 1: parser.print_help() raise SystemExit, 1 filename = args[0] - dc = gr_plot_fft(options.data_type, filename, options) + dc = plot_fft_base(options.data_type, filename, options) if __name__ == "__main__": try: diff --git a/gr-utils/src/python/gr_plot_psd.py b/gr-utils/src/python/plot_psd_base.py index 3dab0535a..78eed5f71 100755 --- a/gr-utils/src/python/gr_plot_psd.py +++ b/gr-utils/src/python/plot_psd_base.py @@ -37,7 +37,7 @@ from optparse import OptionParser from scipy import log10 from gnuradio.eng_option import eng_option -class gr_plot_psd: +class plot_psd_base: def __init__(self, datatype, filename, options): self.hfile = open(filename, "r") self.block_length = options.block @@ -242,44 +242,45 @@ class gr_plot_psd: if(r): self.update_plots() + @staticmethod + def setup_options(): + usage="%prog: [options] input_filename" + description = "Takes a GNU Radio binary file (with specified data type using --data-type) and displays the I&Q data versus time as well as the power spectral density (PSD) plot. The y-axis values are plotted assuming volts as the amplitude of the I&Q streams and converted into dBm in the frequency domain (the 1/N power adjustment out of the FFT is performed internally). The script plots a certain block of data at a time, specified on the command line as -B or --block. The start position in the file can be set by specifying -s or --start and defaults to 0 (the start of the file). By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time and frequency axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples. Finally, the size of the FFT to use for the PSD and spectrogram plots can be set independently with --psd-size and --spec-size, respectively. The spectrogram plot does not display by default and is turned on with -S or --enable-spec." + + parser = OptionParser(option_class=eng_option, conflict_handler="resolve", + usage=usage, description=description) + parser.add_option("-d", "--data-type", type="string", default="complex64", + help="Specify the data type (complex64, float32, (u)int32, (u)int16, (u)int8) [default=%default]") + parser.add_option("-B", "--block", type="int", default=8192, + help="Specify the block size [default=%default]") + parser.add_option("-s", "--start", type="int", default=0, + help="Specify where to start in the file [default=%default]") + parser.add_option("-R", "--sample-rate", type="eng_float", default=1.0, + help="Set the sampler rate of the data [default=%default]") + parser.add_option("", "--psd-size", type="int", default=1024, + help="Set the size of the PSD FFT [default=%default]") + parser.add_option("", "--spec-size", type="int", default=256, + help="Set the size of the spectrogram FFT [default=%default]") + parser.add_option("-S", "--enable-spec", action="store_true", default=False, + help="Turn on plotting the spectrogram [default=%default]") + + return parser + def find(item_in, list_search): try: return list_search.index(item_in) != None except ValueError: return False -def setup_options(): - usage="%prog: [options] input_filename" - description = "Takes a GNU Radio binary file (with specified data type using --data-type) and displays the I&Q data versus time as well as the power spectral density (PSD) plot. The y-axis values are plotted assuming volts as the amplitude of the I&Q streams and converted into dBm in the frequency domain (the 1/N power adjustment out of the FFT is performed internally). The script plots a certain block of data at a time, specified on the command line as -B or --block. The start position in the file can be set by specifying -s or --start and defaults to 0 (the start of the file). By default, the system assumes a sample rate of 1, so in time, each sample is plotted versus the sample number. To set a true time and frequency axis, set the sample rate (-R or --sample-rate) to the sample rate used when capturing the samples. Finally, the size of the FFT to use for the PSD and spectrogram plots can be set independently with --psd-size and --spec-size, respectively. The spectrogram plot does not display by default and is turned on with -S or --enable-spec." - - parser = OptionParser(option_class=eng_option, conflict_handler="resolve", - usage=usage, description=description) - parser.add_option("-d", "--data-type", type="string", default="complex64", - help="Specify the data type (complex64, float32, (u)int32, (u)int16, (u)int8) [default=%default]") - parser.add_option("-B", "--block", type="int", default=8192, - help="Specify the block size [default=%default]") - parser.add_option("-s", "--start", type="int", default=0, - help="Specify where to start in the file [default=%default]") - parser.add_option("-R", "--sample-rate", type="eng_float", default=1.0, - help="Set the sampler rate of the data [default=%default]") - parser.add_option("", "--psd-size", type="int", default=1024, - help="Set the size of the PSD FFT [default=%default]") - parser.add_option("", "--spec-size", type="int", default=256, - help="Set the size of the spectrogram FFT [default=%default]") - parser.add_option("-S", "--enable-spec", action="store_true", default=False, - help="Turn on plotting the spectrogram [default=%default]") - - return parser - def main(): - parser = setup_options() + parser = plot_psd_base.setup_options() (options, args) = parser.parse_args () if len(args) != 1: parser.print_help() raise SystemExit, 1 filename = args[0] - dc = gr_plot_psd(options.data_type, filename, options) + dc = plot_psd_base(options.data_type, filename, options) if __name__ == "__main__": try: diff --git a/gr-vocoder/CMakeLists.txt b/gr-vocoder/CMakeLists.txt index e800cff00..19f0dbec9 100644 --- a/gr-vocoder/CMakeLists.txt +++ b/gr-vocoder/CMakeLists.txt @@ -35,6 +35,8 @@ GR_SET_GLOBAL(GR_VOCODER_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include ) +SET(GR_PKG_VOCODER_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/vocoder) + ######################################################################## # Begin conditional configuration ######################################################################## diff --git a/gr-vocoder/examples/CMakeLists.txt b/gr-vocoder/examples/CMakeLists.txt index 76a757826..769ddf602 100644 --- a/gr-vocoder/examples/CMakeLists.txt +++ b/gr-vocoder/examples/CMakeLists.txt @@ -32,6 +32,6 @@ GR_PYTHON_INSTALL( g723_40_audio_loopback.py gsm_audio_loopback.py ulaw_audio_loopback.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/vocoder + DESTINATION ${GR_PKG_VOCODER_EXAMPLES_DIR} COMPONENT "vocoder_examples" ) |