summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--README.hacking60
-rw-r--r--cmake/Modules/FindQwt.cmake3
-rw-r--r--cmake/Modules/GrBoost.cmake7
-rw-r--r--cmake/Modules/GrPlatform.cmake8
-rw-r--r--cmake/msvc/config.h4
-rwxr-xr-xdocs/doxygen/other/doxypy.py56
-rw-r--r--docs/sphinx/source/digital_blocks.rst1
-rw-r--r--docs/sphinx/source/index.rst1
-rwxr-xr-xdtools/bin/update_fsf_address26
-rwxr-xr-xgnuradio-runtime/examples/mp-sched/plot_flops.py4
-rwxr-xr-xgnuradio-runtime/examples/mp-sched/synthetic.py39
-rwxr-xr-xgnuradio-runtime/examples/mp-sched/wfm_rcv_pll_to_wav.py36
-rwxr-xr-xgnuradio-runtime/examples/network/audio_sink.py29
-rwxr-xr-xgnuradio-runtime/examples/network/audio_source.py31
-rwxr-xr-xgnuradio-runtime/examples/network/dial_tone_sink.py29
-rwxr-xr-xgnuradio-runtime/examples/network/dial_tone_source.py39
-rwxr-xr-xgnuradio-runtime/examples/network/vector_sink.py26
-rwxr-xr-xgnuradio-runtime/examples/network/vector_source.py23
-rw-r--r--gnuradio-runtime/lib/constants.cc.in19
-rw-r--r--gnuradio-runtime/lib/controlport/rpcmanager.cc5
-rw-r--r--gnuradio-runtime/lib/controlport/rpcserver_selector.cc4
-rw-r--r--gnuradio-runtime/lib/flat_flowgraph.cc9
-rw-r--r--gnuradio-runtime/lib/pmt/pmt.cc12
-rw-r--r--gnuradio-runtime/lib/top_block.cc19
-rw-r--r--gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx2
-rwxr-xr-xgnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py58
-rwxr-xr-xgr-analog/examples/tags/uhd_burst_detector.py40
-rw-r--r--gr-analog/grc/analog_block_tree.xml1
-rw-r--r--gr-analog/grc/analog_cpfsk_bc.xml1
-rw-r--r--gr-analog/include/gnuradio/analog/cpfsk_bc.h1
-rw-r--r--gr-analog/lib/fastnoise_source_X_impl.cc.t4
-rw-r--r--gr-audio/doc/audio.dox8
-rwxr-xr-xgr-audio/examples/python/audio_copy.py25
-rwxr-xr-xgr-audio/examples/python/audio_play.py30
-rwxr-xr-xgr-audio/examples/python/audio_to_file.py33
-rwxr-xr-xgr-audio/examples/python/dial_tone.py23
-rwxr-xr-xgr-audio/examples/python/dial_tone_daemon.py22
-rwxr-xr-xgr-audio/examples/python/dial_tone_wav.py30
-rwxr-xr-xgr-audio/examples/python/mono_tone.py28
-rwxr-xr-xgr-audio/examples/python/multi_tone.py30
-rwxr-xr-xgr-audio/examples/python/noise.py20
-rwxr-xr-xgr-audio/examples/python/spectrum_inversion.py26
-rwxr-xr-xgr-audio/examples/python/test_resampler.py28
-rw-r--r--gr-audio/lib/windows/windows_sink.cc22
-rw-r--r--gr-audio/lib/windows/windows_sink.h14
-rw-r--r--gr-audio/lib/windows/windows_source.cc455
-rw-r--r--gr-audio/lib/windows/windows_source.h37
-rw-r--r--gr-blocks/CMakeLists.txt1
-rwxr-xr-xgr-blocks/examples/ctrlport/usrp_sink_controller.py36
-rwxr-xr-xgr-blocks/examples/ctrlport/usrp_source_controller.py36
-rw-r--r--gr-blocks/grc/blks2_error_rate.xml70
-rw-r--r--gr-blocks/grc/blks2_selector.xml98
-rw-r--r--gr-blocks/grc/blks2_tcp_sink.xml90
-rw-r--r--gr-blocks/grc/blks2_tcp_source.xml90
-rw-r--r--gr-blocks/grc/blks2_valve.xml73
-rw-r--r--gr-blocks/lib/ConfigChecks.cmake7
-rw-r--r--gr-blocks/lib/nlog10_ff_impl.cc30
-rw-r--r--gr-blocks/lib/nlog10_ff_impl.h4
-rw-r--r--gr-blocks/lib/test_tag_variable_rate_ff_impl.cc12
-rwxr-xr-xgr-blocks/python/blocks/qa_nlog10.py6
-rw-r--r--gr-blocks/python/grc_gnuradio/README8
-rw-r--r--gr-blocks/python/grc_gnuradio/__init__.py1
-rw-r--r--gr-blocks/python/grc_gnuradio/blks2/error_rate.py140
-rw-r--r--gr-blocks/python/grc_gnuradio/blks2/selector.py142
-rw-r--r--gr-blocks/python/grc_gnuradio/blks2/tcp.py70
-rw-r--r--gr-digital/CMakeLists.txt9
-rw-r--r--gr-digital/examples/CMakeLists.txt7
-rw-r--r--gr-digital/examples/demod/ber_simulation.grc1238
-rw-r--r--gr-digital/examples/demod/dpsk_loopback.grc878
-rw-r--r--gr-digital/examples/demod/gfsk_loopback.grc598
-rw-r--r--gr-digital/examples/demod/gmsk_loopback.grc590
-rwxr-xr-xgr-digital/examples/example_costas.py52
-rwxr-xr-xgr-digital/examples/example_fll.py54
-rwxr-xr-xgr-digital/examples/example_timing.py60
-rwxr-xr-xgr-digital/examples/gen_whitener.py17
-rwxr-xr-xgr-digital/examples/ofdm/benchmark_rx.py124
-rwxr-xr-xgr-digital/examples/ofdm/benchmark_tx.py124
-rwxr-xr-xgr-digital/examples/ofdm/gr_plot_ofdm.py278
-rwxr-xr-xgr-digital/examples/ofdm/tunnel.py271
-rw-r--r--gr-digital/grc/blks2_packet_decoder.xml77
-rw-r--r--gr-digital/grc/blks2_packet_encoder.xml121
-rw-r--r--gr-digital/grc/digital_block_tree.xml7
-rw-r--r--gr-digital/grc/digital_dxpsk_demod.xml1
-rw-r--r--gr-digital/grc/digital_dxpsk_mod.xml1
-rw-r--r--gr-digital/grc/digital_mpsk_receiver_cc.xml86
-rw-r--r--gr-digital/grc/digital_ofdm_demod.xml143
-rw-r--r--gr-digital/grc/digital_ofdm_frame_acquisition.xml77
-rw-r--r--gr-digital/grc/digital_ofdm_frame_sink.xml79
-rw-r--r--gr-digital/grc/digital_ofdm_insert_preamble.xml63
-rw-r--r--gr-digital/grc/digital_ofdm_mod.xml156
-rw-r--r--gr-digital/grc/digital_ofdm_sampler.xml67
-rw-r--r--gr-digital/grc/digital_ofdm_sync_pn.xml61
-rw-r--r--gr-digital/grc/digital_psk_demod.xml1
-rw-r--r--gr-digital/grc/digital_psk_mod.xml1
-rw-r--r--gr-digital/grc/digital_qam_demod.xml1
-rw-r--r--gr-digital/grc/digital_qam_mod.xml1
-rw-r--r--gr-digital/include/gnuradio/digital/CMakeLists.txt6
-rw-r--r--gr-digital/include/gnuradio/digital/mpsk_receiver_cc.h147
-rw-r--r--gr-digital/include/gnuradio/digital/ofdm_frame_acquisition.h82
-rw-r--r--gr-digital/include/gnuradio/digital/ofdm_frame_sink.h71
-rw-r--r--gr-digital/include/gnuradio/digital/ofdm_insert_preamble.h79
-rw-r--r--gr-digital/include/gnuradio/digital/ofdm_mapper_bcv.h67
-rw-r--r--gr-digital/include/gnuradio/digital/ofdm_sampler.h57
-rw-r--r--gr-digital/lib/CMakeLists.txt6
-rw-r--r--gr-digital/lib/mpsk_receiver_cc_impl.cc330
-rw-r--r--gr-digital/lib/mpsk_receiver_cc_impl.h242
-rw-r--r--gr-digital/lib/msk_timing_recovery_cc_impl.cc8
-rw-r--r--gr-digital/lib/ofdm_frame_acquisition_impl.cc32
-rw-r--r--gr-digital/lib/ofdm_frame_sink_impl.cc84
-rw-r--r--gr-digital/lib/ofdm_insert_preamble_impl.cc18
-rw-r--r--gr-digital/lib/ofdm_mapper_bcv_impl.cc52
-rw-r--r--gr-digital/lib/ofdm_sampler_impl.cc24
-rwxr-xr-xgr-digital/python/digital/qa_mpsk_receiver.py146
-rwxr-xr-xgr-digital/python/digital/qa_ofdm_insert_preamble.py178
-rw-r--r--gr-digital/python/grc_gnuradio/blks2/packet.py257
-rw-r--r--gr-digital/swig/CMakeLists.txt83
-rw-r--r--gr-digital/swig/digital_swig.i287
-rw-r--r--gr-digital/swig/digital_swig.py.in (renamed from gr-digital/python/grc_gnuradio/CMakeLists.txt)17
-rw-r--r--gr-digital/swig/digital_swig0.i124
-rw-r--r--gr-digital/swig/digital_swig1.i120
-rw-r--r--gr-digital/swig/digital_swig2.i109
-rw-r--r--gr-dtv/CMakeLists.txt1
-rw-r--r--gr-dtv/examples/vv003-cr23.grc6
-rw-r--r--gr-dtv/examples/vv018-miso.grc6
-rw-r--r--gr-dtv/grc/dtv_dvbt2_framemapper_cc.xml4
-rw-r--r--gr-dtv/lib/atsc/atsc_sync_impl.cc42
-rw-r--r--gr-dtv/lib/atsc/atsc_sync_impl.h10
-rw-r--r--gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc12
-rw-r--r--gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.cc50
-rw-r--r--gr-dtv/swig/CMakeLists.txt2
-rw-r--r--gr-fec/lib/cc_decoder_impl.cc3
-rw-r--r--gr-filter/lib/pfb_arb_resampler_ccc_impl.cc1
-rw-r--r--gr-filter/lib/pfb_arb_resampler_ccf_impl.cc1
-rw-r--r--gr-filter/lib/pfb_arb_resampler_fff_impl.cc1
-rwxr-xr-xgr-qtgui/apps/qt_digital.py307
-rw-r--r--gr-qtgui/apps/qt_digital_window.py161
-rw-r--r--gr-qtgui/apps/qt_digital_window.ui342
-rw-r--r--gr-qtgui/examples/c++/CMakeLists.txt17
-rw-r--r--gr-qtgui/include/gnuradio/qtgui/freqcontrolpanel.h2
-rw-r--r--gr-qtgui/include/gnuradio/qtgui/utils.h3
-rw-r--r--gr-qtgui/lib/FrequencyDisplayPlot.cc1
-rw-r--r--gr-qtgui/lib/TimeDomainDisplayPlot.cc8
-rw-r--r--gr-qtgui/lib/VectorDisplayPlot.cc22
-rw-r--r--gr-qtgui/lib/const_sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/edit_box_msg_impl.cc6
-rw-r--r--gr-qtgui/lib/freq_sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/freq_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/freqcontrolpanel.cc19
-rw-r--r--gr-qtgui/lib/freqdisplayform.cc6
-rw-r--r--gr-qtgui/lib/histogram_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/qtgui_util.cc12
-rw-r--r--gr-qtgui/lib/sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/time_raster_sink_b_impl.cc6
-rw-r--r--gr-qtgui/lib/time_raster_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/time_sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/time_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/vector_sink_f_impl.cc6
-rw-r--r--gr-qtgui/lib/waterfall_sink_c_impl.cc6
-rw-r--r--gr-qtgui/lib/waterfall_sink_f_impl.cc6
-rw-r--r--gr-qtgui/python/qtgui/CMakeLists.txt2
-rw-r--r--gr-qtgui/python/qtgui/__init__.py1
-rwxr-xr-xgr-qtgui/python/qtgui/range.py.cmakein2
-rw-r--r--gr-qtgui/python/qtgui/util.py.cmakein (renamed from gr-blocks/python/grc_gnuradio/blks2/__init__.py)24
-rw-r--r--gr-trellis/examples/python/CMakeLists.txt1
-rwxr-xr-xgr-trellis/examples/python/test_cpm.py161
-rw-r--r--gr-trellis/swig/CMakeLists.txt63
-rw-r--r--gr-trellis/swig/trellis_swig.py.in (renamed from gr-blocks/python/grc_gnuradio/CMakeLists.txt)22
-rw-r--r--gr-trellis/swig/trellis_swig0.i117
-rw-r--r--gr-trellis/swig/trellis_swig1.i (renamed from gr-trellis/swig/trellis_swig.i)83
-rw-r--r--gr-uhd/CMakeLists.txt2
-rw-r--r--gr-uhd/apps/uhd_app.py24
-rw-r--r--gr-uhd/include/gnuradio/uhd/usrp_sink.h35
-rw-r--r--gr-uhd/include/gnuradio/uhd/usrp_source.h35
-rw-r--r--gr-uhd/lib/CMakeLists.txt2
-rw-r--r--gr-uhd/lib/usrp_block_impl.cc38
-rw-r--r--gr-uhd/lib/usrp_block_impl.h2
-rw-r--r--gr-uhd/lib/usrp_sink_impl.cc73
-rw-r--r--gr-uhd/lib/usrp_sink_impl.h12
-rw-r--r--gr-uhd/lib/usrp_source_impl.cc96
-rw-r--r--gr-uhd/lib/usrp_source_impl.h13
-rw-r--r--gr-uhd/swig/CMakeLists.txt2
-rw-r--r--gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPlatform.cmake8
-rw-r--r--gr-utils/python/utils/CMakeLists.txt1
-rwxr-xr-xgr-utils/python/utils/gr_plot_const4
-rw-r--r--gr-utils/python/utils/gr_read_file_metadata4
-rwxr-xr-xgr-utils/python/utils/grcc89
-rwxr-xr-xgr-zeromq/examples/python/client.py20
-rwxr-xr-xgr-zeromq/examples/python/gui.py22
-rwxr-xr-xgr-zeromq/examples/python/server.py18
-rwxr-xr-xgrc/compiler.py76
-rw-r--r--grc/core/Config.py4
-rw-r--r--grc/core/FlowGraph.py15
-rw-r--r--grc/core/Param.py2
-rw-r--r--grc/core/Platform.py23
-rw-r--r--grc/core/generator/flow_graph.tmpl3
-rw-r--r--grc/core/utils/epy_block_io.py2
-rw-r--r--grc/core/utils/shlex.py47
-rw-r--r--grc/gui/Application.py3
-rw-r--r--grc/gui/Constants.py10
-rw-r--r--grc/gui/Dialogs.py2
-rw-r--r--grc/gui/Executor.py35
-rw-r--r--grc/gui/ParamWidgets.py4
-rw-r--r--grc/gui/PropsDialog.py4
-rw-r--r--grc/gui/Utils.py10
-rw-r--r--grc/gui/VariableEditor.py10
-rw-r--r--grc/gui/canvas/block.py3
-rw-r--r--grc/scripts/CMakeLists.txt2
-rwxr-xr-xgrc/scripts/gnuradio-companion34
-rwxr-xr-xgrc/scripts/grcc64
-rw-r--r--grc/tests/resources/test_compiler.grc253
-rw-r--r--grc/tests/test_compiler.py38
213 files changed, 2508 insertions, 10450 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8880155b71..3c5ef6e5e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -148,6 +148,10 @@ if(MSVC)
add_definitions(/bigobj) #allow for larger object files
endif(MSVC)
+if(WIN32)
+ add_definitions(-D_USE_MATH_DEFINES)
+endif(WIN32)
+
# Record Compiler Info for record
STRING(TOUPPER ${CMAKE_BUILD_TYPE} GRCBTU)
set(COMPILER_INFO "")
diff --git a/README.hacking b/README.hacking
index 2d0a1c395f..0b5bf6d0c3 100644
--- a/README.hacking
+++ b/README.hacking
@@ -120,8 +120,8 @@ http://gnuradio.org/redmine/projects/gnuradio/wiki/Coding_guide_impl#Unit-testin
When writing programs that are executable from the command line,
please follow these guidelines for command line argument names (short
and long) and types of the arguments. We list them below using the
-Python optparse syntax. In general, the default value should be coded
-into the help string using the "... [default=%default]" syntax.
+Python argparse syntax. In general, the default value should be coded
+into the help string using the "... [default=%(default)r]" syntax.
** Mandatory options by gr::block
@@ -132,7 +132,7 @@ option parsing will automatically be set up for you.
Any program using an audio source shall include:
- add_option("-I", "--audio-input", type="string", default="",
+ add_argument("-I", "--audio-input", default="",
help="pcm input device name. E.g., hw:0,0 or /dev/dsp")
The default must be "". This allows an audio module-dependent default
@@ -141,7 +141,7 @@ to be specified in the user preferences file.
*** Audio sink
- add_option("-O", "--audio-output", type="string", default="",
+ add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
The default must be "". This allows an audio module-dependent default
@@ -162,69 +162,69 @@ following parameters, please use these options to specify them:
To specify a frequency (typically an RF center frequency) use:
- add_option("-f", "--freq", type="eng_float", default=<your-default-here>,
- help="set frequency to FREQ [default=%default]")
+ add_argument("-f", "--freq", type=eng_float, default=<your-default-here>,
+ help="set frequency to FREQ [default=%(default)r]")
To specify a decimation factor use:
- add_option("-d", "--decim", type="intx", default=<your-default-here>,
- help="set decimation rate to DECIM [default=%default]")
+ add_argument("-d", "--decim", type=intx, default=<your-default-here>,
+ help="set decimation rate to DECIM [default=%(default)r]")
To specify an interpolation factor use:
- add_option("-i", "--interp", type="intx", default=<your-default-here>,
- help="set interpolation rate to INTERP [default=%default]")
+ add_argument("-i", "--interp", type=intx, default=<your-default-here>,
+ help="set interpolation rate to INTERP [default=%(default)r]")
To specify a gain setting use:
- add_option("-g", "--gain", type="eng_float", default=<your-default-here>,
- help="set gain in dB [default=%default]")
+ add_argument("-g", "--gain", type=eng_float, default=<your-default-here>,
+ help="set gain in dB [default=%(default)r]")
If your application specifies both a tx and an rx gain, use:
- add_option("", "--rx-gain", type="eng_float", default=<your-default-here>,
- help="set receive gain in dB [default=%default]")
+ add_argument("--rx-gain", type=eng_float, default=<your-default-here>,
+ help="set receive gain in dB [default=%(default)r]")
- add_option("", "--tx-gain", type="eng_float", default=<your-default-here>,
- help="set transmit gain in dB [default=%default]")
+ add_argument("--tx-gain", type=eng_float, default=<your-default-here>,
+ help="set transmit gain in dB [default=%(default)r]")
To specify the number of channels of something use:
- add_option("-n", "--nchannels", type="intx", default=1,
- help="specify number of channels [default=%default]")
+ add_argument("-n", "--nchannels", type=intx, default=1,
+ help="specify number of channels [default=%(default)r]")
To specify an output filename use:
- add_option("-o", "--output-filename", type="string", default=<your-default-here>,
- help="specify output-filename [default=%default]")
+ add_argument("-o", "--output-filename", default=<your-default-here>,
+ help="specify output-filename [default=%(default)r]")
To specify a rate use:
- add_option("-r", "--bit-rate", type="eng_float", default=<your-default-here>,
- help="specify bit-rate [default=%default]")
+ add_argument("-r", "--bit-rate", type=eng_float, default=<your-default-here>,
+ help="specify bit-rate [default=%(default)r]")
or
- add_option("-r", "--sample-rate", type="eng_float", default=<your-default-here>,
- help="specify sample-rate [default=%default]")
+ add_argument("-r", "--sample-rate", type=eng_float, default=<your-default-here>,
+ help="specify sample-rate [default=%(default)r]")
If your application has a verbose option, use:
- add_option('-v', '--verbose', action="store_true", default=False,
- help="verbose output")
+ add_argument('-v', '--verbose', action="store_true",
+ help="verbose output")
If your application allows the user to specify the "fast USB" options, use:
- add_option("", "--fusb-block-size", type="intx", default=0,
- help="specify fast USB block size [default=%default]")
+ add_argument("--fusb-block-size", type=intx, default=0,
+ help="specify fast USB block size [default=%(default)r]")
- add_option("", "--fusb-nblocks", type="intx", default=0,
- help="specify number of fast USB blocks [default=%default]")
+ add_argument("--fusb-nblocks", type=intx, default=0,
+ help="specify number of fast USB blocks [default=%(default)r]")
diff --git a/cmake/Modules/FindQwt.cmake b/cmake/Modules/FindQwt.cmake
index 0f24788c6d..a16896aa43 100644
--- a/cmake/Modules/FindQwt.cmake
+++ b/cmake/Modules/FindQwt.cmake
@@ -22,6 +22,7 @@ find_path(QWT_INCLUDE_DIRS
/usr/include/qwt6
/usr/include/qwt-${QWT_QT_VERSION}
/usr/include/qwt
+ /usr/include/${QWT_QT_VERSION}/qwt
/usr/include/qwt5
/opt/local/include/qwt
/sw/include/qwt
@@ -29,7 +30,7 @@ find_path(QWT_INCLUDE_DIRS
)
find_library (QWT_LIBRARIES
- NAMES qwt6 qwt6-${QWT_QT_VERSION} qwt qwt-${QWT_QT_VERSION} qwt5 qwtd5
+ NAMES qwt6-${QWT_QT_VERSION} qwt-${QWT_QT_VERSION} qwt6 qwt qwt5 qwtd5
HINTS
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
diff --git a/cmake/Modules/GrBoost.cmake b/cmake/Modules/GrBoost.cmake
index 6e036a5bdc..1cf8e65a11 100644
--- a/cmake/Modules/GrBoost.cmake
+++ b/cmake/Modules/GrBoost.cmake
@@ -32,14 +32,9 @@ set(BOOST_REQUIRED_COMPONENTS
filesystem
system
regex
+ thread
)
-if (MINGW)
- set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} thread_win32)
-else(MINGW)
- set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} thread)
-endif(MINGW)
-
if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
diff --git a/cmake/Modules/GrPlatform.cmake b/cmake/Modules/GrPlatform.cmake
index fbbea5fee0..00a53d04d9 100644
--- a/cmake/Modules/GrPlatform.cmake
+++ b/cmake/Modules/GrPlatform.cmake
@@ -51,4 +51,12 @@ endif()
if(NOT DEFINED LIB_SUFFIX AND LIB64_CONVENTION AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
set(LIB_SUFFIX 64)
endif()
+
+########################################################################
+# Detect /lib versus /lib64
+########################################################################
+if (CMAKE_INSTALL_LIBDIR MATCHES lib64)
+ set(LIB_SUFFIX 64)
+endif()
+
set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix")
diff --git a/cmake/msvc/config.h b/cmake/msvc/config.h
index 99a2ea0f89..d3daed1587 100644
--- a/cmake/msvc/config.h
+++ b/cmake/msvc/config.h
@@ -21,7 +21,6 @@ typedef ptrdiff_t ssize_t;
////////////////////////////////////////////////////////////////////////
// rint functions
////////////////////////////////////////////////////////////////////////
-#define _USE_MATH_DEFINES
#include <math.h>
#if _MSC_VER < 1800
static inline long lrint(double x){return (long)(x > 0.0 ? x + 0.5 : x - 0.5);}
@@ -62,7 +61,4 @@ static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : ceilf(x
static inline long int random (void) { return rand(); }
static inline void srandom (unsigned int seed) { srand(seed); }
-#define srand48(seed) srand(seed)
-#define drand48() (double(rand()) / RAND_MAX)
-
#endif // _MSC_CONFIG_H_ ]
diff --git a/docs/doxygen/other/doxypy.py b/docs/doxygen/other/doxypy.py
index 15d3e0824d..a9af32ab53 100755
--- a/docs/doxygen/other/doxypy.py
+++ b/docs/doxygen/other/doxypy.py
@@ -15,7 +15,7 @@ add the following lines to your Doxyfile:
INPUT_FILTER = "python /path/to/doxypy.py"
"""
-__version__ = "0.4.1"
+__version__ = "0.4.2"
__date__ = "5th December 2008"
__website__ = "http://code.foosel.org/doxypy"
@@ -42,7 +42,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import re
-from optparse import OptionParser, OptionGroup
+from argparse import ArgumentParser
class FSM(object):
"""Implements a finite state machine.
@@ -85,7 +85,7 @@ class FSM(object):
self.current_state = to_state
self.current_input = input
self.current_transition = transition
- if options.debug:
+ if args.debug:
print >>sys.stderr, "# FSM: executing (%s -> %s) for line '%s'" % (from_state, to_state, input)
callback(match)
return
@@ -179,7 +179,7 @@ class Doxypy(object):
def __closeComment(self):
"""Appends any open comment block and triggering block to the output."""
- if options.autobrief:
+ if args.autobrief:
if len(self.comment) == 1 \
or (len(self.comment) > 2 and self.comment[1].strip() == ''):
self.comment[0] = self.__docstringSummaryToBrief(self.comment[0])
@@ -207,7 +207,7 @@ class Doxypy(object):
"""Flushes the current outputbuffer to the outstream."""
if self.output:
try:
- if options.debug:
+ if args.debug:
print >>sys.stderr, "# OUTPUT: ", self.output
print >>self.outstream, "\n".join(self.output)
self.outstream.flush()
@@ -227,7 +227,7 @@ class Doxypy(object):
Closes the current commentblock and starts a new comment search.
"""
- if options.debug:
+ if args.debug:
print >>sys.stderr, "# CALLBACK: resetCommentSearch"
self.__closeComment()
self.startCommentSearch(match)
@@ -238,7 +238,7 @@ class Doxypy(object):
Saves the triggering line, resets the current comment and saves
the current indentation.
"""
- if options.debug:
+ if args.debug:
print >>sys.stderr, "# CALLBACK: startCommentSearch"
self.defclass = [self.fsm.current_input]
self.comment = []
@@ -250,7 +250,7 @@ class Doxypy(object):
Closes the current commentblock, resets the triggering line and
appends the current line to the output.
"""
- if options.debug:
+ if args.debug:
print >>sys.stderr, "# CALLBACK: stopCommentSearch"
self.__closeComment()
@@ -262,7 +262,7 @@ class Doxypy(object):
Closes the open comment block, resets it and appends the current line.
"""
- if options.debug:
+ if args.debug:
print >>sys.stderr, "# CALLBACK: appendFileheadLine"
self.__closeComment()
self.comment = []
@@ -274,7 +274,7 @@ class Doxypy(object):
The comment delimiter is removed from multiline start and ends as
well as singleline comments.
"""
- if options.debug:
+ if args.debug:
print >>sys.stderr, "# CALLBACK: appendCommentLine"
(from_state, to_state, condition, callback) = self.fsm.current_transition
@@ -311,13 +311,13 @@ class Doxypy(object):
def appendNormalLine(self, match):
"""Appends a line to the output."""
- if options.debug:
+ if args.debug:
print >>sys.stderr, "# CALLBACK: appendNormalLine"
self.output.append(self.fsm.current_input)
def appendDefclassLine(self, match):
"""Appends a line to the triggering block."""
- if options.debug:
+ if args.debug:
print >>sys.stderr, "# CALLBACK: appendDefclassLine"
self.defclass.append(self.fsm.current_input)
@@ -378,37 +378,31 @@ class Doxypy(object):
self.fsm.makeTransition(line)
self.__flushBuffer()
-def optParse():
- """Parses commandline options."""
- parser = OptionParser(prog=__applicationName__, version="%prog " + __version__)
+def argParse():
+ """Parses commandline args."""
+ parser = ArgumentParser(prog=__applicationName__)
- parser.set_usage("%prog [options] filename")
- parser.add_option("--autobrief",
- action="store_true", dest="autobrief",
+ parser.add_argument("--version", action="version",
+ version="%(prog)s " + __version__
+ )
+ parser.add_argument("--autobrief", action="store_true",
help="use the docstring summary line as \\brief description"
)
- parser.add_option("--debug",
- action="store_true", dest="debug",
+ parser.add_argument("--debug", action="store_true",
help="enable debug output on stderr"
)
+ parser.add_argument("filename", metavar="FILENAME")
- ## parse options
- global options
- (options, filename) = parser.parse_args()
-
- if not filename:
- print >>sys.stderr, "No filename given."
- sys.exit(-1)
-
- return filename[0]
+ return parser.parse_args()
def main():
"""Starts the parser on the file given by the filename as the first
argument on the commandline.
"""
- filename = optParse()
+ global args
+ args = argParse()
fsm = Doxypy()
- fsm.parseFile(filename)
+ fsm.parseFile(args.filename)
if __name__ == "__main__":
main()
diff --git a/docs/sphinx/source/digital_blocks.rst b/docs/sphinx/source/digital_blocks.rst
index 1dfd017069..faee4c179c 100644
--- a/docs/sphinx/source/digital_blocks.rst
+++ b/docs/sphinx/source/digital_blocks.rst
@@ -43,7 +43,6 @@ gnuradio.digital
.. autoblock:: gnuradio.digital.kurtotic_equalizer_cc
.. autoblock:: gnuradio.digital.lms_dd_equalizer_cc
.. autoblock:: gnuradio.digital.map_bb
-.. autoblock:: gnuradio.digital.mpsk_receiver_cc
.. autoblock:: gnuradio.digital.mpsk_snr_est_cc
.. autoblock:: gnuradio.digital.msk_timing_recovery_cc
.. autoblock:: gnuradio.digital.ofdm_carrier_allocator_cvc
diff --git a/docs/sphinx/source/index.rst b/docs/sphinx/source/index.rst
index 137c17a6ba..26936dfedf 100644
--- a/docs/sphinx/source/index.rst
+++ b/docs/sphinx/source/index.rst
@@ -1038,7 +1038,6 @@ Synchronizer Blocks
gnuradio.digital.corr_est_cc
gnuradio.digital.costas_loop_cc
gnuradio.digital.fll_band_edge_cc
- gnuradio.digital.mpsk_receiver_cc
gnuradio.digital.msk_timing_recovery_cc
gnuradio.analog.pll_carriertracking_cc
gnuradio.analog.pll_freqdet_cf
diff --git a/dtools/bin/update_fsf_address b/dtools/bin/update_fsf_address
index 608ba0a8e2..0017fa11a9 100755
--- a/dtools/bin/update_fsf_address
+++ b/dtools/bin/update_fsf_address
@@ -23,7 +23,7 @@ import re
import os
import os.path
import sys
-from optparse import OptionParser
+from argparse import ArgumentParser
dry_run = False
modified_files = []
@@ -109,22 +109,22 @@ def handle_file_or_dir(file_or_dir):
def main():
global dry_run
- usage = '%prog: [options] [file_or_dir...]'
- parser = OptionParser (usage=usage)
- parser.add_option('-l', '--list-modified-files', action='store_true', default=False,
- help='List modified files to stdout [default=%default]')
- parser.add_option('', '--dry-run', action='store_true', default=False,
- help="Don't modify any files, just report what would be modified [default=%default]")
- (options, args) = parser.parse_args()
+ parser = ArgumentParser()
+ parser.add_argument('-l', '--list-modified-files', action='store_true',
+ help='List modified files to stdout')
+ parser.add_argument('--dry-run', action='store_true',
+ help="Don't modify any files, just report what would be modified")
+ parser.add_argument('file_or_dir', metavar='FILE-OR-DIR', nargs='*')
+ args = parser.parse_args()
- dry_run = options.dry_run
- if options.dry_run:
- options.list_modified_files = True
+ dry_run = args.dry_run
+ if args.dry_run:
+ args.list_modified_files = True
- for file_or_dir in args:
+ for file_or_dir in args.file_or_dir:
handle_file_or_dir(file_or_dir)
- if options.list_modified_files:
+ if args.list_modified_files:
for f in modified_files:
sys.stdout.write(f + '\n')
diff --git a/gnuradio-runtime/examples/mp-sched/plot_flops.py b/gnuradio-runtime/examples/mp-sched/plot_flops.py
index c80820b8a3..9bd2ff12bb 100755
--- a/gnuradio-runtime/examples/mp-sched/plot_flops.py
+++ b/gnuradio-runtime/examples/mp-sched/plot_flops.py
@@ -85,10 +85,10 @@ def handle_file(input_filename):
def main():
parser = ArgumentParser()
- parser.add_argument('file', help='Input file', nargs=1)
+ parser.add_argument('file', help='Input file')
args = parser.parse_args()
- handle_file(args.file[0])
+ handle_file(args.file)
if __name__ == '__main__':
diff --git a/gnuradio-runtime/examples/mp-sched/synthetic.py b/gnuradio-runtime/examples/mp-sched/synthetic.py
index d815879cff..16e39734ae 100755
--- a/gnuradio-runtime/examples/mp-sched/synthetic.py
+++ b/gnuradio-runtime/examples/mp-sched/synthetic.py
@@ -21,8 +21,8 @@
from gnuradio import gr, eng_notation
from gnuradio import blocks, filter
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
import os
@@ -50,38 +50,35 @@ class top(gr.top_block):
gr.top_block.__init__(self)
default_nsamples = 10e6
- parser=OptionParser(option_class=eng_option)
- parser.add_option("-p", "--npipelines", type="intx", default=1,
- metavar="NPIPES", help="the number of pipelines to create (default=%default)")
- parser.add_option("-s", "--nstages", type="intx", default=1,
- metavar="NSTAGES", help="the number of stages in each pipeline (default=%default)")
- parser.add_option("-N", "--nsamples", type="eng_float", default=default_nsamples,
+ parser = ArgumentParser()
+ parser.add_argument("-p", "--npipelines", type=intx, default=1,
+ metavar="NPIPES", help="the number of pipelines to create (default=%(default)s)")
+ parser.add_argument("-s", "--nstages", type=intx, default=1, metavar="NSTAGES",
+ help="the number of stages in each pipeline (default=%(default)s)")
+ parser.add_argument("-N", "--nsamples", type=eng_float, default=default_nsamples,
help=("the number of samples to run through the graph (default=%s)" %
(eng_notation.num_to_str(default_nsamples))))
- parser.add_option("-m", "--machine-readable", action="store_true", default=False,
+ parser.add_argument("-m", "--machine-readable", action="store_true", default=False,
help="enable machine readable output")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
+ args = parser.parse_args()
- self.npipes = options.npipelines
- self.nstages = options.nstages
- self.nsamples = options.nsamples
- self.machine_readable = options.machine_readable
+ self.npipes = args.npipelines
+ self.nstages = args.nstages
+ self.nsamples = args.nsamples
+ self.machine_readable = args.machine_readable
ntaps = 256
# Something vaguely like floating point ops
- self.flop = 2 * ntaps * options.npipelines * options.nstages * options.nsamples
+ self.flop = 2 * ntaps * args.npipelines * args.nstages * args.nsamples
src = blocks.null_source(gr.sizeof_float)
- head = blocks.head(gr.sizeof_float, int(options.nsamples))
+ head = blocks.head(gr.sizeof_float, int(args.nsamples))
self.connect(src, head)
- for n in range(options.npipelines):
- self.connect(head, pipeline(options.nstages, ntaps))
+ for n in range(args.npipelines):
+ self.connect(head, pipeline(args.nstages, ntaps))
def time_it(tb):
diff --git a/gnuradio-runtime/examples/mp-sched/wfm_rcv_pll_to_wav.py b/gnuradio-runtime/examples/mp-sched/wfm_rcv_pll_to_wav.py
index 1a43dc3a11..bb3296d428 100755
--- a/gnuradio-runtime/examples/mp-sched/wfm_rcv_pll_to_wav.py
+++ b/gnuradio-runtime/examples/mp-sched/wfm_rcv_pll_to_wav.py
@@ -24,8 +24,8 @@ from gnuradio import gr, gru, eng_notation, filter
from gnuradio import audio
from gnuradio import analog
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
import sys
import math
@@ -33,24 +33,20 @@ class wfm_rx_block (gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- usage = "usage: %prog [options] input-samples-320kS.dat output.wav"
- parser=OptionParser(option_class=eng_option, usage=usage)
- parser.add_option("-V", "--volume", type="eng_float", default=None,
- help="set volume (default is midpoint)")
+ parser = ArgumentParser(description="Decode WFM signal into WAV file.")
+ parser.add_argument("-V", "--volume", type=eng_float,
+ help="Volume (dB) <%r, %r> (default is midpoint)" % \
+ self.volume_range()[:2])
+ parser.add_argument("input_file", help="Input file (complex samples)")
+ parser.add_argument("output_file", help="Output WAV file")
- (options, args) = parser.parse_args()
- if len(args) != 2:
- parser.print_help()
- sys.exit(1)
-
- input_filename = args[0]
- output_filename = args[1]
+ args = parser.parse_args()
self.vol = 0
# build graph
- self.src = blocks.file_source(gr.sizeof_gr_complex, input_filename, False)
+ self.src = blocks.file_source(gr.sizeof_gr_complex, args.input_file, False)
adc_rate = 64e6 # 64 MS/s
usrp_decim = 200
@@ -80,10 +76,10 @@ class wfm_rx_block (gr.top_block):
# wave file as final sink
if 1:
- sink = blocks.wavfile_sink(output_filename, 2, int(audio_rate), 16)
+ sink = blocks.wavfile_sink(args.output_file, 2, int(audio_rate), 16)
else:
sink = audio.sink (int (audio_rate),
- options.audio_output,
+ args.audio_output,
False) # ok_to_block
# now wire it all together
@@ -96,15 +92,15 @@ class wfm_rx_block (gr.top_block):
pass
#print "FYI: This implementation of the stereo_carrier_pll_recovery has no squelch implementation yet"
- if options.volume is None:
+ if args.volume is None:
g = self.volume_range()
- options.volume = float(g[0]+g[1])/2
+ args.volume = float(g[0]+g[1])/2
# set initial values
- self.set_vol(options.volume)
+ self.set_vol(args.volume)
try:
- self.guts.stereo_carrier_pll_recovery.set_lock_threshold(options.squelch)
+ self.guts.stereo_carrier_pll_recovery.set_lock_threshold(args.squelch)
except:
pass
#print "FYI: This implementation of the stereo_carrier_pll_recovery has no squelch implementation yet"
diff --git a/gnuradio-runtime/examples/network/audio_sink.py b/gnuradio-runtime/examples/network/audio_sink.py
index de20abe48d..9b91db5d1e 100755
--- a/gnuradio-runtime/examples/network/audio_sink.py
+++ b/gnuradio-runtime/examples/network/audio_sink.py
@@ -22,8 +22,7 @@
from gnuradio import gr
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from argparse import ArgumentParser
import sys
try:
@@ -40,26 +39,22 @@ class audio_sink(gr.top_block):
self.connect(src, dst)
if __name__ == '__main__':
- parser = OptionParser(option_class=eng_option)
- parser.add_option("", "--host", type="string", default="0.0.0.0",
+ parser = ArgumentParser()
+ parser.add_argument("--host", default="0.0.0.0",
help="local host name (domain name or IP address)")
- parser.add_option("", "--port", type="int", default=65500,
+ parser.add_argument("--port", type=int, default=65500,
help="port value to listen to for connection")
- parser.add_option("", "--packet-size", type="int", default=1472,
+ parser.add_argument("--packet-size", type=int, default=1472,
help="packet size.")
- parser.add_option("-r", "--sample-rate", type="int", default=32000,
- help="audio signal sample rate [default=%default]")
- parser.add_option("", "--no-eof", action="store_true", default=False,
+ parser.add_argument("-r", "--sample-rate", type=int, default=32000,
+ help="audio signal sample rate [default=%(default)r]")
+ parser.add_argument("--no-eof", action="store_true", default=False,
help="don't send EOF on disconnect")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
+ args = parser.parse_args()
# Create an instance of a hierarchical block
- top_block = audio_sink(options.host, options.port,
- options.packet_size, options.sample_rate,
- not options.no_eof)
+ top_block = audio_sink(args.host, args.port,
+ args.packet_size, args.sample_rate,
+ not args.no_eof)
try:
# Run forever
diff --git a/gnuradio-runtime/examples/network/audio_source.py b/gnuradio-runtime/examples/network/audio_source.py
index 881efff81a..6a464a8f28 100755
--- a/gnuradio-runtime/examples/network/audio_source.py
+++ b/gnuradio-runtime/examples/network/audio_source.py
@@ -22,8 +22,7 @@
from gnuradio import gr
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from argparse import ArgumentParser
import sys
try:
@@ -36,30 +35,26 @@ class audio_source(gr.top_block):
def __init__(self, host, port, pkt_size, sample_rate, eof):
gr.top_block.__init__(self, "audio_source")
self.audio = audio.source(sample_rate)
- self.sink = blocks.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
+ self.sink = blocks.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
self.connect(self.audio, self.sink)
if __name__ == '__main__':
- parser = OptionParser(option_class=eng_option)
- parser.add_option("", "--host", type="string", default="127.0.0.1",
+ parser = ArgumentParser()
+ parser.add_argument("--host", default="127.0.0.1",
help="Remote host name (domain name or IP address")
- parser.add_option("", "--port", type="int", default=65500,
+ parser.add_argument("--port", type=int, default=65500,
help="port number to connect to")
- parser.add_option("", "--packet-size", type="int", default=1472,
+ parser.add_argument("--packet-size", type=int, default=1472,
help="packet size.")
- parser.add_option("-r", "--sample-rate", type="int", default=32000 ,
- help="audio signal sample rate [default=%default]")
- parser.add_option("", "--no-eof", action="store_true", default=False,
+ parser.add_argument("-r", "--sample-rate", type=int, default=32000 ,
+ help="audio signal sample rate [default=%(default)r]")
+ parser.add_argument("--no-eof", action="store_true", default=False,
help="don't send EOF on disconnect")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
+ args = parser.parse_args()
# Create an instance of a hierarchical block
- top_block = audio_source(options.host, options.port,
- options.packet_size, options.sample_rate,
- not options.no_eof)
+ top_block = audio_source(args.host, args.port,
+ args.packet_size, args.sample_rate,
+ not args.no_eof)
try:
# Run forever
diff --git a/gnuradio-runtime/examples/network/dial_tone_sink.py b/gnuradio-runtime/examples/network/dial_tone_sink.py
index 7139a13250..4b1db98649 100755
--- a/gnuradio-runtime/examples/network/dial_tone_sink.py
+++ b/gnuradio-runtime/examples/network/dial_tone_sink.py
@@ -22,8 +22,7 @@
from gnuradio import gr, audio
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from argparse import ArgumentParser
class dial_tone_sink(gr.top_block):
def __init__(self, host, port, pkt_size, sample_rate, eof):
@@ -33,26 +32,22 @@ class dial_tone_sink(gr.top_block):
self.connect(udp, sink)
if __name__ == '__main__':
- parser = OptionParser(option_class=eng_option)
- parser.add_option("", "--host", type="string", default="0.0.0.0",
+ parser = ArgumentParser()
+ parser.add_argument("--host", default="0.0.0.0",
help="local host name (domain name or IP address)")
- parser.add_option("", "--port", type="int", default=65500,
+ parser.add_argument("--port", type=int, default=65500,
help="port value to listen to for connection")
- parser.add_option("", "--packet-size", type="int", default=1472,
+ parser.add_argument("--packet-size", type=int, default=1472,
help="packet size.")
- parser.add_option("-r", "--sample-rate", type="int", default=8000,
- help="audio signal sample rate [default=%default]")
- parser.add_option("", "--no-eof", action="store_true", default=False,
+ parser.add_argument("-r", "--sample-rate", type=int, default=8000,
+ help="audio signal sample rate [default=%(default)r]")
+ parser.add_argument("--no-eof", action="store_true", default=False,
help="don't send EOF on disconnect")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
+ args = parser.parse_args()
# Create an instance of a hierarchical block
- top_block = dial_tone_sink(options.host, options.port,
- options.packet_size, options.sample_rate,
- not options.no_eof)
+ top_block = dial_tone_sink(args.host, args.port,
+ args.packet_size, args.sample_rate,
+ not args.no_eof)
try:
# Run forever
diff --git a/gnuradio-runtime/examples/network/dial_tone_source.py b/gnuradio-runtime/examples/network/dial_tone_source.py
index 20c9a3b800..ee2bc9529b 100755
--- a/gnuradio-runtime/examples/network/dial_tone_source.py
+++ b/gnuradio-runtime/examples/network/dial_tone_source.py
@@ -21,8 +21,7 @@
#
from gnuradio import gr
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from argparse import ArgumentParser
import sys
try:
@@ -45,33 +44,29 @@ class dial_tone_source(gr.top_block):
add = blocks.add_ff()
# Throttle needed here to account for the other side's audio card sampling rate
- thr = blocks.throttle(gr.sizeof_float, sample_rate)
- sink = blocks.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
- self.connect(src0, (add, 0))
- self.connect(src1, (add, 1))
- self.connect(add, thr, sink)
+ thr = blocks.throttle(gr.sizeof_float, sample_rate)
+ sink = blocks.udp_sink(gr.sizeof_float, host, port, pkt_size, eof=eof)
+ self.connect(src0, (add, 0))
+ self.connect(src1, (add, 1))
+ self.connect(add, thr, sink)
if __name__ == '__main__':
- parser = OptionParser(option_class=eng_option)
- parser.add_option("", "--host", type="string", default="127.0.0.1",
+ parser = ArgumentParser()
+ parser.add_argument("--host", default="127.0.0.1",
help="Remote host name (domain name or IP address")
- parser.add_option("", "--port", type="int", default=65500,
+ parser.add_argument("--port", type=int, default=65500,
help="port number to connect to")
- parser.add_option("", "--packet-size", type="int", default=1472,
+ parser.add_argument("--packet-size", type=int, default=1472,
help="packet size.")
- parser.add_option("-r", "--sample-rate", type="int", default=8000,
- help="audio signal sample rate [default=%default]")
- parser.add_option("", "--no-eof", action="store_true", default=False,
+ parser.add_argument("-r", "--sample-rate", type=int, default=8000,
+ help="audio signal sample rate [default=%(default)r]")
+ parser.add_argument("--no-eof", action="store_true", default=False,
help="don't send EOF on disconnect")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
+ args = parser.parse_args()
# Create an instance of a hierarchical block
- top_block = dial_tone_source(options.host, options.port,
- options.packet_size, options.sample_rate,
- not options.no_eof)
+ top_block = dial_tone_source(args.host, args.port,
+ args.packet_size, args.sample_rate,
+ not args.no_eof)
try:
# Run forever
diff --git a/gnuradio-runtime/examples/network/vector_sink.py b/gnuradio-runtime/examples/network/vector_sink.py
index c756f36f42..362f631380 100755
--- a/gnuradio-runtime/examples/network/vector_sink.py
+++ b/gnuradio-runtime/examples/network/vector_sink.py
@@ -22,8 +22,8 @@
from gnuradio import gr
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
class vector_sink(gr.top_block):
def __init__(self, host, port, pkt_size, eof):
@@ -34,24 +34,20 @@ class vector_sink(gr.top_block):
self.connect(udp, sink)
if __name__ == "__main__":
- parser = OptionParser(option_class=eng_option)
- parser.add_option("", "--host", type="string", default="0.0.0.0",
+ parser = ArgumentParser()
+ parser.add_argument("-H", "--host", default="0.0.0.0",
help="local host name (domain name or IP address)")
- parser.add_option("", "--port", type="int", default=65500,
+ parser.add_argument("-p", "--port", type=int, default=65500,
help="port value to listen to for connection")
- parser.add_option("", "--packet-size", type="int", default=1471,
+ parser.add_argument("-s", "--packet-size", type=int, default=1471,
help="packet size.")
- parser.add_option("", "--no-eof", action="store_true", default=False,
+ parser.add_argument("--no-eof", action="store_true", default=False,
help="don't send EOF on disconnect")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
+ args = parser.parse_args()
# Create an instance of a hierarchical block
- top_block = vector_sink(options.host, options.port,
- options.packet_size,
- not options.no_eof)
+ top_block = vector_sink(args.host, args.port,
+ args.packet_size,
+ not args.no_eof)
try:
# Run forever
diff --git a/gnuradio-runtime/examples/network/vector_source.py b/gnuradio-runtime/examples/network/vector_source.py
index c13b4b1d6f..be40134bc0 100755
--- a/gnuradio-runtime/examples/network/vector_source.py
+++ b/gnuradio-runtime/examples/network/vector_source.py
@@ -22,8 +22,7 @@
from gnuradio import gr
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from argparse import ArgumentParser
class vector_source(gr.top_block):
def __init__(self, host, port, pkt_size, eof):
@@ -34,23 +33,19 @@ class vector_source(gr.top_block):
self.connect(vec, udp)
if __name__ == '__main__':
- parser = OptionParser(option_class=eng_option)
- parser.add_option("", "--host", type="string", default="127.0.0.1",
+ parser = ArgumentParser()
+ parser.add_argument("--host", default="127.0.0.1",
help="Remote host name (domain name or IP address")
- parser.add_option("", "--port", type="int", default=65500,
+ parser.add_argument("--port", type=int, default=65500,
help="port number to connect to")
- parser.add_option("", "--packet-size", type="int", default=1471,
+ parser.add_argument("--packet-size", type=int, default=1471,
help="packet size.")
- parser.add_option("", "--no-eof", action="store_true", default=False,
+ parser.add_argument("--no-eof", action="store_true", default=False,
help="don't send EOF on disconnect")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
+ args = parser.parse_args()
# Create an instance of a hierarchical block
- top_block = vector_source(options.host, options.port, options.packet_size,
- not options.no_eof)
+ top_block = vector_source(args.host, args.port, args.packet_size,
+ not args.no_eof)
try:
# Run forever
diff --git a/gnuradio-runtime/lib/constants.cc.in b/gnuradio-runtime/lib/constants.cc.in
index 516e2f8798..b368e9dc3f 100644
--- a/gnuradio-runtime/lib/constants.cc.in
+++ b/gnuradio-runtime/lib/constants.cc.in
@@ -24,6 +24,7 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <gnuradio/constants.h>
namespace gr {
@@ -31,18 +32,36 @@ namespace gr {
const std::string
prefix()
{
+ //Use "GR_PREFIX" environment variable when specified
+ const char *prefix = getenv("GR_PREFIX");
+ if (prefix != NULL) return prefix;
+
return "@prefix@";
}
const std::string
sysconfdir()
{
+ //Provide the sysconfdir in terms of prefix()
+ //when the "GR_PREFIX" environment var is specified.
+ if (getenv("GR_PREFIX") != NULL)
+ {
+ return prefix() + "/@GR_CONF_DIR@";
+ }
+
return "@SYSCONFDIR@";
}
const std::string
prefsdir()
{
+ //Provide the prefsdir in terms of sysconfdir()
+ //when the "GR_PREFIX" environment var is specified.
+ if (getenv("GR_PREFIX") != NULL)
+ {
+ return sysconfdir() + "/@CMAKE_PROJECT_NAME@/conf.d";
+ }
+
return "@GR_PREFSDIR@";
}
diff --git a/gnuradio-runtime/lib/controlport/rpcmanager.cc b/gnuradio-runtime/lib/controlport/rpcmanager.cc
index a67febe386..fee255498e 100644
--- a/gnuradio-runtime/lib/controlport/rpcmanager.cc
+++ b/gnuradio-runtime/lib/controlport/rpcmanager.cc
@@ -24,11 +24,6 @@
#include <iostream>
#include <stdexcept>
-bool rpcmanager::booter_registered(false);
-bool rpcmanager::aggregator_registered(false);
-std::auto_ptr<rpcserver_booter_base> rpcmanager::boot(0);
-std::auto_ptr<rpcserver_booter_aggregator> rpcmanager::aggregator(0);
-
rpcmanager::rpcmanager() {;}
rpcmanager::~rpcmanager() {;}
diff --git a/gnuradio-runtime/lib/controlport/rpcserver_selector.cc b/gnuradio-runtime/lib/controlport/rpcserver_selector.cc
index 8f3b4557c2..fcba1ab524 100644
--- a/gnuradio-runtime/lib/controlport/rpcserver_selector.cc
+++ b/gnuradio-runtime/lib/controlport/rpcserver_selector.cc
@@ -25,6 +25,10 @@
#include <gnuradio/rpcserver_selector.h>
bool rpcmanager::make_aggregator(false);
+bool rpcmanager::booter_registered(false);
+bool rpcmanager::aggregator_registered(false);
+std::auto_ptr<rpcserver_booter_base> rpcmanager::boot(0);
+std::auto_ptr<rpcserver_booter_aggregator> rpcmanager::aggregator(0);
#ifdef GR_RPCSERVER_ENABLED
rpcmanager manager_instance;
diff --git a/gnuradio-runtime/lib/flat_flowgraph.cc b/gnuradio-runtime/lib/flat_flowgraph.cc
index 434a92fb3d..b7e949127a 100644
--- a/gnuradio-runtime/lib/flat_flowgraph.cc
+++ b/gnuradio-runtime/lib/flat_flowgraph.cc
@@ -316,6 +316,15 @@ namespace gr {
setup_buffer_alignment(block);
}
+ // Connect message ports connetions
+ for(msg_edge_viter_t i = d_msg_edges.begin(); i != d_msg_edges.end(); i++) {
+ if(FLAT_FLOWGRAPH_DEBUG)
+ std::cout << boost::format("flat_fg connecting msg primitives: (%s, %s)->(%s, %s)\n") %
+ i->src().block() % i->src().port() %
+ i->dst().block() % i->dst().port();
+ i->src().block()->message_port_sub(i->src().port(), pmt::cons(i->dst().block()->alias_pmt(), i->dst().port()));
+ }
+
// Now deal with the fact that the block details might have
// changed numbers of inputs and outputs vs. in the old
// flowgraph.
diff --git a/gnuradio-runtime/lib/pmt/pmt.cc b/gnuradio-runtime/lib/pmt/pmt.cc
index 51fb86e58c..e09452e60e 100644
--- a/gnuradio-runtime/lib/pmt/pmt.cc
+++ b/gnuradio-runtime/lib/pmt/pmt.cc
@@ -281,7 +281,17 @@ string_to_symbol(const std::string &name)
if (name == _symbol(sym)->name())
return sym; // Yes. Return it
}
-
+
+ // Lock the table on insert for thread safety:
+ static boost::mutex thread_safety;
+ boost::mutex::scoped_lock lock(thread_safety);
+ // Re-do the search in case another thread inserted this symbol into the table
+ // before we got the lock
+ for (pmt_t sym = (*get_symbol_hash_table())[hash]; sym; sym = _symbol(sym)->next()){
+ if (name == _symbol(sym)->name())
+ return sym; // Yes. Return it
+ }
+
// Nope. Make a new one.
pmt_t sym = pmt_t(new pmt_symbol(name));
_symbol(sym)->set_next((*get_symbol_hash_table())[hash]);
diff --git a/gnuradio-runtime/lib/top_block.cc b/gnuradio-runtime/lib/top_block.cc
index 8918a8f12d..7d135083dd 100644
--- a/gnuradio-runtime/lib/top_block.cc
+++ b/gnuradio-runtime/lib/top_block.cc
@@ -59,6 +59,17 @@ namespace gr {
void
top_block::start(int max_noutput_items)
{
+#ifdef GNURADIO_HRT_USE_CLOCK_GETTIME
+ std::string initial_clock = prefs::singleton()->get_string("PerfCounters", "clock", "thread");
+ if(initial_clock.compare("thread") == 0){
+ gr::high_res_timer_source = CLOCK_THREAD_CPUTIME_ID;
+ } else if(initial_clock.compare("monotonic") == 0){
+ gr::high_res_timer_source = CLOCK_MONOTONIC;
+ } else {
+ throw std::runtime_error("bad argument for PerfCounters.clock!");
+ }
+#endif
+
d_impl->start(max_noutput_items);
if(prefs::singleton()->get_bool("ControlPort", "on", false)) {
@@ -186,14 +197,6 @@ namespace gr {
}
#ifdef GNURADIO_HRT_USE_CLOCK_GETTIME
- std::string initial_clock = prefs::singleton()->get_string("PerfCounters", "clock", "thread");
- if(initial_clock.compare("thread") == 0){
- gr::high_res_timer_source = CLOCK_THREAD_CPUTIME_ID;
- } else if(initial_clock.compare("monotonic") == 0){
- gr::high_res_timer_source = CLOCK_MONOTONIC;
- } else {
- throw std::runtime_error("bad argument for PerfCounters.clock!");
- }
add_rpc_variable(
rpcbasic_sptr(new rpcbasic_register_variable_rw<int>(
alias(), "perfcounter_clock",
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx b/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
index cf67584235..15a2153a0f 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
@@ -46,7 +46,7 @@ except ImportError:
"Please check that they are installed and try again."
sys.exit(1)
-from PyQt4 import QtCore,Qt,Qwt5
+from PyQt4 import QtCore,Qt
import PyQt4.QtGui as QtGui
import itertools
diff --git a/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py b/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py
new file mode 100755
index 0000000000..fa4fd4910e
--- /dev/null
+++ b/gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 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.
+#
+
+import time
+import pmt
+from gnuradio import gr, gr_unittest, blocks
+
+class test_flowgraph (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test_000(self):
+
+ self.tb.start()
+ self.tb.lock()
+
+ rem = blocks.pdu_remove(pmt.intern('foo'))
+ dbg = blocks.message_debug()
+ self.tb.msg_connect((rem, 'pdus'), (dbg, 'store'))
+
+ self.tb.unlock()
+
+ msg = pmt.cons(pmt.PMT_NIL, pmt.init_u8vector(3, (1, 2, 3)))
+ rem.to_basic_block()._post(pmt.intern('pdus'), msg)
+ time.sleep(0.2)
+
+ self.tb.stop()
+
+ self.assertEqual(dbg.num_messages(), 1)
+ data = pmt.u8vector_elements(pmt.cdr(dbg.get_message(0)))
+ self.assertEqual((1, 2, 3), data)
+
+if __name__ == '__main__':
+ gr_unittest.run(test_flowgraph, 'test_flowgraph.xml')
+
diff --git a/gr-analog/examples/tags/uhd_burst_detector.py b/gr-analog/examples/tags/uhd_burst_detector.py
index b1bb15b974..5aa80b2549 100755
--- a/gr-analog/examples/tags/uhd_burst_detector.py
+++ b/gr-analog/examples/tags/uhd_burst_detector.py
@@ -25,9 +25,9 @@ from gnuradio import gr
from gnuradio import filter, analog, blocks
from gnuradio import uhd
from gnuradio.fft import window
-from gnuradio.eng_option import eng_option
+from gnuradio.eng_arg import eng_float
from gnuradio.filter import firdes
-from optparse import OptionParser
+from argparse import ArgumentParser
class uhd_burst_detector(gr.top_block):
def __init__(self, uhd_address, options):
@@ -94,24 +94,24 @@ class uhd_burst_detector(gr.top_block):
self.uhd_src_0.set_samp_rate(self.samp_rate)
if __name__ == '__main__':
- parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
- parser.add_option("-a", "--address", type="string", default="addr=192.168.10.2",
- help="select address of the device [default=%default]")
- #parser.add_option("-A", "--antenna", default=None,
+ parser = ArgumentParser()
+ parser.add_argument("-a", "--address", default="addr=192.168.10.2",
+ help="select address of the device [default=%(default)r]")
+ #parser.add_argument("-A", "--antenna", default=None,
# help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-f", "--freq", type="eng_float", default=450e6,
+ parser.add_argument("-f", "--freq", type=eng_float, default=450e6,
help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=0,
- help="set gain in dB [default=%default]")
- parser.add_option("-R", "--samp-rate", type="eng_float", default=200000,
- help="set USRP sample rate [default=%default]")
- parser.add_option("-t", "--threshold", type="float", default=-60,
- help="Set the detection power threshold (dBm) [default=%default")
- parser.add_option("-T", "--trigger", action="store_true", default=False,
- help="Use internal trigger instead of detector [default=%default]")
- (options, args) = parser.parse_args()
-
- uhd_addr = options.address
-
- tb = uhd_burst_detector(uhd_addr, options)
+ parser.add_argument("-g", "--gain", type=eng_float, default=0,
+ help="set gain in dB [default=%(default)r]")
+ parser.add_argument("-R", "--samp-rate", type=eng_float, default=200000,
+ help="set USRP sample rate [default=%(default)r]")
+ parser.add_argument("-t", "--threshold", type=float, default=-60,
+ help="Set the detection power threshold (dBm) [default=%(default)r")
+ parser.add_argument("-T", "--trigger", action="store_true", default=False,
+ help="Use internal trigger instead of detector [default=%(default)r]")
+ args = parser.parse_args()
+
+ uhd_addr = args.address
+
+ tb = uhd_burst_detector(uhd_addr, args)
tb.run()
diff --git a/gr-analog/grc/analog_block_tree.xml b/gr-analog/grc/analog_block_tree.xml
index 64ccbdd855..7337c34c3e 100644
--- a/gr-analog/grc/analog_block_tree.xml
+++ b/gr-analog/grc/analog_block_tree.xml
@@ -42,7 +42,6 @@
</cat>
<cat>
<name>Modulators</name>
- <block>analog_cpfsk_bc</block>
<block>analog_frequency_modulator_fc</block>
<block>analog_phase_modulator_fc</block>
<block>analog_quadrature_demod_cf</block>
diff --git a/gr-analog/grc/analog_cpfsk_bc.xml b/gr-analog/grc/analog_cpfsk_bc.xml
index 7eb85a2ecf..5108ff61f9 100644
--- a/gr-analog/grc/analog_cpfsk_bc.xml
+++ b/gr-analog/grc/analog_cpfsk_bc.xml
@@ -7,6 +7,7 @@
<block>
<name>CPFSK</name>
<key>analog_cpfsk_bc</key>
+ <category>[Core]/Deprecated</category>
<import>from gnuradio import analog</import>
<make>analog.cpfsk_bc($k, $amplitude, $samples_per_symbol)</make>
<callback>set_amplitude($amplitude)</callback>
diff --git a/gr-analog/include/gnuradio/analog/cpfsk_bc.h b/gr-analog/include/gnuradio/analog/cpfsk_bc.h
index 0d889d3e20..fe28c4536a 100644
--- a/gr-analog/include/gnuradio/analog/cpfsk_bc.h
+++ b/gr-analog/include/gnuradio/analog/cpfsk_bc.h
@@ -31,6 +31,7 @@ namespace gr {
* \brief Perform continuous phase 2-level frequency shift keying modulation
* on an input stream of unpacked bits.
* \ingroup modulators_blk
+ * \ingroup deprecated_blk
*/
class ANALOG_API cpfsk_bc : virtual public sync_interpolator
{
diff --git a/gr-analog/lib/fastnoise_source_X_impl.cc.t b/gr-analog/lib/fastnoise_source_X_impl.cc.t
index 21f963b65a..940918b11b 100644
--- a/gr-analog/lib/fastnoise_source_X_impl.cc.t
+++ b/gr-analog/lib/fastnoise_source_X_impl.cc.t
@@ -144,7 +144,7 @@ namespace gr {
@TYPE@ @IMPL_NAME@::sample()
{
-#ifdef __USE_GNU
+#ifdef HAVE_RAND48
size_t idx = lrand48() % d_samples.size();
#else
size_t idx = rand() % d_samples.size();
@@ -153,7 +153,7 @@ namespace gr {
}
#ifndef FASTNOISE_RANDOM_SIGN
-#ifdef _MSC_VER
+#ifndef HAVE_RAND48
#define FASTNOISE_RANDOM_SIGN ((rand()%2==0)?1:-1)
#else
#define FASTNOISE_RANDOM_SIGN ((lrand48()%2==0)?1:-1)
diff --git a/gr-audio/doc/audio.dox b/gr-audio/doc/audio.dox
index d706bbb6ae..648f126104 100644
--- a/gr-audio/doc/audio.dox
+++ b/gr-audio/doc/audio.dox
@@ -41,21 +41,21 @@ after importing by using:
\section audio_usage Usage
-For an audio source, a typical OptionParser option and it's use looks
+For an audio source, a typical ArgumentParser option and it's use looks
like:
\code
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
audio_rate = 32e3
audio_sink = audio.sink (int (audio_rate), options.audio_output)
\endcode
-Similarly, an audio sink would have a typical OptionParser option and
+Similarly, an audio sink would have a typical ArgumentParser option and
its use would look like:
\code
- parser.add_option("-I", "--audio-input", type="string", default="",
+ parser.add_argument("-I", "--audio-input", default="",
help="pcm input device name. E.g., hw:0,0 or /dev/dsp")
audio_rate = 32e3
audio_source = audio.source(int(audio_rate), audio_input)
diff --git a/gr-audio/examples/python/audio_copy.py b/gr-audio/examples/python/audio_copy.py
index 946aae1c2a..b68e949497 100755
--- a/gr-audio/examples/python/audio_copy.py
+++ b/gr-audio/examples/python/audio_copy.py
@@ -22,29 +22,26 @@
from gnuradio import gr
from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float
+from argparse import ArgumentParser
class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-I", "--audio-input", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-I", "--audio-input", default="",
help="pcm input device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=48000,
- help="set sample rate to RATE (48000)")
- (options, args) = parser.parse_args ()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=48000,
+ help="set sample rate, default=%(default)s")
+ args = parser.parse_args ()
- sample_rate = int(options.sample_rate)
- src = audio.source (sample_rate, options.audio_input)
- dst = audio.sink (sample_rate, options.audio_output)
+ sample_rate = int(args.sample_rate)
+ src = audio.source (sample_rate, args.audio_input)
+ dst = audio.sink (sample_rate, args.audio_output)
# Determine the maximum number of outputs on the source and
# maximum number of inputs on the sink, then connect together
diff --git a/gr-audio/examples/python/audio_play.py b/gr-audio/examples/python/audio_play.py
index 94ea72498d..367d7bd201 100755
--- a/gr-audio/examples/python/audio_play.py
+++ b/gr-audio/examples/python/audio_play.py
@@ -23,8 +23,8 @@
from gnuradio import gr
from gnuradio import audio
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float
+from argparse import ArgumentParser
class my_top_block(gr.top_block):
@@ -32,22 +32,18 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-F", "--filename", type="string", default="audio.dat",
- help="read input from FILE")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=48000,
- help="set sample rate to RATE (48000)")
- parser.add_option("-R", "--repeat", action="store_true", default=False)
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-F", "--filename", default="audio.dat",
+ help="read input from FILENAME default=%(default)r")
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=48000,
+ help="set sample rate (default=%(default)r)")
+ parser.add_argument("-R", "--repeat", action="store_true")
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
- sample_rate = int(options.sample_rate)
- src = blocks.file_source (gr.sizeof_float, options.filename, options.repeat)
- dst = audio.sink (sample_rate, options.audio_output)
+ args = parser.parse_args()
+ sample_rate = int(args.sample_rate)
+ src = blocks.file_source(gr.sizeof_float, args.filename, args.repeat)
+ dst = audio.sink(sample_rate, args.audio_output)
self.connect(src, dst)
diff --git a/gr-audio/examples/python/audio_to_file.py b/gr-audio/examples/python/audio_to_file.py
index 6a2cbcb12e..b385abf925 100755
--- a/gr-audio/examples/python/audio_to_file.py
+++ b/gr-audio/examples/python/audio_to_file.py
@@ -23,37 +23,34 @@
from gnuradio import gr
from gnuradio import audio
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float
+from argparse import ArgumentParser
class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- usage="%prog: [options] output_filename"
- parser = OptionParser(option_class=eng_option, usage=usage)
- parser.add_option("-I", "--audio-input", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-I", "--audio-input", default="",
help="pcm input device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=48000,
- help="set sample rate to RATE (48000)")
- parser.add_option("-N", "--nsamples", type="eng_float", default=None,
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=48000,
+ help="set sample rate to RATE (%(default)r)")
+ parser.add_argument("-N", "--nsamples", type=eng_float,
help="number of samples to collect [default=+inf]")
+ parser.add_argument('file_name', metavar='FILE-NAME',
+ help="Output file path")
- (options, args) = parser.parse_args ()
- if len(args) != 1:
- parser.print_help()
- raise SystemExit, 1
- filename = args[0]
+ args = parser.parse_args()
- sample_rate = int(options.sample_rate)
- src = audio.source (sample_rate, options.audio_input)
- dst = blocks.file_sink (gr.sizeof_float, filename)
+ sample_rate = int(args.sample_rate)
+ src = audio.source(sample_rate, args.audio_input)
+ dst = blocks.file_sink(gr.sizeof_float, args.file_name)
- if options.nsamples is None:
+ if args.nsamples is None:
self.connect((src, 0), dst)
else:
- head = blocks.head(gr.sizeof_float, int(options.nsamples))
+ head = blocks.head(gr.sizeof_float, int(args.nsamples))
self.connect((src, 0), head, dst)
diff --git a/gr-audio/examples/python/dial_tone.py b/gr-audio/examples/python/dial_tone.py
index c55d0d38dd..ebef8c01cb 100755
--- a/gr-audio/examples/python/dial_tone.py
+++ b/gr-audio/examples/python/dial_tone.py
@@ -22,8 +22,8 @@
from gnuradio import gr
from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float
+from argparse import ArgumentParser
try:
from gnuradio import analog
@@ -36,22 +36,19 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=48000,
- help="set sample rate to RATE (48000)")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
- sample_rate = int(options.sample_rate)
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=48000,
+ help="set sample rate, default=%(default)s")
+ args = parser.parse_args()
+
+ sample_rate = int(args.sample_rate)
ampl = 0.1
src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, ampl)
src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl)
- dst = audio.sink(sample_rate, options.audio_output)
+ dst = audio.sink(sample_rate, args.audio_output)
self.connect(src0, (dst, 0))
self.connect(src1, (dst, 1))
diff --git a/gr-audio/examples/python/dial_tone_daemon.py b/gr-audio/examples/python/dial_tone_daemon.py
index e4dbd95321..9919e367a6 100755
--- a/gr-audio/examples/python/dial_tone_daemon.py
+++ b/gr-audio/examples/python/dial_tone_daemon.py
@@ -22,8 +22,8 @@
from gnuradio import gr, gru
from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float
+from argparse import ArgumentParser
import os
try:
@@ -37,22 +37,18 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=48000,
- help="set sample rate to RATE (48000)")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
- sample_rate = int(options.sample_rate)
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=48000,
+ help="set sample rate to RATE (%(default)r)")
+ args = parser.parse_args()
+ sample_rate = int(args.sample_rate)
ampl = 0.1
src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, ampl)
src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl)
- dst = audio.sink(sample_rate, options.audio_output)
+ dst = audio.sink(sample_rate, args.audio_output)
self.connect(src0, (dst, 0))
self.connect(src1, (dst, 1))
diff --git a/gr-audio/examples/python/dial_tone_wav.py b/gr-audio/examples/python/dial_tone_wav.py
index 82f8cf331d..351ca94e78 100755
--- a/gr-audio/examples/python/dial_tone_wav.py
+++ b/gr-audio/examples/python/dial_tone_wav.py
@@ -24,8 +24,8 @@
from gnuradio import gr
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float
+from argparse import ArgumentParser
try:
from gnuradio import analog
@@ -38,25 +38,23 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- usage = "%prog: [options] filename"
- parser = OptionParser(option_class=eng_option, usage=usage)
- parser.add_option("-r", "--sample-rate", type="eng_float", default=48000,
- help="set sample rate to RATE (48000)")
- parser.add_option("-N", "--samples", type="eng_float", default=None,
- help="number of samples to record")
- (options, args) = parser.parse_args ()
- if len(args) != 1 or options.samples is None:
- parser.print_help()
- raise SystemExit, 1
+ parser = ArgumentParser()
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=48000,
+ help="set sample rate to RATE (%(default)r)")
+ parser.add_argument("-N", "--samples", type=eng_float, required=True,
+ help="number of samples to record")
+ parser.add_argument('file_name', metavar='WAV-FILE',
+ help='Output WAV file name', nargs=1)
+ args = parser.parse_args()
- sample_rate = int(options.sample_rate)
+ sample_rate = int(args.sample_rate)
ampl = 0.1
src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, ampl)
src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl)
- head0 = blocks.head(gr.sizeof_float, int(options.samples))
- head1 = blocks.head(gr.sizeof_float, int(options.samples))
- dst = blocks.wavfile_sink(args[0], 2, int(options.sample_rate), 16)
+ head0 = blocks.head(gr.sizeof_float, int(args.samples))
+ head1 = blocks.head(gr.sizeof_float, int(args.samples))
+ dst = blocks.wavfile_sink(args.file_name[0], 2, int(args.sample_rate), 16)
self.connect(src0, head0, (dst, 0))
self.connect(src1, head1, (dst, 1))
diff --git a/gr-audio/examples/python/mono_tone.py b/gr-audio/examples/python/mono_tone.py
index ad73d62327..653fd575fc 100755
--- a/gr-audio/examples/python/mono_tone.py
+++ b/gr-audio/examples/python/mono_tone.py
@@ -22,8 +22,8 @@
from gnuradio import gr
from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float
+from argparse import ArgumentParser
try:
from gnuradio import analog
@@ -40,27 +40,23 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=48000,
- help="set sample rate to RATE (48000)")
- parser.add_option("-D", "--dont-block", action="store_false", default=True,
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=48000,
+ help="set sample rate to RATE %(default)r)")
+ parser.add_argument("-D", "--dont-block", action="store_false", default=True,
dest="ok_to_block")
- (options, args) = parser.parse_args ()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
- sample_rate = int(options.sample_rate)
- ampl = 0.1
+ args = parser.parse_args()
+ sample_rate = int(args.sample_rate)
+ ampl = 0.5
src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 650, ampl)
dst = audio.sink(sample_rate,
- options.audio_output,
- options.ok_to_block)
+ args.audio_output,
+ args.ok_to_block)
self.connect (src0, (dst, 0))
diff --git a/gr-audio/examples/python/multi_tone.py b/gr-audio/examples/python/multi_tone.py
index 6232cbef52..00c052794a 100755
--- a/gr-audio/examples/python/multi_tone.py
+++ b/gr-audio/examples/python/multi_tone.py
@@ -22,8 +22,8 @@
from gnuradio import gr
from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
try:
from gnuradio import analog
@@ -40,22 +40,18 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=48000,
- help="set sample rate to RATE (48000)")
- parser.add_option ("-m", "--max-channels", type="int", default="16",
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=48000,
+ help="set sample rate to RATE (%(default)r)")
+ parser.add_argument ("-m", "--max-channels", type=int, default=16,
help="set maximum channels to use")
- parser.add_option("-D", "--dont-block", action="store_false", default=True,
+ parser.add_argument("-D", "--dont-block", action="store_false",
dest="ok_to_block")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
- sample_rate = int(options.sample_rate)
- limit_channels = options.max_channels
+ args = parser.parse_args()
+ sample_rate = int(args.sample_rate)
+ limit_channels = args.max_channels
ampl = 0.1
@@ -76,8 +72,8 @@ class my_top_block(gr.top_block):
progression = (7, 11, 1, 5, 9)
dst = audio.sink(sample_rate,
- options.audio_output,
- options.ok_to_block)
+ args.audio_output,
+ args.ok_to_block)
max_chan = dst.input_signature().max_streams()
if (max_chan == -1) or (max_chan > limit_channels):
diff --git a/gr-audio/examples/python/noise.py b/gr-audio/examples/python/noise.py
index b15065cd4e..31fdb16fe5 100755
--- a/gr-audio/examples/python/noise.py
+++ b/gr-audio/examples/python/noise.py
@@ -23,30 +23,26 @@
from gnuradio import gr
from gnuradio import audio
from gnuradio import digital
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float
+from argparse import ArgumentParser
class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=48000,
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=48000,
help="set sample rate to RATE (48000)")
- (options, args) = parser.parse_args ()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
- sample_rate = int(options.sample_rate)
+ args = parser.parse_args()
+ sample_rate = int(args.sample_rate)
ampl = 0.1
src = digital.glfsr_source_b(32) # Pseudorandom noise source
b2f = digital.chunks_to_symbols_bf([ampl, -ampl], 1)
- dst = audio.sink(sample_rate, options.audio_output)
+ dst = audio.sink(sample_rate, args.audio_output)
self.connect(src, b2f, dst)
if __name__ == '__main__':
diff --git a/gr-audio/examples/python/spectrum_inversion.py b/gr-audio/examples/python/spectrum_inversion.py
index a02d6c5821..163668e450 100755
--- a/gr-audio/examples/python/spectrum_inversion.py
+++ b/gr-audio/examples/python/spectrum_inversion.py
@@ -29,29 +29,25 @@
from gnuradio import gr
from gnuradio import audio
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-I", "--audio-input", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-I", "--audio-input", default="",
help="pcm input device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=8000,
- help="set sample rate to RATE (8000)")
- (options, args) = parser.parse_args ()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
- sample_rate = int(options.sample_rate)
- src = audio.source (sample_rate, options.audio_input)
- dst = audio.sink (sample_rate, options.audio_output)
+ parser.add_argument("-r", "--sample-rate", type=eng_float, default=8000,
+ help="set sample rate to RATE (%(default)r)")
+ args = parser.parse_args()
+ sample_rate = int(args.sample_rate)
+ src = audio.source (sample_rate, args.audio_input)
+ dst = audio.sink (sample_rate, args.audio_output)
vec1 = [1, -1]
vsource = blocks.vector_source_f(vec1, True)
diff --git a/gr-audio/examples/python/test_resampler.py b/gr-audio/examples/python/test_resampler.py
index 94d95fecf3..4d8a9233e7 100755
--- a/gr-audio/examples/python/test_resampler.py
+++ b/gr-audio/examples/python/test_resampler.py
@@ -23,8 +23,8 @@
from gnuradio import gr, gru
from gnuradio import audio
from gnuradio import filter
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
try:
from gnuradio import analog
@@ -43,20 +43,16 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-O", "--audio-output", type="string", default="",
+ parser = ArgumentParser()
+ parser.add_argument("-O", "--audio-output", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-i", "--input-rate", type="eng_float", default=8000,
- help="set input sample rate to RATE (%default)")
- parser.add_option("-o", "--output-rate", type="eng_float", default=48000,
- help="set output sample rate to RATE (%default)")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
- input_rate = int(options.input_rate)
- output_rate = int(options.output_rate)
+ parser.add_argument("-i", "--input-rate", type=eng_float, default=8000,
+ help="set input sample rate to RATE %(default)r")
+ parser.add_argument("-o", "--output-rate", type=eng_float, default=48000,
+ help="set output sample rate to RATE %(default)r")
+ args = parser.parse_args()
+ input_rate = int(args.input_rate)
+ output_rate = int(args.output_rate)
interp = gru.lcm(input_rate, output_rate) / input_rate
decim = gru.lcm(input_rate, output_rate) / output_rate
@@ -67,7 +63,7 @@ class my_top_block(gr.top_block):
ampl = 0.1
src0 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 650, ampl)
rr = filter.rational_resampler_fff(interp, decim)
- dst = audio.sink(output_rate, options.audio_output)
+ dst = audio.sink(output_rate, args.audio_output)
self.connect(src0, rr, (dst, 0))
if __name__ == '__main__':
diff --git a/gr-audio/lib/windows/windows_sink.cc b/gr-audio/lib/windows/windows_sink.cc
index 4ec798b0ba..52456dbdc4 100644
--- a/gr-audio/lib/windows/windows_sink.cc
+++ b/gr-audio/lib/windows/windows_sink.cc
@@ -46,10 +46,10 @@ namespace gr {
sink::sptr
windows_sink_fcn(int sampling_rate,
const std::string &device_name,
- bool)
+ bool ok_to_block)
{
return sink::sptr
- (new windows_sink(sampling_rate, device_name));
+ (new windows_sink(sampling_rate, device_name, ok_to_block));
}
static const double CHUNK_TIME = prefs::singleton()->get_double("audio_windows", "period_time", 0.1); // 100 ms (below 3ms distortion will likely occur regardless of number of buffers, will likely be a higher limit on slower machines)
@@ -63,13 +63,13 @@ namespace gr {
return (default_device == "default" ? "WAVE_MAPPER" : default_device);
}
- windows_sink::windows_sink(int sampling_freq, const std::string device_name)
+ windows_sink::windows_sink(int sampling_freq, const std::string device_name, bool ok_to_block)
: sync_block("audio_windows_sink",
io_signature::make(1, 2, sizeof(float)),
io_signature::make(0, 0, 0)),
d_sampling_freq(sampling_freq),
d_device_name(device_name.empty() ? default_device_name() : device_name),
- d_fd(-1), d_buffers(0), d_chunk_size(0)
+ d_fd(-1), d_buffers(0), d_chunk_size(0), d_ok_to_block(ok_to_block)
{
/* Initialize the WAVEFORMATEX for 16-bit, 44KHz, stereo */
wave_format.wFormatTag = WAVE_FORMAT_PCM;
@@ -154,10 +154,20 @@ namespace gr {
}
}
if (!chosen_header) {
- WaitForSingleObject(d_wave_write_event, 100);
- printf("aO");
+ if (!d_ok_to_block)
+ {
+ // drop the input data, print warning, and return control.
+ printf("aO");
+ return noutput_items;
+ }
+ else {
+ WaitForSingleObject(d_wave_write_event, 100);
+ }
}
if (c++ > 10) {
+ // After waiting for 1 second, then something else is seriously wrong so let's
+ // just fail and give some debugging information about the status
+ // of the buffers.
for (int i = 0; i < nPeriods; i++) {
printf("%d: %d\n", i, d_buffers[i]->dwFlags);
}
diff --git a/gr-audio/lib/windows/windows_sink.h b/gr-audio/lib/windows/windows_sink.h
index 2bfdbd318d..de905c68fd 100644
--- a/gr-audio/lib/windows/windows_sink.h
+++ b/gr-audio/lib/windows/windows_sink.h
@@ -49,22 +49,24 @@ namespace gr {
int d_fd;
LPWAVEHDR *d_buffers;
DWORD d_chunk_size;
- DWORD d_buffer_size;
+ DWORD d_buffer_size;
+ bool d_ok_to_block;
HWAVEOUT d_h_waveout;
HANDLE d_wave_write_event;
- WAVEFORMATEX wave_format;
+ WAVEFORMATEX wave_format;
protected:
int string_to_int(const std::string & s);
int open_waveout_device(void);
int write_waveout(LPWAVEHDR lp_wave_hdr);
- MMRESULT is_format_supported(LPWAVEFORMATEX pwfx, UINT uDeviceID);
- bool is_number(const std::string& s);
- UINT find_device(std::string szDeviceName);
+ MMRESULT is_format_supported(LPWAVEFORMATEX pwfx, UINT uDeviceID);
+ bool is_number(const std::string& s);
+ UINT find_device(std::string szDeviceName);
public:
windows_sink(int sampling_freq,
- const std::string device_name = "");
+ const std::string device_name,
+ bool ok_to_block);
~windows_sink();
int work(int noutput_items,
diff --git a/gr-audio/lib/windows/windows_source.cc b/gr-audio/lib/windows/windows_source.cc
index 02c9311517..f458fa474e 100644
--- a/gr-audio/lib/windows/windows_source.cc
+++ b/gr-audio/lib/windows/windows_source.cc
@@ -26,9 +26,6 @@
#include "audio_registry.h"
#include <windows_source.h>
-#include <gnuradio/io_signature.h>
-//include <sys/soundcard.h>
-//include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -36,160 +33,306 @@
#include <stdio.h>
#include <iostream>
#include <stdexcept>
+#include <sstream>
+#include <gnuradio/io_signature.h>
+#include <gnuradio/prefs.h>
+#include <gnuradio/logger.h>
+
+#include "boost/lexical_cast.hpp"
+
namespace gr {
- namespace audio {
-
- source::sptr
- windows_source_fcn(int sampling_rate,
- const std::string &device_name,
- bool)
- {
- return source::sptr
- (new windows_source(sampling_rate, device_name));
- }
-
- static const double CHUNK_TIME = 0.005; // 5 ms
-
- // FIXME these should query some kind of user preference
-
- static std::string
- default_device_name()
- {
- return "/dev/dsp";
- }
-
- windows_source::windows_source(int sampling_freq,
- const std::string device_name)
- : sync_block("audio_windows_source",
- io_signature::make(0, 0, 0),
- io_signature::make(1, 2, sizeof(float))),
- d_sampling_freq(sampling_freq),
- d_device_name(device_name.empty() ? default_device_name() : device_name),
- d_fd(-1), d_buffer(0), d_chunk_size(0)
- {
- //FIXME TODO implement me
-#if 0
- if((d_fd = open(d_device_name.c_str(), O_RDONLY)) < 0) {
- fprintf(stderr, "audio_windows_source: ");
- perror(d_device_name.c_str());
- throw std::runtime_error("audio_windows_source");
- }
-
- d_chunk_size = (int)(d_sampling_freq * CHUNK_TIME);
- set_output_multiple(d_chunk_size);
-
- d_buffer = new short[d_chunk_size * 2];
-
- int format = AFMT_S16_NE;
- int orig_format = format;
- if(ioctl(d_fd, SNDCTL_DSP_SETFMT, &format) < 0) {
- std::cerr << "audio_windows_source: " << d_device_name
- << " ioctl failed\n";
- perror(d_device_name.c_str());
- throw std::runtime_error("audio_windows_source");
- }
-
- if(format != orig_format) {
- fprintf(stderr, "audio_windows_source: unable to support format %d\n",
- orig_format);
- fprintf(stderr, " card requested %d instead.\n", format);
- }
-
- // set to stereo no matter what. Some hardware only does stereo
- int channels = 2;
- if(ioctl(d_fd, SNDCTL_DSP_CHANNELS, &channels) < 0 || channels != 2) {
- perror("audio_windows_source: could not set STEREO mode");
- throw std::runtime_error("audio_windows_source");
- }
-
- // set sampling freq
- int sf = sampling_freq;
- if(ioctl(d_fd, SNDCTL_DSP_SPEED, &sf) < 0) {
- std::cerr << "audio_windows_source: "
- << d_device_name << ": invalid sampling_freq "
- << sampling_freq << "\n";
- sampling_freq = 8000;
- if(ioctl(d_fd, SNDCTL_DSP_SPEED, &sf) < 0) {
- std::cerr << "audio_windows_source: failed to set sampling_freq to 8000\n";
- throw std::runtime_error ("audio_windows_source");
- }
- }
-#endif
- }
-
- windows_source::~windows_source()
- {
- /*close(d_fd);
- delete [] d_buffer;
- */
- }
-
- int
- windows_source::work(int noutput_items,
- gr_vector_const_void_star & input_items,
- gr_vector_void_star & output_items)
- {
- //FIXME TODO implement me
-#if 0
- float *f0 = (float*)output_items[0];
- float *f1 = (float*)output_items[1]; // will be invalid if this is mono output
-
- const int shorts_per_item = 2; // L + R
- const int bytes_per_item = shorts_per_item * sizeof(short);
-
- // To minimize latency, never return more than CHUNK_TIME
- // worth of samples per call to work.
- // FIXME, we need an API to set this value
-
- noutput_items = std::min(noutput_items, d_chunk_size);
-
- int base = 0;
- int ntogo = noutput_items;
-
- while(ntogo > 0) {
- int nbytes = std::min(ntogo, d_chunk_size) * bytes_per_item;
- int result_nbytes = read(d_fd, d_buffer, nbytes);
-
- if(result_nbytes < 0) {
- perror("audio_windows_source");
- return -1; // say we're done
- }
-
- if((result_nbytes & (bytes_per_item - 1)) != 0) {
- fprintf(stderr, "audio_windows_source: internal error.\n");
- throw std::runtime_error("internal error");
- }
-
- int result_nitems = result_nbytes / bytes_per_item;
-
- // now unpack samples into output streams
- switch(output_items.size()) {
- case 1: // mono output
- for(int i = 0; i < result_nitems; i++) {
- f0[base + i] = d_buffer[2 * i + 0] * (1.0 / 32767);
- }
- break;
-
- case 2: // stereo output
- for(int i = 0; i < result_nitems; i++) {
- f0[base + i] = d_buffer[2 * i + 0] * (1.0 / 32767);
- f1[base + i] = d_buffer[2 * i + 1] * (1.0 / 32767);
- }
- break;
-
- default:
- assert(0);
- }
-
- ntogo -= result_nitems;
- base += result_nitems;
- }
-
- return noutput_items - ntogo;
-#endif
- return -1; // EOF
- }
+ namespace audio {
+
+ // Currently this audio source will only support a single channel input at 16-bits. So a stereo input will likely be turned into a mono by the wave mapper
+
+ source::sptr
+ windows_source_fcn(int sampling_rate,
+ const std::string &device_name,
+ bool)
+ {
+ return source::sptr
+ (new windows_source(sampling_rate, device_name));
+ }
+
+ static const double CHUNK_TIME = prefs::singleton()->get_double("audio_windows", "period_time", 0.1); // 100 ms (below 3ms distortion will likely occur regardless of number of buffers, will likely be a higher limit on slower machines)
+ static const int nPeriods = prefs::singleton()->get_long("audio_windows", "nperiods", 4); // 4 should be more than enough with a normal chunk time (2 will likely work as well)... at 3ms chunks 10 was enough on a fast machine
+ static const bool verbose = prefs::singleton()->get_bool("audio_windows", "verbose", false);
+ static const std::string default_device = prefs::singleton()->get_string("audio_windows", "standard_input_device", "default");
+
+ static std::string
+ default_device_name()
+ {
+ return (default_device == "default" ? "WAVE_MAPPER" : default_device);
+ }
+
+ windows_source::windows_source(int sampling_freq,
+ const std::string device_name)
+ : sync_block("audio_windows_source",
+ io_signature::make(0, 0, 0),
+ io_signature::make(1, 1, sizeof(float))),
+ d_sampling_freq(sampling_freq),
+ d_device_name(device_name.empty() ? default_device_name() : device_name),
+ d_fd(-1), lp_buffers(0), d_chunk_size(0)
+ {
+ /* Initialize the WAVEFORMATEX for 16-bit, mono */
+ wave_format.wFormatTag = WAVE_FORMAT_PCM;
+ wave_format.nChannels = 1; // changing this will require adjustments to the work routine.
+ wave_format.wBitsPerSample = 16; // changing this will necessitate changing buffer type from short.
+ wave_format.nSamplesPerSec = d_sampling_freq; // defined by flowgraph settings, but note that the microphone will likely have a native sample rate
+ // that the audio system may upsample to you desired rate, so check where the cutoff ends up or check your control panel
+ wave_format.nBlockAlign =
+ wave_format.nChannels * (wave_format.wBitsPerSample / 8);
+ wave_format.nAvgBytesPerSec =
+ wave_format.nSamplesPerSec * wave_format.nBlockAlign;
+ wave_format.cbSize = 0;
+
+ d_chunk_size = (int)(d_sampling_freq * CHUNK_TIME); // Samples per chunk
+ set_output_multiple(d_chunk_size);
+ d_buffer_size = d_chunk_size * wave_format.nChannels * (wave_format.wBitsPerSample / 8); // room for 16-bit audio on one channel.
+
+ if (open_wavein_device() < 0) {
+ perror("audio_windows_source:open_wavein_device() failed\n");
+ throw
+ std::runtime_error("audio_windows_source:open_wavein_device() failed");
+ }
+ else if (verbose) {
+ GR_LOG_INFO(logger, "Opened windows wavein device");
+ }
+ lp_buffers = new LPWAVEHDR[nPeriods];
+ for (int i = 0; i < nPeriods; i++)
+ {
+ lp_buffers[i] = new WAVEHDR;
+ LPWAVEHDR lp_buffer = lp_buffers[i];
+ lp_buffer->dwLoops = 0L;
+ lp_buffer->dwFlags = 0;
+ lp_buffer->dwBufferLength = d_buffer_size;
+ lp_buffer->lpData = new CHAR[d_buffer_size];
+ MMRESULT w_result =
+ waveInPrepareHeader(d_h_wavein, lp_buffer, sizeof(WAVEHDR));
+ if (w_result != 0) {
+ perror("audio_windows_source: Failed to waveInPrepareHeader");
+ throw
+ std::runtime_error("audio_windows_source:open_wavein_device() failed");
+ }
+ waveInAddBuffer(d_h_wavein, lp_buffer, sizeof(WAVEHDR));
+ }
+ waveInStart(d_h_wavein);
+ if (verbose) GR_LOG_INFO(logger, boost::format("Initialized %1% %2%ms audio buffers, total memory used: %3$0.2fkB") % (nPeriods) % (CHUNK_TIME * 1000) % ((d_buffer_size * nPeriods) / 1024.0));
+ }
+
+ windows_source::~windows_source()
+ {
+ // stop playback and set all buffers to DONE.
+ waveInReset(d_h_wavein);
+ // Now we can deallocate the buffers
+ for (int i = 0; i < nPeriods; i++)
+ {
+ if (lp_buffers[i]->dwFlags & (WHDR_DONE | WHDR_PREPARED)) {
+ waveInUnprepareHeader(d_h_wavein, lp_buffers[i], sizeof(WAVEHDR));
+ }
+ else {
+
+ }
+ delete lp_buffers[i]->lpData;
+ }
+ /* Free the callback Event */
+ waveInClose(d_h_wavein);
+ delete[] lp_buffers;
+ }
+
+ int
+ windows_source::work(int noutput_items,
+ gr_vector_const_void_star & input_items,
+ gr_vector_void_star & output_items)
+ {
+ float *f0, *f1;
+ DWORD dw_items = 0;
+
+ while (!buffer_queue.empty())
+ {
+ // Pull the next incoming buffer off the queue
+ LPWAVEHDR next_header = buffer_queue.front();
+
+ // Convert and calculate the number of samples (might not be full)
+ short *lp_buffer = (short *)next_header->lpData;
+ DWORD buffer_length = next_header->dwBytesRecorded / sizeof(short);
+
+ if (buffer_length + dw_items > noutput_items * output_items.size()) {
+ // There's not enough output buffer space to send the whole input buffer
+ // so don't try, just leave it in the queue
+ // or else we'd have to track how much we sent etc
+ // In theory we should never reach this code because the buffers should all be
+ // sized the same
+ return dw_items;
+ }
+ else {
+ switch (output_items.size()) {
+ case 1: // mono output
+ f0 = (float*)output_items[0];
+
+ for (int j = 0; j < buffer_length; j++) {
+ f0[dw_items + j] = (float)(lp_buffer[j]) / 32767.0;
+ }
+ dw_items += buffer_length;
+ break;
+ case 2: // stereo output (interleaved in the buffer)
+ f0 = (float*)output_items[0];
+ f1 = (float*)output_items[1];
+
+ for (int j = 0; j < buffer_length / 2; j++) {
+ f0[dw_items + j] = (float)(lp_buffer[2 * j + 0]) / 32767.0;
+ f1[dw_items + j] = (float)(lp_buffer[2 * j + 1]) / 32767.0;
+ }
+ dw_items += buffer_length / 2;
+ }
+ buffer_queue.pop();
+
+ // Recycle the buffer
+ next_header->dwFlags = 0;
+ waveInPrepareHeader(d_h_wavein, next_header, sizeof(WAVEHDR));
+ waveInAddBuffer(d_h_wavein, next_header, sizeof(WAVEHDR));
+ }
+ }
+ return dw_items;
+ }
+
+ int
+ windows_source::string_to_int(const std::string & s)
+ {
+ int i;
+ std::istringstream(s) >> i;
+ return i;
+ }
+
+ MMRESULT windows_source::is_format_supported(LPWAVEFORMATEX pwfx, UINT uDeviceID)
+ {
+ return (waveInOpen(
+ NULL, // ptr can be NULL for query
+ uDeviceID, // the device identifier
+ pwfx, // defines requested format
+ NULL, // no callback
+ NULL, // no instance data
+ WAVE_FORMAT_QUERY)); // query only, do not open device
+ }
+
+ bool windows_source::is_number(const std::string& s)
+ {
+ std::string::const_iterator it = s.begin();
+ while (it != s.end() && std::isdigit(*it)) ++it;
+ return !s.empty() && it == s.end();
+ }
+
+ UINT windows_source::find_device(std::string szDeviceName)
+ {
+ UINT result = -1;
+ UINT num_devices = waveInGetNumDevs();
+ if (num_devices > 0) {
+ // what the device name passed as a number?
+ if (is_number(szDeviceName))
+ {
+ // a number, so must be referencing a device ID (which incremement from zero)
+ UINT num = std::stoul(szDeviceName);
+ if (num < num_devices) {
+ result = num;
+ }
+ else {
+ GR_LOG_INFO(logger, boost::format("Warning: waveIn deviceID %d was not found, defaulting to WAVE_MAPPER") % num);
+ result = WAVE_MAPPER;
+ }
+
+ }
+ else {
+ // device name passed as string
+ for (UINT i = 0; i < num_devices; i++)
+ {
+ WAVEINCAPS woc;
+ if (waveInGetDevCaps(i, &woc, sizeof(woc)) != MMSYSERR_NOERROR)
+ {
+ perror("Error: Could not retrieve wave out device capabilities for device");
+ return -1;
+ }
+ if (woc.szPname == szDeviceName)
+ {
+ result = i;
+ }
+ if (verbose) GR_LOG_INFO(logger, boost::format("WaveIn Device %d: %s") % i % woc.szPname);
+ }
+ if (result == -1) {
+ GR_LOG_INFO(logger, boost::format("Warning: waveIn device '%s' was not found, defaulting to WAVE_MAPPER") % szDeviceName);
+ result = WAVE_MAPPER;
+ }
+ }
+ }
+ else {
+ perror("Error: No WaveIn devices present or accessible");
+ }
+ return result;
+ }
+
+ int
+ windows_source::open_wavein_device(void)
+ {
+ UINT u_device_id;
+ unsigned long result;
+
+ /** Identifier of the waveform-audio output device to open. It
+ can be either a device identifier or a handle of an open
+ waveform-audio input device. You can use the following flag
+ instead of a device identifier.
+ WAVE_MAPPER The function selects a waveform-audio output
+ device capable of playing the given format.
+ */
+ if (d_device_name.empty() || default_device_name() == d_device_name)
+ u_device_id = WAVE_MAPPER;
+ else
+ // The below could be uncommented to allow selection of different device handles
+ // however it is unclear what other devices are out there and how a user
+ // would know the device ID so at the moment we will ignore that setting
+ // and stick with WAVE_MAPPER
+ u_device_id = find_device(d_device_name);
+ if (verbose) GR_LOG_INFO(logger, boost::format("waveIn Device ID: %1%") % (u_device_id));
+
+ // Check if the sampling rate/bits/channels are good to go with the device.
+ MMRESULT supported = is_format_supported(&wave_format, u_device_id);
+ if (supported != MMSYSERR_NOERROR) {
+ char err_msg[50];
+ waveInGetErrorText(supported, err_msg, 50);
+ GR_LOG_INFO(logger, boost::format("format error: %s") % err_msg);
+ perror("audio_windows_source: Requested audio format is not supported by device driver");
+ return -1;
+ }
+
+ // Open a waveform device for output using event callback.
+ result = waveInOpen(&d_h_wavein, u_device_id,
+ &wave_format,
+ (DWORD_PTR)&read_wavein,
+ (DWORD_PTR)&buffer_queue, CALLBACK_FUNCTION | WAVE_ALLOWSYNC);
+
+ if (result) {
+ perror("audio_windows_source: Failed to open waveform output device.");
+ return -1;
+ }
+ return 0;
+ }
- } /* namespace audio */
+ static void CALLBACK read_wavein(
+ HWAVEIN hwi,
+ UINT uMsg,
+ DWORD_PTR dwInstance,
+ DWORD_PTR dwParam1,
+ DWORD_PTR dwParam2
+ )
+ {
+ // Ignore WIM_OPEN and WIM_CLOSE messages
+ if (uMsg == WIM_DATA) {
+ if (!dwInstance) {
+ perror("audio_windows_source: callback function missing buffer queue");
+ }
+ LPWAVEHDR lp_wave_hdr = (LPWAVEHDR)dwParam1; // The new audio data
+ boost::lockfree::spsc_queue<LPWAVEHDR> *q = (boost::lockfree::spsc_queue<LPWAVEHDR> *)dwInstance; // The buffer queue we assigned to the device to track the buffers that need to be sent
+ q->push(lp_wave_hdr); // Add the buffer to that queue
+ }
+ }
+ } /* namespace audio */
} /* namespace gr */
diff --git a/gr-audio/lib/windows/windows_source.h b/gr-audio/lib/windows/windows_source.h
index 9814d12f54..edb89a73ce 100644
--- a/gr-audio/lib/windows/windows_source.h
+++ b/gr-audio/lib/windows/windows_source.h
@@ -23,9 +23,17 @@
#ifndef INCLUDED_AUDIO_WINDOWS_SOURCE_H
#define INCLUDED_AUDIO_WINDOWS_SOURCE_H
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX // stops windef.h defining max/min under cygwin
+
+#include <windows.h>
+#include <mmsystem.h>
+
#include <gnuradio/audio/source.h>
#include <string>
+#include <boost/lockfree/spsc_queue.hpp>
+
namespace gr {
namespace audio {
@@ -38,11 +46,22 @@ namespace gr {
*/
class windows_source : public source
{
- int d_sampling_freq;
- std::string d_device_name;
- int d_fd;
- short *d_buffer;
- int d_chunk_size;
+ int d_sampling_freq;
+ std::string d_device_name;
+ int d_fd;
+ LPWAVEHDR *lp_buffers;
+ DWORD d_chunk_size;
+ DWORD d_buffer_size;
+ HWAVEIN d_h_wavein;
+ WAVEFORMATEX wave_format;
+
+ protected:
+ int string_to_int(const std::string & s);
+ int open_wavein_device(void);
+ MMRESULT is_format_supported(LPWAVEFORMATEX pwfx, UINT uDeviceID);
+ bool is_number(const std::string& s);
+ UINT find_device(std::string szDeviceName);
+ boost::lockfree::spsc_queue<LPWAVEHDR> buffer_queue{ 100 };
public:
windows_source(int sampling_freq,
@@ -54,6 +73,14 @@ namespace gr {
gr_vector_void_star & output_items);
};
+ static void CALLBACK read_wavein(
+ HWAVEIN hwi,
+ UINT uMsg,
+ DWORD_PTR dwInstance,
+ DWORD_PTR dwParam1,
+ DWORD_PTR dwParam2
+ );
+
} /* namespace audio */
} /* namespace gr */
diff --git a/gr-blocks/CMakeLists.txt b/gr-blocks/CMakeLists.txt
index 6f573a09b1..6877ddca2d 100644
--- a/gr-blocks/CMakeLists.txt
+++ b/gr-blocks/CMakeLists.txt
@@ -53,7 +53,6 @@ add_subdirectory(lib)
#endif(ENABLE_TESTING)
if(ENABLE_PYTHON)
add_subdirectory(python/blocks)
- add_subdirectory(python/grc_gnuradio)
add_subdirectory(swig)
add_subdirectory(grc)
add_subdirectory(doc)
diff --git a/gr-blocks/examples/ctrlport/usrp_sink_controller.py b/gr-blocks/examples/ctrlport/usrp_sink_controller.py
index d8c38e36f2..ec687d80e1 100755
--- a/gr-blocks/examples/ctrlport/usrp_sink_controller.py
+++ b/gr-blocks/examples/ctrlport/usrp_sink_controller.py
@@ -3,28 +3,22 @@
import sys
import pmt
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
-from optparse import OptionParser
+from argparse import ArgumentParser
-parser = OptionParser(usage="%prog: [options]")
-parser.add_option("-H", "--host", type="string", default="localhost",
- help="Hostname to connect to (default=%default)")
-parser.add_option("-p", "--port", type="int", default=9090,
- help="Port of Controlport instance on host (default=%default)")
-parser.add_option("-a", "--alias", type="string", default="gr uhd usrp sink0",
- help="The UHD block's alias to control (default=%default)")
-options, args = parser.parse_args()
-
-if(len(args) < 2):
- sys.stderr.write('Not enough arguments: usrp_source_controller.py [options] <command> <value>\n')
- sys.stderr.write('See the "UHD Interface" section of the manual for available commands.\n\n')
- sys.exit(1)
+parser = ArgumentParser()
+parser.add_argument("-H", "--host", default="localhost",
+ help="Hostname to connect to (default=%(default)r)")
+parser.add_argument("-p", "--port", type=int, default=9090,
+ help="Port of Controlport instance on host (default=%(default)r)")
+parser.add_argument("-a", "--alias", default="gr uhd usrp sink0",
+ help="The UHD block's alias to control (default=%(default)r)")
+parser.add_argument("command", metavar="COMMAND")
+parser.add_argument("value", metavar="VALUE")
+args = parser.parse_args()
port = 'command'
-alias = options.alias
-hostname = options.host
-portnum = options.port
-cmd = args[0]
-val = args[1]
+cmd = args.command
+val = args.value
if(cmd == "tune" or cmd == "time"):
sys.stderr.write("This application currently does not support the 'tune' or 'time' UHD "
@@ -35,8 +29,8 @@ elif(cmd == "antenna"):
else:
val = pmt.from_double(float(val))
-argv = [None, hostname, portnum]
+argv = [None, args.host, args.port]
radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
radio = radiosys.client
-radio.postMessage(alias, port, pmt.cons(pmt.intern(cmd), val))
+radio.postMessage(args.alias, port, pmt.cons(pmt.intern(cmd), val))
diff --git a/gr-blocks/examples/ctrlport/usrp_source_controller.py b/gr-blocks/examples/ctrlport/usrp_source_controller.py
index 02d30a9d37..78c5ae66aa 100755
--- a/gr-blocks/examples/ctrlport/usrp_source_controller.py
+++ b/gr-blocks/examples/ctrlport/usrp_source_controller.py
@@ -3,28 +3,22 @@
import sys
import pmt
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
-from optparse import OptionParser
+from argparse import ArgumentParser
-parser = OptionParser(usage="%prog: [options]")
-parser.add_option("-H", "--host", type="string", default="localhost",
- help="Hostname to connect to (default=%default)")
-parser.add_option("-p", "--port", type="int", default=9090,
- help="Port of Controlport instance on host (default=%default)")
-parser.add_option("-a", "--alias", type="string", default="gr uhd usrp source0",
- help="The UHD block's alias to control (default=%default)")
-options, args = parser.parse_args()
-
-if(len(args) < 2):
- sys.stderr.write('Not enough arguments: usrp_source_controller.py [options] <command> <value>\n')
- sys.stderr.write('See the "UHD Interface" section of the manual for available commands.\n\n')
- sys.exit(1)
+parser = ArgumentParser()
+parser.add_argument("-H", "--host", default="localhost",
+ help="Hostname to connect to (default=%(default)r)")
+parser.add_argument("-p", "--port", type=int, default=9090,
+ help="Port of Controlport instance on host (default=%(default)r)")
+parser.add_argument("-a", "--alias", default="gr uhd usrp source0",
+ help="The UHD block's alias to control (default=%(default)r)")
+parser.add_argument("command", metavar="COMMAND")
+parser.add_argument("value", metavar="VALUE")
+args = parser.parse_args()
port = 'command'
-alias = options.alias
-hostname = options.host
-portnum = options.port
-cmd = args[0]
-val = args[1]
+cmd = args.command
+val = args.value
if(cmd == "tune" or cmd == "time"):
sys.stderr.write("This application currently does not support the 'tune' or 'time' UHD "
@@ -35,8 +29,8 @@ if(cmd == "antenna"):
else:
val = pmt.from_double(float(val))
-argv = [None, hostname, portnum]
+argv = [None, args.host, args.port]
radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
radio = radiosys.client
-radio.postMessage(alias, port, pmt.cons(pmt.intern(cmd), val))
+radio.postMessage(args.alias, port, pmt.cons(pmt.intern(cmd), val))
diff --git a/gr-blocks/grc/blks2_error_rate.xml b/gr-blocks/grc/blks2_error_rate.xml
deleted file mode 100644
index c71739f914..0000000000
--- a/gr-blocks/grc/blks2_error_rate.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Error Rate:
-## Custom blks2 block
-###################################################
- -->
-<block>
- <name>Error Rate</name>
- <key>blks2_error_rate</key>
- <category>[Core]/Deprecated</category>
- <import>from grc_gnuradio import blks2 as grc_blks2</import>
- <make>grc_blks2.error_rate(
- type=$type,
- win_size=$win_size,
- bits_per_symbol=$bits_per_symbol,
-)</make>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Bit Error Rate</name>
- <key>'BER'</key>
- <opt>hide_bps:</opt>
- </option>
- <option>
- <name>Symbol Error Rate</name>
- <key>'SER'</key>
- <opt>hide_bps:all</opt>
- </option>
- </param>
- <param>
- <name>Window Size</name>
- <key>win_size</key>
- <value>1000</value>
- <type>int</type>
- </param>
- <param>
- <name>Bits per Symbol</name>
- <key>bits_per_symbol</key>
- <value>2</value>
- <type>int</type>
- <hide>$type.hide_bps</hide>
- </param>
- <sink>
- <name>ref</name>
- <type>byte</type>
- </sink>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>float</type>
- </source>
- <doc>
-Calculate the bit error rate (BER) or the symbol error rate (SER) over a number of samples given by the window size. \
-The actual window size will start at size one and grow to the full window size as new samples arrive. \
-Once the window has reached full size, old samples are shifted out of the window and new samples shfited in.
-
-The error block compares the input byte stream to the reference byte stream. \
-For example, the reference byte stream could be the input to a modulator, \
-and the input byte stream could be the output of a modulator.
-
-Each byte in the incoming stream represents one symbol. \
-The bits per symbol parameter is only useful for calculating the BER.
- </doc>
-</block>
diff --git a/gr-blocks/grc/blks2_selector.xml b/gr-blocks/grc/blks2_selector.xml
deleted file mode 100644
index 3442b2cdb8..0000000000
--- a/gr-blocks/grc/blks2_selector.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Selector:
-## Custom blks2 block
-###################################################
- -->
-<block>
- <name>Selector</name>
- <key>blks2_selector</key>
- <category>[Core]/Deprecated</category>
- <import>from grc_gnuradio import blks2 as grc_blks2</import>
- <make>grc_blks2.selector(
- item_size=$type.size*$vlen,
- num_inputs=$num_inputs,
- num_outputs=$num_outputs,
- input_index=$input_index,
- output_index=$output_index,
-)</make>
- <callback>set_input_index(int($input_index))</callback>
- <callback>set_output_index(int($output_index))</callback>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>size:gr.sizeof_gr_complex</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>size:gr.sizeof_float</opt>
- </option>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>size:gr.sizeof_int</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>size:gr.sizeof_short</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>size:gr.sizeof_char</opt>
- </option>
- </param>
- <param>
- <name>Num Inputs</name>
- <key>num_inputs</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Num Outputs</name>
- <key>num_outputs</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Input Index</name>
- <key>input_index</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Output Index</name>
- <key>output_index</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Vec Length</name>
- <key>vlen</key>
- <value>1</value>
- <type>int</type>
- </param>
- <check>$vlen &gt; 0</check>
- <sink>
- <name>in</name>
- <type>$type</type>
- <vlen>$vlen</vlen>
- <nports>$num_inputs</nports>
- </sink>
- <source>
- <name>out</name>
- <type>$type</type>
- <vlen>$vlen</vlen>
- <nports>$num_outputs</nports>
- </source>
- <doc>
-Connect the sink at input index to the source at output index. Leave all other ports disconnected.
- </doc>
-</block>
diff --git a/gr-blocks/grc/blks2_tcp_sink.xml b/gr-blocks/grc/blks2_tcp_sink.xml
deleted file mode 100644
index 2bff7e6d45..0000000000
--- a/gr-blocks/grc/blks2_tcp_sink.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##TCP Sink: Custom blks2 block
-###################################################
- -->
-<block>
- <name>TCP Sink</name>
- <key>blks2_tcp_sink</key>
- <category>[Core]/Deprecated</category>
- <import>from grc_gnuradio import blks2 as grc_blks2</import>
- <make>grc_blks2.tcp_sink(
- itemsize=$type.size*$vlen,
- addr=$addr,
- port=$port,
- server=$server,
-)</make>
- <param>
- <name>Input Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>size:gr.sizeof_gr_complex</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>size:gr.sizeof_float</opt>
- </option>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>size:gr.sizeof_int</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>size:gr.sizeof_short</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>size:gr.sizeof_char</opt>
- </option>
- </param>
- <param>
- <name>Address</name>
- <key>addr</key>
- <value>127.0.0.1</value>
- <type>string</type>
- </param>
- <param>
- <name>Port</name>
- <key>port</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Mode</name>
- <key>server</key>
- <value>False</value>
- <type>enum</type>
- <option>
- <name>Server</name>
- <key>True</key>
- </option>
- <option>
- <name>Client</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Vec Length</name>
- <key>vlen</key>
- <value>1</value>
- <type>int</type>
- </param>
- <check>$vlen &gt; 0</check>
- <sink>
- <name>in</name>
- <type>$type</type>
- <vlen>$vlen</vlen>
- </sink>
- <doc>
-In client mode, we attempt to connect to a server at the given address and port. \
-In server mode, we bind a socket to the given address and port and accept the first client.
- </doc>
-</block>
diff --git a/gr-blocks/grc/blks2_tcp_source.xml b/gr-blocks/grc/blks2_tcp_source.xml
deleted file mode 100644
index f6cc41015f..0000000000
--- a/gr-blocks/grc/blks2_tcp_source.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##TCP Source: Custom blks2 block
-###################################################
- -->
-<block>
- <name>TCP Source</name>
- <key>blks2_tcp_source</key>
- <category>[Core]/Deprecated</category>
- <import>from grc_gnuradio import blks2 as grc_blks2</import>
- <make>grc_blks2.tcp_source(
- itemsize=$type.size*$vlen,
- addr=$addr,
- port=$port,
- server=$server,
-)</make>
- <param>
- <name>Output Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>size:gr.sizeof_gr_complex</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>size:gr.sizeof_float</opt>
- </option>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>size:gr.sizeof_int</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>size:gr.sizeof_short</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>size:gr.sizeof_char</opt>
- </option>
- </param>
- <param>
- <name>Address</name>
- <key>addr</key>
- <value>127.0.0.1</value>
- <type>string</type>
- </param>
- <param>
- <name>Port</name>
- <key>port</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>Mode</name>
- <key>server</key>
- <value>True</value>
- <type>enum</type>
- <option>
- <name>Server</name>
- <key>True</key>
- </option>
- <option>
- <name>Client</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Vec Length</name>
- <key>vlen</key>
- <value>1</value>
- <type>int</type>
- </param>
- <check>$vlen &gt; 0</check>
- <source>
- <name>out</name>
- <type>$type</type>
- <vlen>$vlen</vlen>
- </source>
- <doc>
-In client mode, we attempt to connect to a server at the given address and port. \
-In server mode, we bind a socket to the given address and port and accept the first client.
- </doc>
-</block>
diff --git a/gr-blocks/grc/blks2_valve.xml b/gr-blocks/grc/blks2_valve.xml
deleted file mode 100644
index c3f25163b2..0000000000
--- a/gr-blocks/grc/blks2_valve.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Valve:
-## Custom blks2 block
-###################################################
- -->
-<block>
- <name>Valve</name>
- <key>blks2_valve</key>
- <category>[Core]/Deprecated</category>
- <import>from grc_gnuradio import blks2 as grc_blks2</import>
- <make>grc_blks2.valve(item_size=$type.size*$vlen, open=bool($open))</make>
- <callback>set_open(bool($open))</callback>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>size:gr.sizeof_gr_complex</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>size:gr.sizeof_float</opt>
- </option>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>size:gr.sizeof_int</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>size:gr.sizeof_short</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>size:gr.sizeof_char</opt>
- </option>
- </param>
- <param>
- <name>Open</name>
- <key>open</key>
- <value>0</value>
- <type>raw</type>
- </param>
- <param>
- <name>Vec Length</name>
- <key>vlen</key>
- <value>1</value>
- <type>int</type>
- </param>
- <check>$vlen &gt; 0</check>
- <sink>
- <name>in</name>
- <type>$type</type>
- <vlen>$vlen</vlen>
- <nports>$num_inputs</nports>
- </sink>
- <source>
- <name>out</name>
- <type>$type</type>
- <vlen>$vlen</vlen>
- <nports>$num_outputs</nports>
- </source>
- <doc>
-Connect output to input when valve is closed (not open).
- </doc>
-</block>
diff --git a/gr-blocks/lib/ConfigChecks.cmake b/gr-blocks/lib/ConfigChecks.cmake
index 1effaa8360..222a221dc1 100644
--- a/gr-blocks/lib/ConfigChecks.cmake
+++ b/gr-blocks/lib/ConfigChecks.cmake
@@ -89,3 +89,10 @@ CHECK_CXX_SOURCE_COMPILES("
" HAVE_COSF
)
GR_ADD_COND_DEF(HAVE_COSF)
+
+CHECK_CXX_SOURCE_COMPILES("
+ #include <stdlib.h>
+ int main(){srand48(0); drand48(); lrand48(); return 0;}
+ " HAVE_RAND48
+)
+GR_ADD_COND_DEF(HAVE_RAND48)
diff --git a/gr-blocks/lib/nlog10_ff_impl.cc b/gr-blocks/lib/nlog10_ff_impl.cc
index bed2da4d0d..5bc234f2cb 100644
--- a/gr-blocks/lib/nlog10_ff_impl.cc
+++ b/gr-blocks/lib/nlog10_ff_impl.cc
@@ -26,6 +26,7 @@
#include "nlog10_ff_impl.h"
#include <gnuradio/io_signature.h>
+#include <volk/volk.h>
namespace gr {
namespace blocks {
@@ -39,8 +40,23 @@ namespace gr {
: sync_block("nlog10_ff",
io_signature::make (1, 1, sizeof(float)*vlen),
io_signature::make (1, 1, sizeof(float)*vlen)),
- d_n(n), d_vlen(vlen), d_k(k)
+ d_vlen(vlen)
{
+ setk(k);
+ setn(n);
+ //TODO message handlers
+ }
+
+ void
+ nlog10_ff_impl::setk(float k)
+ {
+ d_k = k;
+ }
+
+ void
+ nlog10_ff_impl::setn(float n)
+ {
+ d_prefactor = n / log2f(10.0f);
}
int
@@ -51,12 +67,14 @@ namespace gr {
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
int noi = noutput_items * d_vlen;
- float n = d_n;
- float k = d_k;
-
- for (int i = 0; i < noi; i++)
- out[i] = n * log10(std::max(in[i], (float) 1e-18)) + k;
+ volk_32f_log2_32f(out, in, noi);
+ volk_32f_s32f_multiply_32f(out, out, d_prefactor, noi);
+ if(d_k != 0.0f) {
+ for(int i = 0; i < noi; ++i) {
+ out[i] += d_k;
+ }
+ }
return noutput_items;
}
diff --git a/gr-blocks/lib/nlog10_ff_impl.h b/gr-blocks/lib/nlog10_ff_impl.h
index dd260bea1f..21c64d42f5 100644
--- a/gr-blocks/lib/nlog10_ff_impl.h
+++ b/gr-blocks/lib/nlog10_ff_impl.h
@@ -30,12 +30,14 @@ namespace gr {
class BLOCKS_API nlog10_ff_impl : public nlog10_ff
{
- float d_n;
+ float d_prefactor;
size_t d_vlen;
float d_k;
public:
nlog10_ff_impl(float n, size_t vlen, float k);
+ void setn(float n);
+ void setk(float k);
int work(int noutput_items,
gr_vector_const_void_star &input_items,
diff --git a/gr-blocks/lib/test_tag_variable_rate_ff_impl.cc b/gr-blocks/lib/test_tag_variable_rate_ff_impl.cc
index 4927cc1408..ec239c9fa7 100644
--- a/gr-blocks/lib/test_tag_variable_rate_ff_impl.cc
+++ b/gr-blocks/lib/test_tag_variable_rate_ff_impl.cc
@@ -57,7 +57,11 @@ namespace gr {
d_new_in = 0;
d_last_out = 0;
+#ifdef HAVE_RAND48
srand48(time(NULL));
+#else
+ srand(time(NULL));
+#endif
}
test_tag_variable_rate_ff_impl::~test_tag_variable_rate_ff_impl()
@@ -78,7 +82,11 @@ namespace gr {
GR_LOG_DEBUG(d_logger, boost::format("noutput_items: %1%") % noutput_items);
if(d_update_once) {
+#ifdef HAVE_RAND48
if(drand48() > 0.5) {
+#else
+ if (rand() > RAND_MAX / 2) {
+#endif
d_rrate += d_update_step;
}
else {
@@ -95,7 +103,11 @@ namespace gr {
while(i < ninput_items[0]) {
if(!d_update_once) {
+#ifdef HAVE_RAND48
if(drand48() > 0.5) {
+#else
+ if (rand() > RAND_MAX / 2) {
+#endif
d_rrate += d_update_step;
}
else {
diff --git a/gr-blocks/python/blocks/qa_nlog10.py b/gr-blocks/python/blocks/qa_nlog10.py
index 0194e85d48..c925479f59 100755
--- a/gr-blocks/python/blocks/qa_nlog10.py
+++ b/gr-blocks/python/blocks/qa_nlog10.py
@@ -31,15 +31,15 @@ class test_nlog10(gr_unittest.TestCase):
self.tb = None
def test_001(self):
- src_data = (-10, 0, 10, 100, 1000, 10000, 100000)
- expected_result = (-180, -180, 10, 20, 30, 40, 50)
+ src_data = (1, 10, 100, 1000, 10000, 100000)
+ expected_result = (0, 10, 20, 30, 40, 50)
src = blocks.vector_source_f(src_data)
op = blocks.nlog10_ff(10)
dst = blocks.vector_sink_f()
self.tb.connect (src, op, dst)
self.tb.run()
result_data = dst.data()
- self.assertFloatTuplesAlmostEqual (expected_result, result_data)
+ self.assertFloatTuplesAlmostEqual (expected_result, result_data, 5)
if __name__ == '__main__':
diff --git a/gr-blocks/python/grc_gnuradio/README b/gr-blocks/python/grc_gnuradio/README
deleted file mode 100644
index e27b01af54..0000000000
--- a/gr-blocks/python/grc_gnuradio/README
+++ /dev/null
@@ -1,8 +0,0 @@
-This is the grc_gnuradio module.
-It contains supplemental python modules that grc uses at runtime.
-The supplemental modules are meant to mimic modules in gnuradio.
-These will be phased-out as new functionaility is merged into gnuradio.
-
-The blk2s module wraps many blocks in blks2 and gives them streaming outputs.
-Will be phased-out by new message passing implementations.
-Other blks2 blocks will hopefully make their way into blks2impl.
diff --git a/gr-blocks/python/grc_gnuradio/__init__.py b/gr-blocks/python/grc_gnuradio/__init__.py
deleted file mode 100644
index 8b13789179..0000000000
--- a/gr-blocks/python/grc_gnuradio/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/gr-blocks/python/grc_gnuradio/blks2/error_rate.py b/gr-blocks/python/grc_gnuradio/blks2/error_rate.py
deleted file mode 100644
index 9bf387030a..0000000000
--- a/gr-blocks/python/grc_gnuradio/blks2/error_rate.py
+++ /dev/null
@@ -1,140 +0,0 @@
-# Copyright 2008 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.
-#
-
-default_win_size = 1000
-
-from gnuradio import gr
-from gnuradio import blocks
-import gnuradio.gr.gr_threading as _threading
-import numpy
-
-#generate 1s counts array
-_1s_counts = [sum([1&(i>>j) for j in range(8)]) for i in range(2**8)]
-
-class input_watcher(_threading.Thread):
- """
- Read samples from the message queue and hand them to the callback.
- """
-
- def __init__(self, msgq, callback):
- self._msgq = msgq
- self._callback = callback
- _threading.Thread.__init__(self)
- self.setDaemon(1)
- self.keep_running = True
- self.start()
-
- def run(self):
- r = ''
- while True:
- msg = self._msgq.delete_head()
- itemsize = int(msg.arg1())
- nitems = int(msg.arg2())
- s = r + msg.to_string()
- i = (nitems-nitems%2)*itemsize
- r = s[i:]
- s = s[:i]
- samples = numpy.fromstring(s, numpy.int8)
- self._callback(samples)
-
-class error_rate(gr.hier_block2):
- """
- Sample the incoming data streams (byte) and calculate the bit or symbol error rate.
- Write the running rate to the output data stream (float).
- """
-
- def __init__(self, type='BER', win_size=default_win_size, bits_per_symbol=2):
- """
- Error rate constructor.
-
- Args:
- type: a string 'BER' or 'SER'
- win_size: the number of samples to calculate over
- bits_per_symbol: the number of information bits per symbol (BER only)
- """
- #init
- gr.hier_block2.__init__(
- self, 'error_rate',
- gr.io_signature(2, 2, gr.sizeof_char),
- gr.io_signature(1, 1, gr.sizeof_float),
- )
- assert type in ('BER', 'SER')
- self._max_samples = win_size
- self._bits_per_symbol = bits_per_symbol
- #setup message queue
- msg_source = blocks.message_source(gr.sizeof_float, 1)
- self._msgq_source = msg_source.msgq()
- msgq_sink = gr.msg_queue(2)
- msg_sink = blocks.message_sink(gr.sizeof_char, msgq_sink, False) #False -> blocking
- inter = blocks.interleave(gr.sizeof_char)
- #start thread
- self._num_errs = 0
- self._err_index = 0
- self._num_samps = 0
- self._err_array = numpy.zeros(self._max_samples, numpy.int8)
- if type == 'BER':
- input_watcher(msgq_sink, self._handler_ber)
- elif type == 'SER':
- input_watcher(msgq_sink, self._handler_ser)
- #connect
- self.connect(msg_source, self)
- self.connect((self, 0), (inter, 0))
- self.connect((self, 1), (inter, 1))
- self.connect(inter, msg_sink)
-
- def _handler_ber(self, samples):
- num = len(samples)/2
- arr = numpy.zeros(num, numpy.float32)
- for i in range(num):
- old_err = self._err_array[self._err_index]
- #record error
- self._err_array[self._err_index] = _1s_counts[samples[i*2] ^ samples[i*2 + 1]]
- self._num_errs = self._num_errs + self._err_array[self._err_index] - old_err
- #increment index
- self._err_index = (self._err_index + 1)%self._max_samples
- self._num_samps = min(self._num_samps + 1, self._max_samples)
- #write sample
- arr[i] = float(self._num_errs)/float(self._num_samps*self._bits_per_symbol)
- #write message
- msg = gr.message_from_string(arr.tostring(), 0, gr.sizeof_float, num)
- self._msgq_source.insert_tail(msg)
-
- def _handler_ser(self, samples):
- num = len(samples)/2
- arr = numpy.zeros(num, numpy.float32)
- for i in range(num):
- old_err = self._err_array[self._err_index]
- #record error
- ref = samples[i*2]
- res = samples[i*2 + 1]
- if ref == res:
- self._err_array[self._err_index] = 0
- else:
- self._err_array[self._err_index] = 1
- #update number of errors
- self._num_errs = self._num_errs + self._err_array[self._err_index] - old_err
- #increment index
- self._err_index = (self._err_index + 1)%self._max_samples
- self._num_samps = min(self._num_samps + 1, self._max_samples)
- #write sample
- arr[i] = float(self._num_errs)/float(self._num_samps)
- #write message
- msg = gr.message_from_string(arr.tostring(), 0, gr.sizeof_float, num)
- self._msgq_source.insert_tail(msg)
diff --git a/gr-blocks/python/grc_gnuradio/blks2/selector.py b/gr-blocks/python/grc_gnuradio/blks2/selector.py
deleted file mode 100644
index 24e3844658..0000000000
--- a/gr-blocks/python/grc_gnuradio/blks2/selector.py
+++ /dev/null
@@ -1,142 +0,0 @@
-#
-# Copyright 2008,2013 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 import blocks
-
-class selector(gr.hier_block2):
- """A hier2 block with N inputs and M outputs, where data is only forwarded through input n to output m."""
- def __init__(self, item_size, num_inputs, num_outputs, input_index, output_index):
- """
- Selector constructor.
-
- Args:
- item_size: the size of the gr data stream in bytes
- num_inputs: the number of inputs (integer)
- num_outputs: the number of outputs (integer)
- input_index: the index for the source data
- output_index: the index for the destination data
- """
- gr.hier_block2.__init__(
- self, 'selector',
- gr.io_signature(num_inputs, num_inputs, item_size),
- gr.io_signature(num_outputs, num_outputs, item_size),
- )
- #terminator blocks for unused inputs and outputs
- self.input_terminators = [blocks.null_sink(item_size) for i in range(num_inputs)]
- self.output_terminators = [blocks.head(item_size, 0) for i in range(num_outputs)]
- self.copy = blocks.copy(item_size)
- #connections
- for i in range(num_inputs): self.connect((self, i), self.input_terminators[i])
- for i in range(num_outputs): self.connect(blocks.null_source(item_size),
- self.output_terminators[i], (self, i))
- self.item_size = item_size
- self.input_index = input_index
- self.output_index = output_index
- self.num_inputs = num_inputs
- self.num_outputs = num_outputs
- self._connect_current()
-
- def _indexes_valid(self):
- """
- Are the input and output indexes within range of the number of inputs and outputs?
-
- Returns:
- true if input index and output index are in range
- """
- return self.input_index in range(self.num_inputs) and self.output_index in range(self.num_outputs)
-
- def _connect_current(self):
- """If the input and output indexes are valid:
- disconnect the blocks at the input and output index from their terminators,
- and connect them to one another. Then connect the terminators to one another."""
- if self._indexes_valid():
- self.disconnect((self, self.input_index), self.input_terminators[self.input_index])
- self.disconnect(self.output_terminators[self.output_index], (self, self.output_index))
- self.connect((self, self.input_index), self.copy)
- self.connect(self.copy, (self, self.output_index))
- self.connect(self.output_terminators[self.output_index], self.input_terminators[self.input_index])
-
- def _disconnect_current(self):
- """If the input and output indexes are valid:
- disconnect the blocks at the input and output index from one another,
- and the terminators at the input and output index from one another.
- Reconnect the blocks to the terminators."""
- if self._indexes_valid():
- self.disconnect((self, self.input_index), self.copy)
- self.disconnect(self.copy, (self, self.output_index))
- self.disconnect(self.output_terminators[self.output_index], self.input_terminators[self.input_index])
- self.connect((self, self.input_index), self.input_terminators[self.input_index])
- self.connect(self.output_terminators[self.output_index], (self, self.output_index))
-
- def set_input_index(self, input_index):
- """
- Change the block to the new input index if the index changed.
-
- Args:
- input_index: the new input index
- """
- if self.input_index != input_index:
- self.lock()
- self._disconnect_current()
- self.input_index = input_index
- self._connect_current()
- self.unlock()
-
- def set_output_index(self, output_index):
- """
- Change the block to the new output index if the index changed.
-
- Args:
- output_index: the new output index
- """
- if self.output_index != output_index:
- self.lock()
- self._disconnect_current()
- self.output_index = output_index
- self._connect_current()
- self.unlock()
-
-class valve(selector):
- """Wrapper for selector with 1 input and 1 output."""
-
- def __init__(self, item_size, open):
- """
- Constructor for valve.
-
- Args:
- item_size: the size of the gr data stream in bytes
- open: true if initial valve state is open
- """
- if open: output_index = -1
- else: output_index = 0
- selector.__init__(self, item_size, 1, 1, 0, output_index)
-
- def set_open(self, open):
- """
- Callback to set open state.
-
- Args:
- open: true to set valve state to open
- """
- if open: output_index = -1
- else: output_index = 0
- self.set_output_index(output_index)
diff --git a/gr-blocks/python/grc_gnuradio/blks2/tcp.py b/gr-blocks/python/grc_gnuradio/blks2/tcp.py
deleted file mode 100644
index aee90fad2c..0000000000
--- a/gr-blocks/python/grc_gnuradio/blks2/tcp.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# Copyright 2009 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-from gnuradio import gr, blocks
-import socket
-import os
-
-def _get_sock_fd(addr, port, server):
- """
- Get the file descriptor for the socket.
- As a client, block on connect, dup the socket descriptor.
- As a server, block on accept, dup the client descriptor.
-
- Args:
- addr: the ip address string
- port: the tcp port number
- server: true for server mode, false for client mode
-
- Returns:
- the file descriptor number
- """
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- if server:
- sock.bind((addr, port))
- sock.listen(1)
- clientsock, address = sock.accept()
- return os.dup(clientsock.fileno())
- else:
- sock.connect((addr, port))
- return os.dup(sock.fileno())
-
-class tcp_source(gr.hier_block2):
- def __init__(self, itemsize, addr, port, server=True):
- #init hier block
- gr.hier_block2.__init__(
- self, 'tcp_source',
- gr.io_signature(0, 0, 0),
- gr.io_signature(1, 1, itemsize),
- )
- fd = _get_sock_fd(addr, port, server)
- self.connect(blocks.file_descriptor_source(itemsize, fd), self)
-
-class tcp_sink(gr.hier_block2):
- def __init__(self, itemsize, addr, port, server=False):
- #init hier block
- gr.hier_block2.__init__(
- self, 'tcp_sink',
- gr.io_signature(1, 1, itemsize),
- gr.io_signature(0, 0, 0),
- )
- fd = _get_sock_fd(addr, port, server)
- self.connect(self, blocks.file_descriptor_sink(itemsize, fd))
diff --git a/gr-digital/CMakeLists.txt b/gr-digital/CMakeLists.txt
index cafadf68d1..b2409bdca0 100644
--- a/gr-digital/CMakeLists.txt
+++ b/gr-digital/CMakeLists.txt
@@ -1,17 +1,17 @@
# 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,
@@ -63,7 +63,6 @@ add_subdirectory(doc)
if(ENABLE_PYTHON)
add_subdirectory(swig)
add_subdirectory(python/digital)
- add_subdirectory(python/grc_gnuradio)
add_subdirectory(grc)
add_subdirectory(examples)
endif(ENABLE_PYTHON)
diff --git a/gr-digital/examples/CMakeLists.txt b/gr-digital/examples/CMakeLists.txt
index 76568b5043..3725fa55ce 100644
--- a/gr-digital/examples/CMakeLists.txt
+++ b/gr-digital/examples/CMakeLists.txt
@@ -54,12 +54,8 @@ GR_PYTHON_INSTALL(PROGRAMS
# OFDM
GR_PYTHON_INSTALL(PROGRAMS
ofdm/benchmark_add_channel.py
- ofdm/benchmark_rx.py
- ofdm/benchmark_tx.py
- ofdm/gr_plot_ofdm.py
ofdm/receive_path.py
ofdm/transmit_path.py
- ofdm/tunnel.py
ofdm/uhd_interface.py
DESTINATION ${GR_PKG_DIGITAL_EXAMPLES_DIR}/ofdm
)
@@ -80,9 +76,6 @@ install(
demod/mpsk_demod.grc
demod/pam_sync.grc
demod/pam_timing.grc
- demod/ber_simulation.grc
- demod/dpsk_loopback.grc
- demod/gfsk_loopback.grc
demod/test_corr_est.grc
DESTINATION ${GR_PKG_DIGITAL_EXAMPLES_DIR}/demod
)
diff --git a/gr-digital/examples/demod/ber_simulation.grc b/gr-digital/examples/demod/ber_simulation.grc
deleted file mode 100644
index 8f9351fe1a..0000000000
--- a/gr-digital/examples/demod/ber_simulation.grc
+++ /dev/null
@@ -1,1238 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Sat Jul 12 13:50:53 2014</timestamp>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>ber_simulation</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>BER Simulation</value>
- </param>
- <param>
- <key>author</key>
- <value>Example</value>
- </param>
- <param>
- <key>description</key>
- <value>Adjust the noise and constellation... see what happens!</value>
- </param>
- <param>
- <key>window_size</key>
- <value>1280, 1024</value>
- </param>
- <param>
- <key>generate_options</key>
- <value>qt_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</value>
- </param>
- <param>
- <key>run_options</key>
- <value>prompt</value>
- </param>
- <param>
- <key>run</key>
- <value>True</value>
- </param>
- <param>
- <key>max_nouts</key>
- <value>0</value>
- </param>
- <param>
- <key>realtime_scheduling</key>
- <value></value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(16, 10)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>const_type</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>1</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(18, 428)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>const</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>(digital.constellation_bpsk(), digital.constellation_qpsk(), digital.constellation_8psk())</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(116, 310)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>100e3</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(16, 308)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blocks_throttle</key>
- <param>
- <key>id</key>
- <value>blocks_throttle</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>byte</value>
- </param>
- <param>
- <key>samples_per_second</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>ignoretag</key>
- <value>True</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(284, 24)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>import</key>
- <param>
- <key>id</key>
- <value>import</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>import</key>
- <value>import math</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(18, 373)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>analog_random_source_x</key>
- <param>
- <key>id</key>
- <value>analog_random_source_x</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>byte</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>const[const_type].arity()</value>
- </param>
- <param>
- <key>num_samps</key>
- <value>10000000</value>
- </param>
- <param>
- <key>repeat</key>
- <value>True</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(17, 125)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>analog_noise_source_x</key>
- <param>
- <key>id</key>
- <value>analog_noise_source_x</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>noise_type</key>
- <value>analog.GR_GAUSSIAN</value>
- </param>
- <param>
- <key>amp</key>
- <value>1.0 / math.sqrt(2.0 * const[const_type].bits_per_symbol() * 10**(EbN0/10))</value>
- </param>
- <param>
- <key>seed</key>
- <value>42</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(16, 224)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>digital_chunks_to_symbols_xx</key>
- <param>
- <key>id</key>
- <value>digital_chunks_to_symbols_xx</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>in_type</key>
- <value>byte</value>
- </param>
- <param>
- <key>out_type</key>
- <value>complex</value>
- </param>
- <param>
- <key>symbol_table</key>
- <value>const[const_type].points()</value>
- </param>
- <param>
- <key>dimension</key>
- <value>1</value>
- </param>
- <param>
- <key>num_ports</key>
- <value>1</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(240, 140)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>digital_constellation_decoder_cb</key>
- <param>
- <key>id</key>
- <value>digital_constellation_decoder_cb_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>constellation</key>
- <value>const[const_type].base()</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(618, 164)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_qtgui_range</key>
- <param>
- <key>id</key>
- <value>EbN0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Eb / N0 (dB)</value>
- </param>
- <param>
- <key>value</key>
- <value>10</value>
- </param>
- <param>
- <key>start</key>
- <value>-10</value>
- </param>
- <param>
- <key>stop</key>
- <value>200</value>
- </param>
- <param>
- <key>step</key>
- <value>1</value>
- </param>
- <param>
- <key>widget</key>
- <value>counter_slider</value>
- </param>
- <param>
- <key>orient</key>
- <value>Qt.Horizontal</value>
- </param>
- <param>
- <key>min_len</key>
- <value>200</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(317, 281)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_qtgui_label</key>
- <param>
- <key>id</key>
- <value>variable_qtgui_label_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Constellation Type</value>
- </param>
- <param>
- <key>type</key>
- <value>string</value>
- </param>
- <param>
- <key>value</key>
- <value>{0: 'BPSK', 1: 'QPSK', 2: '8-PSK'}[const_type] + " - Change const_type for different constellation types!"</value>
- </param>
- <param>
- <key>formatter</key>
- <value>None</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(294, 413)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blocks_add_xx</key>
- <param>
- <key>id</key>
- <value>blocks_add_xx</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>num_inputs</key>
- <value>2</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(486, 151)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_error_rate</key>
- <param>
- <key>id</key>
- <value>blks2_error_rate</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>'BER'</value>
- </param>
- <param>
- <key>win_size</key>
- <value>int(1e7)</value>
- </param>
- <param>
- <key>bits_per_symbol</key>
- <value>const[const_type].bits_per_symbol()</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(720, 25)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>qtgui_const_sink_x</key>
- <param>
- <key>id</key>
- <value>qtgui_const_sink_x_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>name</key>
- <value>"foo"</value>
- </param>
- <param>
- <key>size</key>
- <value>1024</value>
- </param>
- <param>
- <key>grid</key>
- <value>False</value>
- </param>
- <param>
- <key>autoscale</key>
- <value>False</value>
- </param>
- <param>
- <key>ymin</key>
- <value>-2</value>
- </param>
- <param>
- <key>ymax</key>
- <value>2</value>
- </param>
- <param>
- <key>xmin</key>
- <value>-2</value>
- </param>
- <param>
- <key>xmax</key>
- <value>2</value>
- </param>
- <param>
- <key>nconnections</key>
- <value>1</value>
- </param>
- <param>
- <key>update_time</key>
- <value>0.10</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value>2,0,1,1</value>
- </param>
- <param>
- <key>tr_mode</key>
- <value>qtgui.TRIG_MODE_FREE</value>
- </param>
- <param>
- <key>tr_slope</key>
- <value>qtgui.TRIG_SLOPE_POS</value>
- </param>
- <param>
- <key>tr_level</key>
- <value>0.0</value>
- </param>
- <param>
- <key>tr_chan</key>
- <value>0</value>
- </param>
- <param>
- <key>tr_tag</key>
- <value>""</value>
- </param>
- <param>
- <key>label1</key>
- <value>"Constellation: "+str(const[const_type].arity()) + "-PSK"</value>
- </param>
- <param>
- <key>width1</key>
- <value>1</value>
- </param>
- <param>
- <key>color1</key>
- <value>"blue"</value>
- </param>
- <param>
- <key>style1</key>
- <value>0</value>
- </param>
- <param>
- <key>marker1</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha1</key>
- <value>0.6</value>
- </param>
- <param>
- <key>label2</key>
- <value></value>
- </param>
- <param>
- <key>width2</key>
- <value>1</value>
- </param>
- <param>
- <key>color2</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style2</key>
- <value>0</value>
- </param>
- <param>
- <key>marker2</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha2</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label3</key>
- <value></value>
- </param>
- <param>
- <key>width3</key>
- <value>1</value>
- </param>
- <param>
- <key>color3</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style3</key>
- <value>0</value>
- </param>
- <param>
- <key>marker3</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha3</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label4</key>
- <value></value>
- </param>
- <param>
- <key>width4</key>
- <value>1</value>
- </param>
- <param>
- <key>color4</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style4</key>
- <value>0</value>
- </param>
- <param>
- <key>marker4</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha4</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label5</key>
- <value></value>
- </param>
- <param>
- <key>width5</key>
- <value>1</value>
- </param>
- <param>
- <key>color5</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style5</key>
- <value>0</value>
- </param>
- <param>
- <key>marker5</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha5</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label6</key>
- <value></value>
- </param>
- <param>
- <key>width6</key>
- <value>1</value>
- </param>
- <param>
- <key>color6</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style6</key>
- <value>0</value>
- </param>
- <param>
- <key>marker6</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha6</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label7</key>
- <value></value>
- </param>
- <param>
- <key>width7</key>
- <value>1</value>
- </param>
- <param>
- <key>color7</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style7</key>
- <value>0</value>
- </param>
- <param>
- <key>marker7</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha7</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label8</key>
- <value></value>
- </param>
- <param>
- <key>width8</key>
- <value>1</value>
- </param>
- <param>
- <key>color8</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style8</key>
- <value>0</value>
- </param>
- <param>
- <key>marker8</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha8</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label9</key>
- <value></value>
- </param>
- <param>
- <key>width9</key>
- <value>1</value>
- </param>
- <param>
- <key>color9</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style9</key>
- <value>0</value>
- </param>
- <param>
- <key>marker9</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha9</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label10</key>
- <value></value>
- </param>
- <param>
- <key>width10</key>
- <value>1</value>
- </param>
- <param>
- <key>color10</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style10</key>
- <value>0</value>
- </param>
- <param>
- <key>marker10</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha10</key>
- <value>1.0</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(603, 253)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>qtgui_number_sink</key>
- <param>
- <key>id</key>
- <value>qtgui_number_sink_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>name</key>
- <value>""</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>autoscale</key>
- <value>True</value>
- </param>
- <param>
- <key>avg</key>
- <value>0</value>
- </param>
- <param>
- <key>graph_type</key>
- <value>qtgui.NUM_GRAPH_HORIZ</value>
- </param>
- <param>
- <key>nconnections</key>
- <value>1</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>1</value>
- </param>
- <param>
- <key>update_time</key>
- <value>0.10</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value>1,0,1,1</value>
- </param>
- <param>
- <key>label1</key>
- <value>BER</value>
- </param>
- <param>
- <key>unit1</key>
- <value>x10^-6</value>
- </param>
- <param>
- <key>color1</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor1</key>
- <value>1e6</value>
- </param>
- <param>
- <key>label2</key>
- <value></value>
- </param>
- <param>
- <key>unit2</key>
- <value></value>
- </param>
- <param>
- <key>color2</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor2</key>
- <value>1</value>
- </param>
- <param>
- <key>label3</key>
- <value></value>
- </param>
- <param>
- <key>unit3</key>
- <value></value>
- </param>
- <param>
- <key>color3</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor3</key>
- <value>1</value>
- </param>
- <param>
- <key>label4</key>
- <value></value>
- </param>
- <param>
- <key>unit4</key>
- <value></value>
- </param>
- <param>
- <key>color4</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor4</key>
- <value>1</value>
- </param>
- <param>
- <key>label5</key>
- <value></value>
- </param>
- <param>
- <key>unit5</key>
- <value></value>
- </param>
- <param>
- <key>color5</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor5</key>
- <value>1</value>
- </param>
- <param>
- <key>label6</key>
- <value></value>
- </param>
- <param>
- <key>unit6</key>
- <value></value>
- </param>
- <param>
- <key>color6</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor6</key>
- <value>1</value>
- </param>
- <param>
- <key>label7</key>
- <value></value>
- </param>
- <param>
- <key>unit7</key>
- <value></value>
- </param>
- <param>
- <key>color7</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor7</key>
- <value>1</value>
- </param>
- <param>
- <key>label8</key>
- <value></value>
- </param>
- <param>
- <key>unit8</key>
- <value></value>
- </param>
- <param>
- <key>color8</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor8</key>
- <value>1</value>
- </param>
- <param>
- <key>label9</key>
- <value></value>
- </param>
- <param>
- <key>unit9</key>
- <value></value>
- </param>
- <param>
- <key>color9</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor9</key>
- <value>1</value>
- </param>
- <param>
- <key>label10</key>
- <value></value>
- </param>
- <param>
- <key>unit10</key>
- <value></value>
- </param>
- <param>
- <key>color10</key>
- <value>("black", "black")</value>
- </param>
- <param>
- <key>factor10</key>
- <value>1</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(940, 26)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <connection>
- <source_block_id>blocks_throttle</source_block_id>
- <sink_block_id>blks2_error_rate</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_chunks_to_symbols_xx</source_block_id>
- <sink_block_id>blocks_add_xx</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>analog_noise_source_x</source_block_id>
- <sink_block_id>blocks_add_xx</sink_block_id>
- <source_key>0</source_key>
- <sink_key>1</sink_key>
- </connection>
- <connection>
- <source_block_id>analog_random_source_x</source_block_id>
- <sink_block_id>blocks_throttle</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>analog_random_source_x</source_block_id>
- <sink_block_id>digital_chunks_to_symbols_xx</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_constellation_decoder_cb_0</source_block_id>
- <sink_block_id>blks2_error_rate</sink_block_id>
- <source_key>0</source_key>
- <sink_key>1</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_add_xx</source_block_id>
- <sink_block_id>digital_constellation_decoder_cb_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_add_xx</source_block_id>
- <sink_block_id>qtgui_const_sink_x_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_error_rate</source_block_id>
- <sink_block_id>qtgui_number_sink_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gr-digital/examples/demod/dpsk_loopback.grc b/gr-digital/examples/demod/dpsk_loopback.grc
deleted file mode 100644
index c0ad423a5b..0000000000
--- a/gr-digital/examples/demod/dpsk_loopback.grc
+++ /dev/null
@@ -1,878 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Tue Jul 8 23:26:29 2014</timestamp>
- <block>
- <key>blocks_throttle</key>
- <param>
- <key>id</key>
- <value>blocks_throttle_0_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>samples_per_second</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>ignoretag</key>
- <value>True</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(381, 51)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>10000</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(5, 115)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_packet_encoder</key>
- <param>
- <key>id</key>
- <value>blks2_packet_encoder_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>2</value>
- </param>
- <param>
- <key>bits_per_symbol</key>
- <value>1</value>
- </param>
- <param>
- <key>preamble</key>
- <value></value>
- </param>
- <param>
- <key>access_code</key>
- <value></value>
- </param>
- <param>
- <key>pad_for_usrp</key>
- <value>True</value>
- </param>
- <param>
- <key>payload_length</key>
- <value>0</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(598, 19)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>digital_dxpsk_mod</key>
- <param>
- <key>id</key>
- <value>digital_dxpsk_mod_1</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>dbpsk</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>2</value>
- </param>
- <param>
- <key>excess_bw</key>
- <value>0.35</value>
- </param>
- <param>
- <key>mod_code</key>
- <value>"gray"</value>
- </param>
- <param>
- <key>verbose</key>
- <value>False</value>
- </param>
- <param>
- <key>log</key>
- <value>False</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(806, 27)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>digital_dxpsk_demod</key>
- <param>
- <key>id</key>
- <value>digital_dxpsk_demod_1</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>dbpsk</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>2</value>
- </param>
- <param>
- <key>excess_bw</key>
- <value>0.35</value>
- </param>
- <param>
- <key>freq_bw</key>
- <value>6.28/100.0</value>
- </param>
- <param>
- <key>phase_bw</key>
- <value>6.28/100.0</value>
- </param>
- <param>
- <key>timing_bw</key>
- <value>6.28/100.0</value>
- </param>
- <param>
- <key>mod_code</key>
- <value>"gray"</value>
- </param>
- <param>
- <key>verbose</key>
- <value>False</value>
- </param>
- <param>
- <key>log</key>
- <value>False</value>
- </param>
- <param>
- <key>sync_out</key>
- <value>False</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(745, 139)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>180</value>
- </param>
- </block>
- <block>
- <key>blks2_packet_decoder</key>
- <param>
- <key>id</key>
- <value>blks2_packet_decoder_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>access_code</key>
- <value></value>
- </param>
- <param>
- <key>threshold</key>
- <value>-1</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(545, 187)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>180</value>
- </param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
- <param>
- <key>id</key>
- <value>qtgui_time_sink_x_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>name</key>
- <value>QT GUI Plot</value>
- </param>
- <param>
- <key>size</key>
- <value>1024</value>
- </param>
- <param>
- <key>srate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>autoscale</key>
- <value>False</value>
- </param>
- <param>
- <key>ymin</key>
- <value>-1.1</value>
- </param>
- <param>
- <key>ymax</key>
- <value>1.1</value>
- </param>
- <param>
- <key>nconnections</key>
- <value>1</value>
- </param>
- <param>
- <key>update_time</key>
- <value>0.10</value>
- </param>
- <param>
- <key>entags</key>
- <value>True</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>tr_mode</key>
- <value>qtgui.TRIG_MODE_FREE</value>
- </param>
- <param>
- <key>tr_slope</key>
- <value>qtgui.TRIG_SLOPE_POS</value>
- </param>
- <param>
- <key>tr_level</key>
- <value>0.0</value>
- </param>
- <param>
- <key>tr_delay</key>
- <value>0</value>
- </param>
- <param>
- <key>tr_chan</key>
- <value>0</value>
- </param>
- <param>
- <key>tr_tag</key>
- <value>""</value>
- </param>
- <param>
- <key>label1</key>
- <value></value>
- </param>
- <param>
- <key>width1</key>
- <value>1</value>
- </param>
- <param>
- <key>color1</key>
- <value>"blue"</value>
- </param>
- <param>
- <key>style1</key>
- <value>1</value>
- </param>
- <param>
- <key>marker1</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha1</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label2</key>
- <value></value>
- </param>
- <param>
- <key>width2</key>
- <value>1</value>
- </param>
- <param>
- <key>color2</key>
- <value>"red"</value>
- </param>
- <param>
- <key>style2</key>
- <value>1</value>
- </param>
- <param>
- <key>marker2</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha2</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label3</key>
- <value></value>
- </param>
- <param>
- <key>width3</key>
- <value>1</value>
- </param>
- <param>
- <key>color3</key>
- <value>"green"</value>
- </param>
- <param>
- <key>style3</key>
- <value>1</value>
- </param>
- <param>
- <key>marker3</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha3</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label4</key>
- <value></value>
- </param>
- <param>
- <key>width4</key>
- <value>1</value>
- </param>
- <param>
- <key>color4</key>
- <value>"black"</value>
- </param>
- <param>
- <key>style4</key>
- <value>1</value>
- </param>
- <param>
- <key>marker4</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha4</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label5</key>
- <value></value>
- </param>
- <param>
- <key>width5</key>
- <value>1</value>
- </param>
- <param>
- <key>color5</key>
- <value>"cyan"</value>
- </param>
- <param>
- <key>style5</key>
- <value>1</value>
- </param>
- <param>
- <key>marker5</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha5</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label6</key>
- <value></value>
- </param>
- <param>
- <key>width6</key>
- <value>1</value>
- </param>
- <param>
- <key>color6</key>
- <value>"magenta"</value>
- </param>
- <param>
- <key>style6</key>
- <value>1</value>
- </param>
- <param>
- <key>marker6</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha6</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label7</key>
- <value></value>
- </param>
- <param>
- <key>width7</key>
- <value>1</value>
- </param>
- <param>
- <key>color7</key>
- <value>"yellow"</value>
- </param>
- <param>
- <key>style7</key>
- <value>1</value>
- </param>
- <param>
- <key>marker7</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha7</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label8</key>
- <value></value>
- </param>
- <param>
- <key>width8</key>
- <value>1</value>
- </param>
- <param>
- <key>color8</key>
- <value>"dark red"</value>
- </param>
- <param>
- <key>style8</key>
- <value>1</value>
- </param>
- <param>
- <key>marker8</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha8</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label9</key>
- <value></value>
- </param>
- <param>
- <key>width9</key>
- <value>1</value>
- </param>
- <param>
- <key>color9</key>
- <value>"dark green"</value>
- </param>
- <param>
- <key>style9</key>
- <value>1</value>
- </param>
- <param>
- <key>marker9</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha9</key>
- <value>1.0</value>
- </param>
- <param>
- <key>label10</key>
- <value></value>
- </param>
- <param>
- <key>width10</key>
- <value>1</value>
- </param>
- <param>
- <key>color10</key>
- <value>"blue"</value>
- </param>
- <param>
- <key>style10</key>
- <value>1</value>
- </param>
- <param>
- <key>marker10</key>
- <value>-1</value>
- </param>
- <param>
- <key>alpha10</key>
- <value>1.0</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(249, 172)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>180</value>
- </param>
- </block>
- <block>
- <key>variable_qtgui_range</key>
- <param>
- <key>id</key>
- <value>freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value></value>
- </param>
- <param>
- <key>value</key>
- <value>500</value>
- </param>
- <param>
- <key>start</key>
- <value>0</value>
- </param>
- <param>
- <key>stop</key>
- <value>5000</value>
- </param>
- <param>
- <key>step</key>
- <value>1</value>
- </param>
- <param>
- <key>widget</key>
- <value>counter_slider</value>
- </param>
- <param>
- <key>orient</key>
- <value>Qt.Horizontal</value>
- </param>
- <param>
- <key>min_len</key>
- <value>200</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(0, 187)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>dpsk_loopback</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>DPSK Loopback</value>
- </param>
- <param>
- <key>author</key>
- <value>GNU Radio</value>
- </param>
- <param>
- <key>description</key>
- <value>Encode a signal into a packet, modulate, demodulate, decode and show it's the same data.</value>
- </param>
- <param>
- <key>window_size</key>
- <value>1280, 1024</value>
- </param>
- <param>
- <key>generate_options</key>
- <value>qt_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</value>
- </param>
- <param>
- <key>run_options</key>
- <value>prompt</value>
- </param>
- <param>
- <key>run</key>
- <value>True</value>
- </param>
- <param>
- <key>max_nouts</key>
- <value>0</value>
- </param>
- <param>
- <key>realtime_scheduling</key>
- <value></value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(0, -1)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>analog_sig_source_x</key>
- <param>
- <key>id</key>
- <value>analog_sig_source_x_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>waveform</key>
- <value>analog.GR_COS_WAVE</value>
- </param>
- <param>
- <key>freq</key>
- <value>freq</value>
- </param>
- <param>
- <key>amp</key>
- <value>1</value>
- </param>
- <param>
- <key>offset</key>
- <value>0</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
- <value></value>
- </param>
- <param>
- <key>minoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>maxoutbuf</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(188, 23)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <connection>
- <source_block_id>blks2_packet_encoder_0</source_block_id>
- <sink_block_id>digital_dxpsk_mod_1</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_dxpsk_mod_1</source_block_id>
- <sink_block_id>digital_dxpsk_demod_1</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_dxpsk_demod_1</source_block_id>
- <sink_block_id>blks2_packet_decoder_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_throttle_0_0</source_block_id>
- <sink_block_id>blks2_packet_encoder_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>analog_sig_source_x_0</source_block_id>
- <sink_block_id>blocks_throttle_0_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_packet_decoder_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gr-digital/examples/demod/gfsk_loopback.grc b/gr-digital/examples/demod/gfsk_loopback.grc
deleted file mode 100644
index b9a7a0725e..0000000000
--- a/gr-digital/examples/demod/gfsk_loopback.grc
+++ /dev/null
@@ -1,598 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Tue Nov 6 20:52:00 2012</timestamp>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>gfsk_loopback</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value></value>
- </param>
- <param>
- <key>author</key>
- <value></value>
- </param>
- <param>
- <key>description</key>
- <value></value>
- </param>
- <param>
- <key>window_size</key>
- <value>1280, 1024</value>
- </param>
- <param>
- <key>generate_options</key>
- <value>qt_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</value>
- </param>
- <param>
- <key>run_options</key>
- <value>prompt</value>
- </param>
- <param>
- <key>run</key>
- <value>True</value>
- </param>
- <param>
- <key>max_nouts</key>
- <value>0</value>
- </param>
- <param>
- <key>realtime_scheduling</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(10, 10)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>fm_sensitivity</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>1.0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(14, 273)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>sps</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(15, 338)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>32000</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(12, 76)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_qtgui_range</key>
- <param>
- <key>id</key>
- <value>freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value></value>
- </param>
- <param>
- <key>value</key>
- <value>500</value>
- </param>
- <param>
- <key>start</key>
- <value>0</value>
- </param>
- <param>
- <key>stop</key>
- <value>500</value>
- </param>
- <param>
- <key>step</key>
- <value>1</value>
- </param>
- <param>
- <key>widget</key>
- <value>counter_slider</value>
- </param>
- <param>
- <key>orient</key>
- <value>Qt.Horizontal</value>
- </param>
- <param>
- <key>min_len</key>
- <value>200</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(13, 152)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
- <param>
- <key>id</key>
- <value>qtgui_time_sink_x_1</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>name</key>
- <value></value>
- </param>
- <param>
- <key>size</key>
- <value>1024</value>
- </param>
- <param>
- <key>srate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>ymin</key>
- <value>-1</value>
- </param>
- <param>
- <key>ymax</key>
- <value>1</value>
- </param>
- <param>
- <key>nconnections</key>
- <value>1</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(906, 122)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_packet_encoder</key>
- <param>
- <key>id</key>
- <value>blks2_packet_encoder_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>sps</value>
- </param>
- <param>
- <key>bits_per_symbol</key>
- <value>1</value>
- </param>
- <param>
- <key>access_code</key>
- <value></value>
- </param>
- <param>
- <key>pad_for_usrp</key>
- <value>True</value>
- </param>
- <param>
- <key>payload_length</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(237, 261)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_packet_decoder</key>
- <param>
- <key>id</key>
- <value>blks2_packet_decoder_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>access_code</key>
- <value></value>
- </param>
- <param>
- <key>threshold</key>
- <value>-1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(720, 130)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blocks_throttle</key>
- <param>
- <key>id</key>
- <value>blocks_throttle_0_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>samples_per_second</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(413, 50)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>analog_sig_source_x</key>
- <param>
- <key>id</key>
- <value>analog_sig_source_x_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>waveform</key>
- <value>analog.GR_COS_WAVE</value>
- </param>
- <param>
- <key>freq</key>
- <value>freq</value>
- </param>
- <param>
- <key>amp</key>
- <value>1</value>
- </param>
- <param>
- <key>offset</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(214, 18)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>digital_gfsk_demod</key>
- <param>
- <key>id</key>
- <value>digital_gfsk_demod_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>sps</value>
- </param>
- <param>
- <key>sensitivity</key>
- <value>fm_sensitivity</value>
- </param>
- <param>
- <key>gain_mu</key>
- <value>0.175</value>
- </param>
- <param>
- <key>mu</key>
- <value>0.5</value>
- </param>
- <param>
- <key>omega_relative_limit</key>
- <value>0.005</value>
- </param>
- <param>
- <key>freq_error</key>
- <value>0.0</value>
- </param>
- <param>
- <key>verbose</key>
- <value>False</value>
- </param>
- <param>
- <key>log</key>
- <value>False</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(670, 253)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>digital_gfsk_mod</key>
- <param>
- <key>id</key>
- <value>digital_gfsk_mod_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>sps</value>
- </param>
- <param>
- <key>sensitivity</key>
- <value>fm_sensitivity</value>
- </param>
- <param>
- <key>bt</key>
- <value>0.35</value>
- </param>
- <param>
- <key>verbose</key>
- <value>False</value>
- </param>
- <param>
- <key>log</key>
- <value>False</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(456, 277)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
- <param>
- <key>id</key>
- <value>qtgui_time_sink_x_1_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>name</key>
- <value></value>
- </param>
- <param>
- <key>size</key>
- <value>1024</value>
- </param>
- <param>
- <key>srate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>ymin</key>
- <value>-1</value>
- </param>
- <param>
- <key>ymax</key>
- <value>1</value>
- </param>
- <param>
- <key>nconnections</key>
- <value>1</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(888, 386)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>analog_quadrature_demod_cf</key>
- <param>
- <key>id</key>
- <value>analog_quadrature_demod_cf_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>gain</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(673, 403)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <connection>
- <source_block_id>blks2_packet_encoder_0</source_block_id>
- <sink_block_id>digital_gfsk_mod_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blocks_throttle_0_0</source_block_id>
- <sink_block_id>blks2_packet_encoder_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_gfsk_demod_0</source_block_id>
- <sink_block_id>blks2_packet_decoder_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_gfsk_mod_0</source_block_id>
- <sink_block_id>digital_gfsk_demod_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_packet_decoder_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_1</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>analog_sig_source_x_0</source_block_id>
- <sink_block_id>blocks_throttle_0_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_gfsk_mod_0</source_block_id>
- <sink_block_id>analog_quadrature_demod_cf_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>analog_quadrature_demod_cf_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_1_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gr-digital/examples/demod/gmsk_loopback.grc b/gr-digital/examples/demod/gmsk_loopback.grc
deleted file mode 100644
index 7fb1a5f528..0000000000
--- a/gr-digital/examples/demod/gmsk_loopback.grc
+++ /dev/null
@@ -1,590 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Tue Nov 6 20:49:18 2012</timestamp>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>gfsk_loopback</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value></value>
- </param>
- <param>
- <key>author</key>
- <value></value>
- </param>
- <param>
- <key>description</key>
- <value></value>
- </param>
- <param>
- <key>window_size</key>
- <value>1280, 1024</value>
- </param>
- <param>
- <key>generate_options</key>
- <value>qt_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</value>
- </param>
- <param>
- <key>run_options</key>
- <value>prompt</value>
- </param>
- <param>
- <key>run</key>
- <value>True</value>
- </param>
- <param>
- <key>max_nouts</key>
- <value>0</value>
- </param>
- <param>
- <key>realtime_scheduling</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(10, 10)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>fm_sensitivity</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>1.0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(14, 273)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>sps</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(15, 338)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>32000</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(12, 76)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_qtgui_range</key>
- <param>
- <key>id</key>
- <value>freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value></value>
- </param>
- <param>
- <key>value</key>
- <value>500</value>
- </param>
- <param>
- <key>start</key>
- <value>0</value>
- </param>
- <param>
- <key>stop</key>
- <value>500</value>
- </param>
- <param>
- <key>step</key>
- <value>1</value>
- </param>
- <param>
- <key>widget</key>
- <value>counter_slider</value>
- </param>
- <param>
- <key>orient</key>
- <value>Qt.Horizontal</value>
- </param>
- <param>
- <key>min_len</key>
- <value>200</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(13, 152)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
- <param>
- <key>id</key>
- <value>qtgui_time_sink_x_1</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>name</key>
- <value></value>
- </param>
- <param>
- <key>size</key>
- <value>1024</value>
- </param>
- <param>
- <key>srate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>ymin</key>
- <value>-1</value>
- </param>
- <param>
- <key>ymax</key>
- <value>1</value>
- </param>
- <param>
- <key>nconnections</key>
- <value>1</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(906, 122)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_packet_encoder</key>
- <param>
- <key>id</key>
- <value>blks2_packet_encoder_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>sps</value>
- </param>
- <param>
- <key>bits_per_symbol</key>
- <value>1</value>
- </param>
- <param>
- <key>access_code</key>
- <value></value>
- </param>
- <param>
- <key>pad_for_usrp</key>
- <value>True</value>
- </param>
- <param>
- <key>payload_length</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(237, 261)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_packet_decoder</key>
- <param>
- <key>id</key>
- <value>blks2_packet_decoder_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>access_code</key>
- <value></value>
- </param>
- <param>
- <key>threshold</key>
- <value>-1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(720, 130)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>digital_gmsk_demod</key>
- <param>
- <key>id</key>
- <value>digital_gmsk_demod_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>2</value>
- </param>
- <param>
- <key>gain_mu</key>
- <value>0.175</value>
- </param>
- <param>
- <key>mu</key>
- <value>0.5</value>
- </param>
- <param>
- <key>omega_relative_limit</key>
- <value>0.005</value>
- </param>
- <param>
- <key>freq_error</key>
- <value>0.0</value>
- </param>
- <param>
- <key>verbose</key>
- <value>False</value>
- </param>
- <param>
- <key>log</key>
- <value>False</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(666, 261)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blocks_throttle</key>
- <param>
- <key>id</key>
- <value>blocks_throttle_0_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>samples_per_second</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(413, 50)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>analog_sig_source_x</key>
- <param>
- <key>id</key>
- <value>analog_sig_source_x_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>waveform</key>
- <value>analog.GR_COS_WAVE</value>
- </param>
- <param>
- <key>freq</key>
- <value>freq</value>
- </param>
- <param>
- <key>amp</key>
- <value>1</value>
- </param>
- <param>
- <key>offset</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(210, 18)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>qtgui_time_sink_x</key>
- <param>
- <key>id</key>
- <value>qtgui_time_sink_x_1_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>name</key>
- <value></value>
- </param>
- <param>
- <key>size</key>
- <value>1024</value>
- </param>
- <param>
- <key>srate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>ymin</key>
- <value>-1</value>
- </param>
- <param>
- <key>ymax</key>
- <value>1</value>
- </param>
- <param>
- <key>nconnections</key>
- <value>1</value>
- </param>
- <param>
- <key>gui_hint</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(888, 386)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>digital_gmsk_mod</key>
- <param>
- <key>id</key>
- <value>digital_gmsk_mod_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>2</value>
- </param>
- <param>
- <key>bt</key>
- <value>0.35</value>
- </param>
- <param>
- <key>verbose</key>
- <value>False</value>
- </param>
- <param>
- <key>log</key>
- <value>False</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(446, 285)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>analog_quadrature_demod_cf</key>
- <param>
- <key>id</key>
- <value>analog_quadrature_demod_cf_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>gain</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(675, 402)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <connection>
- <source_block_id>blocks_throttle_0_0</source_block_id>
- <sink_block_id>blks2_packet_encoder_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_packet_decoder_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_1</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_packet_encoder_0</source_block_id>
- <sink_block_id>digital_gmsk_mod_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_gmsk_mod_0</source_block_id>
- <sink_block_id>digital_gmsk_demod_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_gmsk_demod_0</source_block_id>
- <sink_block_id>blks2_packet_decoder_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>analog_sig_source_x_0</source_block_id>
- <sink_block_id>blocks_throttle_0_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>analog_quadrature_demod_cf_0</source_block_id>
- <sink_block_id>qtgui_time_sink_x_1_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>digital_gmsk_mod_0</source_block_id>
- <sink_block_id>analog_quadrature_demod_cf_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gr-digital/examples/example_costas.py b/gr-digital/examples/example_costas.py
index 9a65691ff6..77495d944c 100755
--- a/gr-digital/examples/example_costas.py
+++ b/gr-digital/examples/example_costas.py
@@ -24,8 +24,8 @@ from gnuradio import gr, digital, filter
from gnuradio import blocks
from gnuradio import channels
from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
import sys
try:
@@ -64,34 +64,34 @@ class example_costas(gr.top_block):
self.connect((self.cst,1), self.vsnk_frq)
def main():
- parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- parser.add_option("-N", "--nsamples", type="int", default=2000,
- help="Set the number of samples to process [default=%default]")
- parser.add_option("-S", "--sps", type="int", default=4,
- help="Set the samples per symbol [default=%default]")
- parser.add_option("-r", "--rolloff", type="eng_float", default=0.35,
- help="Set the rolloff factor [default=%default]")
- parser.add_option("-W", "--bandwidth", type="eng_float", default=2*scipy.pi/100.0,
- help="Set the loop bandwidth [default=%default]")
- parser.add_option("-n", "--ntaps", type="int", default=45,
- help="Set the number of taps in the filters [default=%default]")
- parser.add_option("", "--noise", type="eng_float", default=0.0,
- help="Set the simulation noise voltage [default=%default]")
- parser.add_option("-f", "--foffset", type="eng_float", default=0.0,
- help="Set the simulation's normalized frequency offset (in Hz) [default=%default]")
- parser.add_option("-t", "--toffset", type="eng_float", default=1.0,
- help="Set the simulation's timing offset [default=%default]")
- parser.add_option("-p", "--poffset", type="eng_float", default=0.707,
- help="Set the simulation's phase offset [default=%default]")
- (options, args) = parser.parse_args ()
+ parser = ArgumentParser(conflict_handler="resolve")
+ parser.add_argument("-N", "--nsamples", type=int, default=2000,
+ help="Set the number of samples to process [default=%(default)r]")
+ parser.add_argument("-S", "--sps", type=int, default=4,
+ help="Set the samples per symbol [default=%(default)r]")
+ parser.add_argument("-r", "--rolloff", type=eng_float, default=0.35,
+ help="Set the rolloff factor [default=%(default)r]")
+ parser.add_argument("-W", "--bandwidth", type=eng_float, default=2*scipy.pi/100.0,
+ help="Set the loop bandwidth [default=%(default)r]")
+ parser.add_argument("-n", "--ntaps", type=int, default=45,
+ help="Set the number of taps in the filters [default=%(default)r]")
+ parser.add_argument("--noise", type=eng_float, default=0.0,
+ help="Set the simulation noise voltage [default=%(default)r]")
+ parser.add_argument("-f", "--foffset", type=eng_float, default=0.0,
+ help="Set the simulation's normalized frequency offset (in Hz) [default=%(default)r]")
+ parser.add_argument("-t", "--toffset", type=eng_float, default=1.0,
+ help="Set the simulation's timing offset [default=%(default)r]")
+ parser.add_argument("-p", "--poffset", type=eng_float, default=0.707,
+ help="Set the simulation's phase offset [default=%(default)r]")
+ args = parser.parse_args()
# Adjust N for the interpolation by sps
- options.nsamples = options.nsamples // options.sps
+ args.nsamples = args.nsamples // args.sps
# Set up the program-under-test
- put = example_costas(options.nsamples, options.sps, options.rolloff,
- options.ntaps, options.bandwidth, options.noise,
- options.foffset, options.toffset, options.poffset)
+ put = example_costas(args.nsamples, args.sps, args.rolloff,
+ args.ntaps, args.bandwidth, args.noise,
+ args.foffset, args.toffset, args.poffset)
put.run()
data_src = scipy.array(put.vsnk_src.data())
diff --git a/gr-digital/examples/example_fll.py b/gr-digital/examples/example_fll.py
index 1c8234c786..cda92eaa78 100755
--- a/gr-digital/examples/example_fll.py
+++ b/gr-digital/examples/example_fll.py
@@ -24,8 +24,8 @@ from gnuradio import gr, digital, filter
from gnuradio import blocks
from gnuradio import channels
from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
import sys
try:
@@ -68,34 +68,34 @@ class example_fll(gr.top_block):
self.connect((self.fll,3), self.vsnk_err)
def main():
- parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- parser.add_option("-N", "--nsamples", type="int", default=2000,
- help="Set the number of samples to process [default=%default]")
- parser.add_option("-S", "--sps", type="int", default=4,
- help="Set the samples per symbol [default=%default]")
- parser.add_option("-r", "--rolloff", type="eng_float", default=0.35,
- help="Set the rolloff factor [default=%default]")
- parser.add_option("-W", "--bandwidth", type="eng_float", default=2*scipy.pi/100.0,
- help="Set the loop bandwidth [default=%default]")
- parser.add_option("-n", "--ntaps", type="int", default=45,
- help="Set the number of taps in the filters [default=%default]")
- parser.add_option("", "--noise", type="eng_float", default=0.0,
- help="Set the simulation noise voltage [default=%default]")
- parser.add_option("-f", "--foffset", type="eng_float", default=0.2,
- help="Set the simulation's normalized frequency offset (in Hz) [default=%default]")
- parser.add_option("-t", "--toffset", type="eng_float", default=1.0,
- help="Set the simulation's timing offset [default=%default]")
- parser.add_option("-p", "--poffset", type="eng_float", default=0.0,
- help="Set the simulation's phase offset [default=%default]")
- (options, args) = parser.parse_args ()
+ parser = ArgumentParser(conflict_handler="resolve")
+ parser.add_argument("-N", "--nsamples", type=int, default=2000,
+ help="Set the number of samples to process [default=%(default)r]")
+ parser.add_argument("-S", "--sps", type=int, default=4,
+ help="Set the samples per symbol [default=%(default)r]")
+ parser.add_argument("-r", "--rolloff", type=eng_float, default=0.35,
+ help="Set the rolloff factor [default=%(default)r]")
+ parser.add_argument("-W", "--bandwidth", type=eng_float, default=2*scipy.pi/100.0,
+ help="Set the loop bandwidth [default=%(default)r]")
+ parser.add_argument("-n", "--ntaps", type=int, default=45,
+ help="Set the number of taps in the filters [default=%(default)r]")
+ parser.add_argument("--noise", type=eng_float, default=0.0,
+ help="Set the simulation noise voltage [default=%(default)r]")
+ parser.add_argument("-f", "--foffset", type=eng_float, default=0.2,
+ help="Set the simulation's normalized frequency offset (in Hz) [default=%(default)r]")
+ parser.add_argument("-t", "--toffset", type=eng_float, default=1.0,
+ help="Set the simulation's timing offset [default=%(default)r]")
+ parser.add_argument("-p", "--poffset", type=eng_float, default=0.0,
+ help="Set the simulation's phase offset [default=%(default)r]")
+ args = parser.parse_args()
# Adjust N for the interpolation by sps
- options.nsamples = options.nsamples // options.sps
+ args.nsamples = args.nsamples // args.sps
# Set up the program-under-test
- put = example_fll(options.nsamples, options.sps, options.rolloff,
- options.ntaps, options.bandwidth, options.noise,
- options.foffset, options.toffset, options.poffset)
+ put = example_fll(args.nsamples, args.sps, args.rolloff,
+ args.ntaps, args.bandwidth, args.noise,
+ args.foffset, args.toffset, args.poffset)
put.run()
data_src = scipy.array(put.vsnk_src.data())
@@ -106,7 +106,7 @@ def main():
# adjust this to align with the data. There are 2 filters of
# ntaps long and the channel introduces another 4 sample delay.
- data_fll = scipy.array(put.vsnk_fll.data()[2*options.ntaps-4:])
+ data_fll = scipy.array(put.vsnk_fll.data()[2*args.ntaps-4:])
# Plot the FLL's LO frequency
f1 = pylab.figure(1, figsize=(12,10))
diff --git a/gr-digital/examples/example_timing.py b/gr-digital/examples/example_timing.py
index 94a4938f80..9e8e3e07b4 100755
--- a/gr-digital/examples/example_timing.py
+++ b/gr-digital/examples/example_timing.py
@@ -24,8 +24,8 @@ from gnuradio import gr, digital, filter
from gnuradio import blocks
from gnuradio import channels
from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
import sys
try:
@@ -102,40 +102,40 @@ class example_timing(gr.top_block):
def main():
- parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- parser.add_option("-N", "--nsamples", type="int", default=2000,
- help="Set the number of samples to process [default=%default]")
- parser.add_option("-S", "--sps", type="int", default=4,
- help="Set the samples per symbol [default=%default]")
- parser.add_option("-r", "--rolloff", type="eng_float", default=0.35,
- help="Set the rolloff factor [default=%default]")
- parser.add_option("-W", "--bandwidth", type="eng_float", default=2*scipy.pi/100.0,
- help="Set the loop bandwidth (PFB) or gain (M&M) [default=%default]")
- parser.add_option("-n", "--ntaps", type="int", default=45,
- help="Set the number of taps in the filters [default=%default]")
- parser.add_option("", "--noise", type="eng_float", default=0.0,
- help="Set the simulation noise voltage [default=%default]")
- parser.add_option("-f", "--foffset", type="eng_float", default=0.0,
- help="Set the simulation's normalized frequency offset (in Hz) [default=%default]")
- parser.add_option("-t", "--toffset", type="eng_float", default=1.0,
- help="Set the simulation's timing offset [default=%default]")
- parser.add_option("-p", "--poffset", type="eng_float", default=0.0,
- help="Set the simulation's phase offset [default=%default]")
- parser.add_option("-M", "--mode", type="int", default=0,
- help="Set the recovery mode (0: polyphase, 1: M&M) [default=%default]")
- (options, args) = parser.parse_args ()
+ parser = ArgumentParser(conflict_handler="resolve")
+ parser.add_argument("-N", "--nsamples", type=int, default=2000,
+ help="Set the number of samples to process [default=%(default)r]")
+ parser.add_argument("-S", "--sps", type=int, default=4,
+ help="Set the samples per symbol [default=%(default)r]")
+ parser.add_argument("-r", "--rolloff", type=eng_float, default=0.35,
+ help="Set the rolloff factor [default=%(default)r]")
+ parser.add_argument("-W", "--bandwidth", type=eng_float, default=2*scipy.pi/100.0,
+ help="Set the loop bandwidth (PFB) or gain (M&M) [default=%(default)r]")
+ parser.add_argument("-n", "--ntaps", type=int, default=45,
+ help="Set the number of taps in the filters [default=%(default)r]")
+ parser.add_argument("--noise", type=eng_float, default=0.0,
+ help="Set the simulation noise voltage [default=%(default)r]")
+ parser.add_argument("-f", "--foffset", type=eng_float, default=0.0,
+ help="Set the simulation's normalized frequency offset (in Hz) [default=%(default)r]")
+ parser.add_argument("-t", "--toffset", type=eng_float, default=1.0,
+ help="Set the simulation's timing offset [default=%(default)r]")
+ parser.add_argument("-p", "--poffset", type=eng_float, default=0.0,
+ help="Set the simulation's phase offset [default=%(default)r]")
+ parser.add_argument("-M", "--mode", type=int, default=0,
+ help="Set the recovery mode (0: polyphase, 1: M&M) [default=%(default)r]")
+ args = parser.parse_args()
# Adjust N for the interpolation by sps
- options.nsamples = options.nsamples // options.sps
+ args.nsamples = args.nsamples // args.sps
# Set up the program-under-test
- put = example_timing(options.nsamples, options.sps, options.rolloff,
- options.ntaps, options.bandwidth, options.noise,
- options.foffset, options.toffset, options.poffset,
- options.mode)
+ put = example_timing(args.nsamples, args.sps, args.rolloff,
+ args.ntaps, args.bandwidth, args.noise,
+ args.foffset, args.toffset, args.poffset,
+ args.mode)
put.run()
- if options.mode == 0:
+ if args.mode == 0:
data_src = scipy.array(put.vsnk_src.data()[20:])
data_clk = scipy.array(put.vsnk_clk.data()[20:])
diff --git a/gr-digital/examples/gen_whitener.py b/gr-digital/examples/gen_whitener.py
index 63616605ba..62345cee5d 100755
--- a/gr-digital/examples/gen_whitener.py
+++ b/gr-digital/examples/gen_whitener.py
@@ -22,8 +22,8 @@
from gnuradio import gr, gru
from gnuradio import blocks
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
import sys
class my_graph(gr.top_block):
@@ -31,12 +31,8 @@ class my_graph(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- (options, args) = parser.parse_args ()
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
+ parser = ArgumentParser()
+ args = parser.parse_args()
src = blocks.lfsr_32k_source_s()
head = blocks.head(gr.sizeof_short, 2048)
self.dst = blocks.vector_sink_s()
@@ -54,8 +50,7 @@ if __name__ == '__main__':
i = i+2
if i % 16 == 0:
f.write('\n')
-
+
except KeyboardInterrupt:
pass
-
-
+
diff --git a/gr-digital/examples/ofdm/benchmark_rx.py b/gr-digital/examples/ofdm/benchmark_rx.py
deleted file mode 100755
index fdf81176ac..0000000000
--- a/gr-digital/examples/ofdm/benchmark_rx.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006,2007,2011,2013 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 import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-
-from gnuradio import blocks
-from gnuradio import digital
-
-# from current dir
-from receive_path import receive_path
-from uhd_interface import uhd_receiver
-
-import struct, sys
-
-class my_top_block(gr.top_block):
- def __init__(self, callback, options):
- gr.top_block.__init__(self)
-
- if(options.rx_freq is not None):
- self.source = uhd_receiver(options.args,
- options.bandwidth, options.rx_freq,
- options.lo_offset, options.rx_gain,
- options.spec, options.antenna,
- options.clock_source, options.verbose)
- elif(options.from_file is not None):
- self.source = blocks.file_source(gr.sizeof_gr_complex, options.from_file)
- else:
- self.source = blocks.null_source(gr.sizeof_gr_complex)
-
- # Set up receive path
- # do this after for any adjustments to the options that may
- # occur in the sinks (specifically the UHD sink)
- self.rxpath = receive_path(callback, options)
-
- self.connect(self.source, self.rxpath)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# main
-# /////////////////////////////////////////////////////////////////////////////
-
-def main():
-
- global n_rcvd, n_right
-
- n_rcvd = 0
- n_right = 0
-
- def rx_callback(ok, payload):
- global n_rcvd, n_right
- n_rcvd += 1
- (pktno,) = struct.unpack('!H', payload[0:2])
- if ok:
- n_right += 1
- print "ok: %r \t pktno: %d \t n_rcvd: %d \t n_right: %d" % (ok, pktno, n_rcvd, n_right)
-
- if 0:
- printlst = list()
- for x in payload[2:]:
- t = hex(ord(x)).replace('0x', '')
- if(len(t) == 1):
- t = '0' + t
- printlst.append(t)
- printable = ''.join(printlst)
-
- print printable
- print "\n"
-
- parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
- parser.add_option("","--discontinuous", action="store_true", default=False,
- help="enable discontinuous")
- parser.add_option("","--from-file", default=None,
- help="input file of samples to demod")
-
- receive_path.add_options(parser, expert_grp)
- uhd_receiver.add_options(parser)
- digital.ofdm_demod.add_options(parser, expert_grp)
-
- (options, args) = parser.parse_args ()
-
- if options.from_file is None:
- if options.rx_freq is None:
- sys.stderr.write("You must specify -f FREQ or --freq FREQ\n")
- parser.print_help(sys.stderr)
- sys.exit(1)
-
- # build the graph
- tb = my_top_block(rx_callback, options)
-
- r = gr.enable_realtime_scheduling()
- if r != gr.RT_OK:
- print "Warning: failed to enable realtime scheduling"
-
- tb.start() # start flow graph
- tb.wait() # wait for it to finish
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/gr-digital/examples/ofdm/benchmark_tx.py b/gr-digital/examples/ofdm/benchmark_tx.py
deleted file mode 100755
index 47dc80964a..0000000000
--- a/gr-digital/examples/ofdm/benchmark_tx.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006,2011,2013 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 import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import time, struct, sys
-
-from gnuradio import digital
-from gnuradio import blocks
-
-# from current dir
-from transmit_path import transmit_path
-from uhd_interface import uhd_transmitter
-
-class my_top_block(gr.top_block):
- def __init__(self, options):
- gr.top_block.__init__(self)
-
- if(options.tx_freq is not None):
- self.sink = uhd_transmitter(options.args,
- options.bandwidth, options.tx_freq,
- options.lo_offset, options.tx_gain,
- options.spec, options.antenna,
- options.clock_source, options.verbose)
- elif(options.to_file is not None):
- self.sink = blocks.file_sink(gr.sizeof_gr_complex, options.to_file)
- else:
- self.sink = blocks.null_sink(gr.sizeof_gr_complex)
-
- # do this after for any adjustments to the options that may
- # occur in the sinks (specifically the UHD sink)
- self.txpath = transmit_path(options)
-
- self.connect(self.txpath, self.sink)
-
-# /////////////////////////////////////////////////////////////////////////////
-# main
-# /////////////////////////////////////////////////////////////////////////////
-
-def main():
-
- def send_pkt(payload='', eof=False):
- return tb.txpath.send_pkt(payload, eof)
-
- parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
- parser.add_option("-s", "--size", type="eng_float", default=400,
- help="set packet size [default=%default]")
- parser.add_option("-M", "--megabytes", type="eng_float", default=1.0,
- help="set megabytes to transmit [default=%default]")
- parser.add_option("","--discontinuous", action="store_true", default=False,
- help="enable discontinuous mode")
- parser.add_option("","--from-file", default=None,
- help="use intput file for packet contents")
- parser.add_option("","--to-file", default=None,
- help="Output file for modulated samples")
-
- transmit_path.add_options(parser, expert_grp)
- digital.ofdm_mod.add_options(parser, expert_grp)
- uhd_transmitter.add_options(parser)
-
- (options, args) = parser.parse_args ()
-
- # build the graph
- tb = my_top_block(options)
-
- r = gr.enable_realtime_scheduling()
- if r != gr.RT_OK:
- print "Warning: failed to enable realtime scheduling"
-
- tb.start() # start flow graph
-
- # generate and send packets
- nbytes = int(1e6 * options.megabytes)
- n = 0
- pktno = 0
- pkt_size = int(options.size)
-
- while n < nbytes:
- if options.from_file is None:
- data = (pkt_size - 2) * chr(pktno & 0xff)
- else:
- data = source_file.read(pkt_size - 2)
- if data == '':
- break;
-
- payload = struct.pack('!H', pktno & 0xffff) + data
- send_pkt(payload)
- n += len(payload)
- sys.stderr.write('.')
- if options.discontinuous and pktno % 5 == 4:
- time.sleep(1)
- pktno += 1
-
- send_pkt(eof=True)
- time.sleep(2) # allow time for queued packets to be sent
- tb.wait() # wait for it to finish
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/gr-digital/examples/ofdm/gr_plot_ofdm.py b/gr-digital/examples/ofdm/gr_plot_ofdm.py
deleted file mode 100755
index b248551482..0000000000
--- a/gr-digital/examples/ofdm/gr_plot_ofdm.py
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2007 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.
-#
-
-import math, struct, sys
-from optparse import OptionParser
-from math import log10
-
-try:
- import scipy
- from scipy import fftpack
-except ImportError:
- print "Error: Program requires scipy (see: www.scipy.org)."
- sys.exit(1)
-
-try:
- from pylab import *
- from matplotlib.font_manager import fontManager, FontProperties
-except ImportError:
- print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
- sys.exit(1)
-
-matplotlib.interactive(True)
-matplotlib.use('TkAgg')
-
-class draw_constellation:
- def __init__(self, options):
- derot_file = "ofdm_frame_sink_c.dat"
- acq_file = "ofdm_frame_acq_c.dat"
- fft_file = "ofdm_receiver-fft_out_c.dat"
-
- self.h_derot_file = open(derot_file, "r")
- self.h_acq_file = open(acq_file, "r")
- self.h_fft_file = open(fft_file, "r")
-
- self.occ_tones = options.occ_tones
- self.fft_size = options.fft_size
- self.symbol = options.start
- self.sample_rate = options.sample_rate
-
- self.axis_font_size = 16
- self.label_font_size = 18
- self.title_font_size = 20
- self.text_size = 22
-
- # Setup PLOT
- self.fig = figure(1, figsize=(14, 9), facecolor='w')
- rcParams['xtick.labelsize'] = self.axis_font_size
- rcParams['ytick.labelsize'] = self.axis_font_size
-
- self.text_sym = figtext(0.05, 0.95, ("Symbol: %s" % self.symbol), weight="heavy", size=self.text_size)
-
- self.make_plots()
-
- self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05], frameon=True)
- self.button_left = Button(self.button_left_axes, "<")
- self.button_left_callback = self.button_left.on_clicked(self.button_left_click)
-
- self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05], frameon=True)
- self.button_right = Button(self.button_right_axes, ">")
- self.button_right_callback = self.button_right.on_clicked(self.button_right_click)
-
- self.xlim = self.sp_eq.get_xlim()
-
- self.manager = get_current_fig_manager()
- #connect('draw_event', self.zoom)
- connect('key_press_event', self.click)
- show()
-
- def get_data(self):
- self.text_sym.set_text("Symbol: %d" % (self.symbol))
-
- derot_data = scipy.fromfile(self.h_derot_file, dtype=scipy.complex64, count=self.occ_tones)
- acq_data = scipy.fromfile(self.h_acq_file, dtype=scipy.complex64, count=self.occ_tones)
- fft_data = scipy.fromfile(self.h_fft_file, dtype=scipy.complex64, count=self.fft_size)
- if(len(acq_data) == 0):
- print "End of File"
- else:
- self.acq_data_reals = [r.real for r in acq_data]
- self.acq_data_imags = [i.imag for i in acq_data]
- self.derot_data_reals = [r.real for r in derot_data]
- self.derot_data_imags = [i.imag for i in derot_data]
-
- self.unequalized_angle = [math.atan2(x.imag, x.real) for x in fft_data]
- self.equalized_angle = [math.atan2(x.imag, x.real) for x in acq_data]
- self.derot_equalized_angle = [math.atan2(x.imag, x.real) for x in derot_data]
-
- self.time = [i*(1/self.sample_rate) for i in range(len(acq_data))]
- ffttime = [i*(1/self.sample_rate) for i in range(len(fft_data))]
-
- self.freq = self.get_freq(ffttime, self.sample_rate)
-
- for i in range(len(fft_data)):
- if(abs(fft_data[i]) == 0.0):
- fft_data[i] = complex(1e-6,1e-6)
- self.fft_data = [20*log10(abs(f)) for f in fft_data]
-
- def get_freq(self, time, sample_rate, T=1):
- N = len(time)
- Fs = 1.0 / (max(time) - min(time))
- Fn = 0.5 * sample_rate
- freq = [-Fn + i*Fs for i in range(N)]
- return freq
-
- def make_plots(self):
- self.h_acq_file.seek(8*self.symbol*self.occ_tones, 0)
- self.h_fft_file.seek(8*self.symbol*self.fft_size, 0)
- self.h_derot_file.seek(8*self.symbol*self.occ_tones, 0)
-
- self.get_data()
-
- # Subplot: constellation of rotated symbols
- self.sp_const = self.fig.add_subplot(4,1,1, position=[0.15, 0.55, 0.3, 0.35])
- self.sp_const.set_title(("Constellation"), fontsize=self.title_font_size, fontweight="bold")
- self.sp_const.set_xlabel("Inphase", fontsize=self.label_font_size, fontweight="bold")
- self.sp_const.set_ylabel("Qaudrature", fontsize=self.label_font_size, fontweight="bold")
- self.plot_const = plot(self.acq_data_reals, self.acq_data_imags, 'bo')
- self.plot_const += plot(self.derot_data_reals, self.derot_data_imags, 'ro')
- self.sp_const.axis([-2, 2, -2, 2])
-
- # Subplot: unequalized angle
- self.sp_uneq = self.fig.add_subplot(4,2,1, position=[0.575, 0.55, 0.3, 0.35])
- self.sp_uneq.set_title(("Unequalized Angle"), fontsize=self.title_font_size, fontweight="bold")
- self.sp_uneq.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold")
- self.sp_uneq.set_ylabel("Angle", fontsize=self.label_font_size, fontweight="bold")
- uneqscale = range(len(self.unequalized_angle))
- self.plot_uneq = plot(uneqscale, self.unequalized_angle, 'bo')
-
- # Subplot: equalized angle
- self.sp_eq = self.fig.add_subplot(4,1,2, position=[0.15, 0.1, 0.3, 0.35])
- self.sp_eq.set_title(("Equalized Angle"), fontsize=self.title_font_size, fontweight="bold")
- self.sp_eq.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold")
- self.sp_eq.set_ylabel("Angle", fontsize=self.label_font_size, fontweight="bold")
- eqscale = range(len(self.equalized_angle))
- self.plot_eq = plot(eqscale, self.equalized_angle, 'bo')
- self.plot_eq += plot(eqscale, self.derot_equalized_angle, 'ro', markersize=4)
-
- # Subplot: FFT
- self.sp_fft = self.fig.add_subplot(4,2,2, position=[0.575, 0.1, 0.3, 0.35])
- self.sp_fft.set_title(("FFT"), fontsize=self.title_font_size, fontweight="bold")
- self.sp_fft.set_xlabel("Frequency (MHz)", fontsize=self.label_font_size, fontweight="bold")
- self.sp_fft.set_ylabel("Power (dBm)", fontsize=self.label_font_size, fontweight="bold")
- self.plot_fft = plot(self.freq, self.fft_data, '-bo')
-
- draw()
-
- def update_plots(self):
- eqscale = range(len(self.equalized_angle))
- uneqscale = range(len(self.unequalized_angle))
- self.plot_eq[0].set_data([eqscale, self.equalized_angle])
- self.plot_eq[1].set_data([eqscale, self.derot_equalized_angle])
- self.plot_uneq[0].set_data([uneqscale, self.unequalized_angle])
- self.sp_eq.set_ylim([-4, 4])
- self.sp_uneq.set_ylim([-4, 4])
-
- #self.sp_iq.axis([min(self.time), max(self.time),
- # 1.5*min([min(self.acq_data_reals), min(self.acq_data_imags)]),
- # 1.5*max([max(self.acq_data_reals), max(self.acq_data_imags)])])
-
- self.plot_const[0].set_data([self.acq_data_reals, self.acq_data_imags])
- self.plot_const[1].set_data([self.derot_data_reals, self.derot_data_imags])
- self.sp_const.axis([-2, 2, -2, 2])
-
- self.plot_fft[0].set_data([self.freq, self.fft_data])
-
- draw()
-
- def zoom(self, event):
- newxlim = self.sp_eq.get_xlim()
- if(newxlim != self.xlim):
- self.xlim = newxlim
- r = self.reals[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))]
- i = self.imags[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))]
-
- self.plot_const[0].set_data(r, i)
- self.sp_const.axis([-2, 2, -2, 2])
- self.manager.canvas.draw()
- draw()
-
- def click(self, event):
- forward_valid_keys = [" ", "down", "right"]
- backward_valid_keys = ["up", "left"]
-
- if(find(event.key, forward_valid_keys)):
- self.step_forward()
-
- elif(find(event.key, backward_valid_keys)):
- self.step_backward()
-
- def button_left_click(self, event):
- self.step_backward()
-
- def button_right_click(self, event):
- self.step_forward()
-
- def step_forward(self):
- self.symbol += 1
- self.get_data()
- self.update_plots()
-
- def step_backward(self):
- # Step back in file position
- self.symbol -= 1
- if(self.h_acq_file.tell() >= 16*self.occ_tones):
- self.h_acq_file.seek(-16*self.occ_tones, 1)
- else:
- self.symbol = 0
- self.h_acq_file.seek(-self.h_acq_file.tell(),1)
-
-
- if(self.h_derot_file.tell() >= 16*self.occ_tones):
- self.h_derot_file.seek(-16*self.occ_tones, 1)
- else:
- self.symbol = 0
- self.h_derot_file.seek(-self.h_derot_file.tell(),1)
-
-
- if(self.h_fft_file.tell() >= 16*self.fft_size):
- self.h_fft_file.seek(-16*self.fft_size, 1)
- else:
- self.symbol = 0
- self.h_fft_file.seek(-self.h_fft_file.tell(),1)
-
- self.get_data()
- self.update_plots()
-
-
-
-#FIXME: there must be a way to do this with a Python builtin
-def find(item_in, list_search):
- for l in list_search:
- if item_in == l:
- return True
- return False
-
-def main():
- usage="%prog: [options]"
-
- parser = OptionParser(conflict_handler="resolve", usage=usage)
- parser.add_option("", "--fft-size", type="int", default=512,
- help="Specify the size of the FFT [default=%default]")
- parser.add_option("", "--occ-tones", type="int", default=200,
- help="Specify the number of occupied tones [default=%default]")
- parser.add_option("-s", "--start", type="int", default=0,
- help="Specify the starting symbol to plot [default=%default]")
- parser.add_option("-R", "--sample-rate", type="float", default=1.0,
- help="Set the sampler rate of the data [default=%default]")
-
- (options, args) = parser.parse_args ()
-
- dc = draw_constellation(options)
-
-if __name__ == "__main__":
- try:
- main()
- except KeyboardInterrupt:
- pass
-
-
-
diff --git a/gr-digital/examples/ofdm/tunnel.py b/gr-digital/examples/ofdm/tunnel.py
deleted file mode 100755
index 17b31db9af..0000000000
--- a/gr-digital/examples/ofdm/tunnel.py
+++ /dev/null
@@ -1,271 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006,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 2, 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.
-#
-
-
-# /////////////////////////////////////////////////////////////////////////////
-#
-# This code sets up up a virtual ethernet interface (typically gr0),
-# and relays packets between the interface and the GNU Radio PHY+MAC
-#
-# What this means in plain language, is that if you've got a couple
-# of USRPs on different machines, and if you run this code on those
-# machines, you can talk between them using normal TCP/IP networking.
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-
-from gnuradio import gr, digital
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-
-# from current dir
-from receive_path import receive_path
-from transmit_path import transmit_path
-from uhd_interface import uhd_transmitter
-from uhd_interface import uhd_receiver
-
-import os, sys
-import random, time, struct
-
-#print os.getpid()
-#raw_input('Attach and press enter')
-
-
-# /////////////////////////////////////////////////////////////////////////////
-#
-# Use the Universal TUN/TAP device driver to move packets to/from kernel
-#
-# See /usr/src/linux/Documentation/networking/tuntap.txt
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-# Linux specific...
-# TUNSETIFF ifr flags from <linux/tun_if.h>
-
-IFF_TUN = 0x0001 # tunnel IP packets
-IFF_TAP = 0x0002 # tunnel ethernet frames
-IFF_NO_PI = 0x1000 # don't pass extra packet info
-IFF_ONE_QUEUE = 0x2000 # beats me ;)
-
-def open_tun_interface(tun_device_filename):
- from fcntl import ioctl
-
- mode = IFF_TAP | IFF_NO_PI
- TUNSETIFF = 0x400454ca
-
- tun = os.open(tun_device_filename, os.O_RDWR)
- ifs = ioctl(tun, TUNSETIFF, struct.pack("16sH", "gr%d", mode))
- ifname = ifs[:16].strip("\x00")
- return (tun, ifname)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# the flow graph
-# /////////////////////////////////////////////////////////////////////////////
-
-class my_top_block(gr.top_block):
- def __init__(self, callback, options):
- gr.top_block.__init__(self)
-
- self.source = uhd_receiver(options.args,
- options.bandwidth,
- options.rx_freq,
- options.lo_offset, options.rx_gain,
- options.spec, options.antenna,
- options.clock_source, options.verbose)
-
- self.sink = uhd_transmitter(options.args,
- options.bandwidth, options.tx_freq,
- options.lo_offset, options.tx_gain,
- options.spec, options.antenna,
- options.clock_source, options.verbose)
-
- self.txpath = transmit_path(options)
- self.rxpath = receive_path(callback, options)
-
- self.connect(self.txpath, self.sink)
- self.connect(self.source, self.rxpath)
-
- def carrier_sensed(self):
- """
- Return True if the receive path thinks there's carrier
- """
- return self.rxpath.carrier_sensed()
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
- """
- self.u_snk.set_freq(target_freq)
- self.u_src.set_freq(target_freq)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# Carrier Sense MAC
-# /////////////////////////////////////////////////////////////////////////////
-
-class cs_mac(object):
- """
- Prototype carrier sense MAC
-
- Reads packets from the TUN/TAP interface, and sends them to the PHY.
- Receives packets from the PHY via phy_rx_callback, and sends them
- into the TUN/TAP interface.
-
- Of course, we're not restricted to getting packets via TUN/TAP, this
- is just an example.
- """
- def __init__(self, tun_fd, verbose=False):
- self.tun_fd = tun_fd # file descriptor for TUN/TAP interface
- self.verbose = verbose
- self.tb = None # top block (access to PHY)
-
- def set_flow_graph(self, tb):
- self.tb = tb
-
- def phy_rx_callback(self, ok, payload):
- """
- Invoked by thread associated with PHY to pass received packet up.
-
- Args:
- ok: bool indicating whether payload CRC was OK
- payload: contents of the packet (string)
- """
- if self.verbose:
- print "Rx: ok = %r len(payload) = %4d" % (ok, len(payload))
- if ok:
- os.write(self.tun_fd, payload)
-
- def main_loop(self):
- """
- Main loop for MAC.
- Only returns if we get an error reading from TUN.
-
- FIXME: may want to check for EINTR and EAGAIN and reissue read
- """
- min_delay = 0.001 # seconds
-
- while 1:
- payload = os.read(self.tun_fd, 10*1024)
- if not payload:
- self.tb.txpath.send_pkt(eof=True)
- break
-
- if self.verbose:
- print "Tx: len(payload) = %4d" % (len(payload),)
-
- delay = min_delay
- while self.tb.carrier_sensed():
- sys.stderr.write('B')
- time.sleep(delay)
- if delay < 0.050:
- delay = delay * 2 # exponential back-off
-
- self.tb.txpath.send_pkt(payload)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# main
-# /////////////////////////////////////////////////////////////////////////////
-
-def main():
-
- parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
-
- parser.add_option("-m", "--modulation", type="choice", choices=['bpsk', 'qpsk'],
- default='bpsk',
- help="Select modulation from: bpsk, qpsk [default=%%default]")
-
- parser.add_option("-v","--verbose", action="store_true", default=False)
- expert_grp.add_option("-c", "--carrier-threshold", type="eng_float", default=30,
- help="set carrier detect threshold (dB) [default=%default]")
- expert_grp.add_option("","--tun-device-filename", default="/dev/net/tun",
- help="path to tun device file [default=%default]")
-
- digital.ofdm_mod.add_options(parser, expert_grp)
- digital.ofdm_demod.add_options(parser, expert_grp)
- transmit_path.add_options(parser, expert_grp)
- receive_path.add_options(parser, expert_grp)
- uhd_receiver.add_options(parser)
- uhd_transmitter.add_options(parser)
-
- (options, args) = parser.parse_args ()
- if len(args) != 0:
- parser.print_help(sys.stderr)
- sys.exit(1)
-
- if options.rx_freq is None or options.tx_freq is None:
- sys.stderr.write("You must specify -f FREQ or --freq FREQ\n")
- parser.print_help(sys.stderr)
- sys.exit(1)
-
- # open the TUN/TAP interface
- (tun_fd, tun_ifname) = open_tun_interface(options.tun_device_filename)
-
- # Attempt to enable realtime scheduling
- r = gr.enable_realtime_scheduling()
- if r == gr.RT_OK:
- realtime = True
- else:
- realtime = False
- print "Note: failed to enable realtime scheduling"
-
- # instantiate the MAC
- mac = cs_mac(tun_fd, verbose=True)
-
-
- # build the graph (PHY)
- tb = my_top_block(mac.phy_rx_callback, options)
-
- mac.set_flow_graph(tb) # give the MAC a handle for the PHY
-
- print "modulation: %s" % (options.modulation,)
- print "freq: %s" % (eng_notation.num_to_str(options.tx_freq))
-
- tb.rxpath.set_carrier_threshold(options.carrier_threshold)
- print "Carrier sense threshold:", options.carrier_threshold, "dB"
-
- print
- print "Allocated virtual ethernet interface: %s" % (tun_ifname,)
- print "You must now use ifconfig to set its IP address. E.g.,"
- print
- print " $ sudo ifconfig %s 192.168.200.1" % (tun_ifname,)
- print
- print "Be sure to use a different address in the same subnet for each machine."
- print
-
-
- tb.start() # Start executing the flow graph (runs in separate threads)
-
- mac.main_loop() # don't expect this to return...
-
- tb.stop() # but if it does, tell flow graph to stop.
- tb.wait() # wait for it to finish
-
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/gr-digital/grc/blks2_packet_decoder.xml b/gr-digital/grc/blks2_packet_decoder.xml
deleted file mode 100644
index fedb2e74f3..0000000000
--- a/gr-digital/grc/blks2_packet_decoder.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Packet Decoder
-###################################################
- -->
-<block>
- <name>Packet Decoder</name>
- <key>blks2_packet_decoder</key>
- <category>[Core]/Deprecated</category>
- <flags>deprecated</flags>
- <import>from grc_gnuradio import blks2 as grc_blks2</import>
- <make>grc_blks2.packet_demod_$(type.fcn)(grc_blks2.packet_decoder(
- access_code=$access_code,
- threshold=$threshold,
- callback=lambda ok, payload: self.$(id).recv_pkt(ok, payload),
- ),
-)</make>
- <param>
- <name>Output Type</name>
- <key>type</key>
- <value>float</value>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>fcn:c</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:f</opt>
- </option>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>fcn:i</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>fcn:s</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>fcn:b</opt>
- </option>
- </param>
- <param>
- <name>Access Code</name>
- <key>access_code</key>
- <value></value>
- <type>string</type>
- </param>
- <param>
- <name>Threshold</name>
- <key>threshold</key>
- <value>-1</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>$type</type>
- </source>
- <doc>
-Packet decoder block, for use with the gnuradio demodulator blocks: gmsk, psk, qam.
-
-Access Code: string of 1's and 0's, leave blank for automatic.
-
-Threshold: -1 for automatic.
- </doc>
-</block>
diff --git a/gr-digital/grc/blks2_packet_encoder.xml b/gr-digital/grc/blks2_packet_encoder.xml
deleted file mode 100644
index d030f6ae22..0000000000
--- a/gr-digital/grc/blks2_packet_encoder.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Packet Encoder
-###################################################
- -->
-<block>
- <name>Packet Encoder</name>
- <key>blks2_packet_encoder</key>
- <category>[Core]/Deprecated</category>
- <flags>deprecated</flags>
- <import>from grc_gnuradio import blks2 as grc_blks2</import>
- <make>grc_blks2.packet_mod_$(type.fcn)(grc_blks2.packet_encoder(
- samples_per_symbol=$samples_per_symbol,
- bits_per_symbol=$bits_per_symbol,
- preamble=$preamble,
- access_code=$access_code,
- pad_for_usrp=$pad_for_usrp,
- ),
- payload_length=$payload_length,
-)</make>
- <param>
- <name>Input Type</name>
- <key>type</key>
- <value>float</value>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>fcn:c</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:f</opt>
- </option>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>fcn:i</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>fcn:s</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>fcn:b</opt>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <type>int</type>
- </param>
- <param>
- <name>Bits/Symbol</name>
- <key>bits_per_symbol</key>
- <type>int</type>
- </param>
- <param>
- <name>Preamble</name>
- <key>preamble</key>
- <value></value>
- <type>string</type>
- </param>
- <param>
- <name>Access Code</name>
- <key>access_code</key>
- <value></value>
- <type>string</type>
- </param>
- <param>
- <name>Pad for USRP</name>
- <key>pad_for_usrp</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Payload Length</name>
- <key>payload_length</key>
- <value>0</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>$type</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
- <doc>
-Packet encoder block, for use with the gnuradio modulator blocks: gmsk, dpsk, qam.
-
-Preamble: string of 1's and 0's, leave blank for automatic.
-
-Access Code: string of 1's and 0's, leave blank for automatic.
-
-Payload Length: 0 for automatic.
-
-Bits/Symbol should be set accordingly:
- gmsk -> 1
- dbpsk -> 1
- dqpsk -> 2
- d8psk -> 3
- qam8 -> 3
- qam16 -> 4
- qam64 -> 6
- qam256 -> 8
- </doc>
-</block>
diff --git a/gr-digital/grc/digital_block_tree.xml b/gr-digital/grc/digital_block_tree.xml
index 9443525f03..88da4b7621 100644
--- a/gr-digital/grc/digital_block_tree.xml
+++ b/gr-digital/grc/digital_block_tree.xml
@@ -48,17 +48,11 @@
<cat>
<name>Modulators</name>
<block>digital_cpmmod_bc</block>
- <block>digital_dxpsk_mod</block>
- <block>digital_dxpsk_demod</block>
<block>digital_gfsk_mod</block>
<block>digital_gfsk_demod</block>
<block>digital_gmskmod_bc</block>
<block>digital_gmsk_mod</block>
<block>digital_gmsk_demod</block>
- <block>digital_psk_mod</block>
- <block>digital_psk_demod</block>
- <block>digital_qam_mod</block>
- <block>digital_qam_demod</block>
<block>digital_constellation_modulator</block>
<block>digital_constellation_receiver_cb</block>
<block>variable_constellation</block>
@@ -122,7 +116,6 @@
<block>digital_clock_recovery_mm_xx</block>
<block>digital_costas_loop_cc</block>
<block>digital_fll_band_edge_cc</block>
- <block>digital_mpsk_receiver_cc</block>
<block>digital_pfb_clock_sync_xxx</block>
<block>digital_pn_correlator_cc</block>
<block>digital_corr_est_cc</block>
diff --git a/gr-digital/grc/digital_dxpsk_demod.xml b/gr-digital/grc/digital_dxpsk_demod.xml
index 5b26d5b8ec..12089ad771 100644
--- a/gr-digital/grc/digital_dxpsk_demod.xml
+++ b/gr-digital/grc/digital_dxpsk_demod.xml
@@ -29,6 +29,7 @@
<block>
<name>DPSK Demod</name>
<key>digital_dxpsk_demod</key>
+ <category>[Core]/Deprecated</category>
<import>from gnuradio import digital</import>
<make>digital.$(type)_demod(
samples_per_symbol=$samples_per_symbol,
diff --git a/gr-digital/grc/digital_dxpsk_mod.xml b/gr-digital/grc/digital_dxpsk_mod.xml
index 02da10028e..4198b8805c 100644
--- a/gr-digital/grc/digital_dxpsk_mod.xml
+++ b/gr-digital/grc/digital_dxpsk_mod.xml
@@ -29,6 +29,7 @@
<block>
<name>DPSK Mod</name>
<key>digital_dxpsk_mod</key>
+ <category>[Core]/Deprecated</category>
<import>from gnuradio import digital</import>
<make>digital.$(type)_mod(
samples_per_symbol=$samples_per_symbol,
diff --git a/gr-digital/grc/digital_mpsk_receiver_cc.xml b/gr-digital/grc/digital_mpsk_receiver_cc.xml
deleted file mode 100644
index a9b66b7a19..0000000000
--- a/gr-digital/grc/digital_mpsk_receiver_cc.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##MPSK Receiver
-###################################################
- -->
-<block>
- <name>MPSK Receiver</name>
- <key>digital_mpsk_receiver_cc</key>
- <import>from gnuradio import digital;import cmath</import>
- <make>digital.mpsk_receiver_cc($M, $theta, $w, $fmin, $fmax, $mu, $gain_mu, $omega, $gain_omega, $omega_relative_limit)</make>
- <callback>set_loop_bandwidth($w)</callback>
- <callback>set_mu($mu)</callback>
- <callback>set_gain_mu($gain_mu)</callback>
- <callback>set_omega($omega)</callback>
- <callback>set_gain_omega($gain_omega)</callback>
- <param>
- <name>M</name>
- <key>M</key>
- <value>4</value>
- <type>int</type>
- </param>
- <param>
- <name>Theta</name>
- <key>theta</key>
- <value>0</value>
- <type>real</type>
- </param>
- <param>
- <name>Loop Bandwidth</name>
- <key>w</key>
- <value>cmath.pi/100.0</value>
- <type>real</type>
- </param>
- <param>
- <name>Min Freq</name>
- <key>fmin</key>
- <value>-0.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Max Freq</name>
- <key>fmax</key>
- <value>0.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Mu</name>
- <key>mu</key>
- <value>0.25</value>
- <type>real</type>
- </param>
- <param>
- <name>Gain Mu</name>
- <key>gain_mu</key>
- <value>0.01</value>
- <type>real</type>
- </param>
- <param>
- <name>Omega</name>
- <key>omega</key>
- <value>2</value>
- <type>real</type>
- </param>
- <param>
- <name>Gain Omega</name>
- <key>gain_omega</key>
- <value>0.001</value>
- <type>real</type>
- </param>
- <param>
- <name>Omega Relative Limit</name>
- <key>omega_relative_limit</key>
- <value>0.001</value>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-
-</block>
diff --git a/gr-digital/grc/digital_ofdm_demod.xml b/gr-digital/grc/digital_ofdm_demod.xml
deleted file mode 100644
index 9f3a837157..0000000000
--- a/gr-digital/grc/digital_ofdm_demod.xml
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-
-<!--
-###################################################
-##OFDM Demod
-###################################################
- -->
-<block>
- <name>OFDM Demod</name>
- <key>digital_ofdm_demod</key>
- <import>from grc_gnuradio import blks2 as grc_blks2</import>
- <import>from gnuradio import digital</import>
- <make>grc_blks2.packet_demod_$(type.fcn)(digital.ofdm_demod(
- options=grc_blks2.options(
- modulation="$modulation",
- fft_length=$fft_length,
- occupied_tones=$occupied_tones,
- cp_length=$cp_length,
- snr=$snr,
- log=None,
- verbose=None,
- ),
- callback=lambda ok, payload: self.$(id).recv_pkt(ok, payload),
- ),
-)</make>
- <param>
- <name>Output Type</name>
- <key>type</key>
- <value>float</value>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>fcn:c</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:f</opt>
- </option>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>fcn:i</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>fcn:s</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>fcn:b</opt>
- </option>
- </param>
- <param>
- <name>Modulation</name>
- <key>modulation</key>
- <type>enum</type>
- <option>
- <name>BPSK</name>
- <key>bpsk</key>
- </option>
- <option>
- <name>QPSK</name>
- <key>qpsk</key>
- </option>
- <option>
- <name>8PSK</name>
- <key>8psk</key>
- </option>
- <option>
- <name>QAM8</name>
- <key>qam8</key>
- </option>
- <option>
- <name>QAM16</name>
- <key>qam16</key>
- </option>
- <option>
- <name>QAM64</name>
- <key>qam64</key>
- </option>
- <option>
- <name>QAM256</name>
- <key>qam256</key>
- </option>
- </param>
- <param>
- <name>FFT Length</name>
- <key>fft_length</key>
- <value>512</value>
- <type>int</type>
- </param>
- <param>
- <name>Occupied Tones</name>
- <key>occupied_tones</key>
- <value>200</value>
- <type>int</type>
- </param>
- <param>
- <name>Cyclic Prefix Length</name>
- <key>cp_length</key>
- <value>128</value>
- <type>int</type>
- </param>
- <param>
- <name>SNR</name>
- <key>snr</key>
- <value>10</value>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>$type</type>
- </source>
- <doc>Payload Length: 0 for automatic.</doc>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_frame_acquisition.xml b/gr-digital/grc/digital_ofdm_frame_acquisition.xml
deleted file mode 100644
index 2545f18e66..0000000000
--- a/gr-digital/grc/digital_ofdm_frame_acquisition.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-
-<!--
-###################################################
-##OFDM Frame Acquisition
-###################################################
- -->
-<block>
- <name>OFDM Frame Acquisition</name>
- <key>digital_ofdm_frame_acquisition</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_frame_acquisition($occupied_carriers, $fft_length, $cplen, $known_symbol, $max_fft_shift_len)</make>
- <param>
- <name>Occupied Carriers</name>
- <key>occupied_carriers</key>
- <type>int</type>
- </param>
- <param>
- <name>FFT Length</name>
- <key>fft_length</key>
- <type>int</type>
- </param>
- <param>
- <name>CP Length</name>
- <key>cplen</key>
- <type>int</type>
- </param>
- <param>
- <name>Preamble</name>
- <key>known_symbol</key>
- <type>complex_vector</type>
- </param>
- <param>
- <name>Max FFT Shift</name>
- <key>max_fft_shift_len</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- <vlen>$fft_length</vlen>
- </sink>
- <sink>
- <name>flag</name>
- <type>byte</type>
- <vlen>$fft_length</vlen>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- <vlen>$occupied_carriers</vlen>
- </source>
- <source>
- <name>flag</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_frame_sink.xml b/gr-digital/grc/digital_ofdm_frame_sink.xml
deleted file mode 100644
index 64c69ec0ad..0000000000
--- a/gr-digital/grc/digital_ofdm_frame_sink.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-
-<!--
-###################################################
-##OFDM Frame Sink
-###################################################
- -->
-<block>
- <name>OFDM Frame Sink</name>
- <key>digital_ofdm_frame_sink</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_frame_sink($syms, $vals, $queue, $occ_tones, $ph_gain, $frq_gain)</make>
- <param>
- <name>Symbol Points</name>
- <key>syms</key>
- <type>complex_vector</type>
- </param>
- <param>
- <name>Symbol Values</name>
- <key>vals</key>
- <type>int_vector</type>
- </param>
- <param>
- <name>Message Queue</name>
- <key>queue</key>
- <type>raw</type>
- </param>
- <param>
- <name>Occupied Tones</name>
- <key>occ_tones</key>
- <type>int</type>
- </param>
- <param>
- <name>Phase Gain</name>
- <key>ph_gain</key>
- <value>0.25</value>
- <type>real</type>
- </param>
- <param>
- <name>Freq. Gain</name>
- <key>frq_gain</key>
- <value>0.015625</value>
- <type>real</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- <vlen>$occ_tones</vlen>
- </sink>
- <sink>
- <name>flag</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- <vlen>$occ_tones</vlen>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_insert_preamble.xml b/gr-digital/grc/digital_ofdm_insert_preamble.xml
deleted file mode 100644
index 9ad8fa793b..0000000000
--- a/gr-digital/grc/digital_ofdm_insert_preamble.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-
-<!--
-###################################################
-##OFDM Insert Preamble
-###################################################
- -->
-<block>
- <name>OFDM Insert Preamble</name>
- <key>digital_ofdm_insert_preamble</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_insert_preamble($fft_length, $preamble)</make>
- <param>
- <name>FFT Length</name>
- <key>fft_length</key>
- <type>int</type>
- </param>
- <param>
- <name>Preamble</name>
- <key>preamble</key>
- <type>raw</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- <vlen>$fft_length</vlen>
- </sink>
- <sink>
- <name>flag</name>
- <type>byte</type>
- <optional>1</optional>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- <vlen>$fft_length</vlen>
- </source>
- <source>
- <name>flag</name>
- <type>byte</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_mod.xml b/gr-digital/grc/digital_ofdm_mod.xml
deleted file mode 100644
index 24cb2aa33c..0000000000
--- a/gr-digital/grc/digital_ofdm_mod.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-
-<!--
-###################################################
-##OFDM Mod
-###################################################
- -->
-<block>
- <name>OFDM Mod</name>
- <key>digital_ofdm_mod</key>
- <import>from grc_gnuradio import blks2 as grc_blks2</import>
- <import>from gnuradio import digital</import>
- <make>grc_blks2.packet_mod_$(type.fcn)(digital.ofdm_mod(
- options=grc_blks2.options(
- modulation="$modulation",
- fft_length=$fft_length,
- occupied_tones=$occupied_tones,
- cp_length=$cp_length,
- pad_for_usrp=$pad_for_usrp,
- log=None,
- verbose=None,
- ),
- ),
- payload_length=$payload_length,
-)</make>
- <param>
- <name>Input Type</name>
- <key>type</key>
- <value>float</value>
- <type>enum</type>
- <option>
- <name>Complex</name>
- <key>complex</key>
- <opt>fcn:c</opt>
- </option>
- <option>
- <name>Float</name>
- <key>float</key>
- <opt>fcn:f</opt>
- </option>
- <option>
- <name>Int</name>
- <key>int</key>
- <opt>fcn:i</opt>
- </option>
- <option>
- <name>Short</name>
- <key>short</key>
- <opt>fcn:s</opt>
- </option>
- <option>
- <name>Byte</name>
- <key>byte</key>
- <opt>fcn:b</opt>
- </option>
- </param>
- <param>
- <name>Modulation</name>
- <key>modulation</key>
- <type>enum</type>
- <option>
- <name>BPSK</name>
- <key>bpsk</key>
- </option>
- <option>
- <name>QPSK</name>
- <key>qpsk</key>
- </option>
- <option>
- <name>8PSK</name>
- <key>8psk</key>
- </option>
- <option>
- <name>QAM8</name>
- <key>qam8</key>
- </option>
- <option>
- <name>QAM16</name>
- <key>qam16</key>
- </option>
- <option>
- <name>QAM64</name>
- <key>qam64</key>
- </option>
- <option>
- <name>QAM256</name>
- <key>qam256</key>
- </option>
- </param>
- <param>
- <name>FFT Length</name>
- <key>fft_length</key>
- <value>512</value>
- <type>int</type>
- </param>
- <param>
- <name>Occupied Tones</name>
- <key>occupied_tones</key>
- <value>200</value>
- <type>int</type>
- </param>
- <param>
- <name>Cyclic Prefix Length</name>
- <key>cp_length</key>
- <value>128</value>
- <type>int</type>
- </param>
- <param>
- <name>Pad for USRP</name>
- <key>pad_for_usrp</key>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Payload Length</name>
- <key>payload_length</key>
- <value>0</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>$type</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
- <doc>Payload Length: 0 for automatic.</doc>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_sampler.xml b/gr-digital/grc/digital_ofdm_sampler.xml
deleted file mode 100644
index f3d5c85f39..0000000000
--- a/gr-digital/grc/digital_ofdm_sampler.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-
-<!--
-###################################################
-##OFDM Sampler
-###################################################
- -->
-<block>
- <name>OFDM Sampler</name>
- <key>digital_ofdm_sampler</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_sampler($fft_length, $symbol_length, $timeout)</make>
- <param>
- <name>FFT Length</name>
- <key>fft_length</key>
- <type>int</type>
- </param>
- <param>
- <name>Symbol Length</name>
- <key>symbol_length</key>
- <type>int</type>
- </param>
- <param>
- <name>Timeout</name>
- <key>timeout</key>
- <value>1000</value>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <sink>
- <name>flag</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- <vlen>$fft_length</vlen>
- </source>
- <source>
- <name>flag</name>
- <type>byte</type>
- <vlen>$fft_length</vlen>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_ofdm_sync_pn.xml b/gr-digital/grc/digital_ofdm_sync_pn.xml
deleted file mode 100644
index 7a05f394d4..0000000000
--- a/gr-digital/grc/digital_ofdm_sync_pn.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-
-<!--
-###################################################
-##OFDM Synchronizer - PN based
-###################################################
- -->
-<block>
- <name>OFDM Sync PN</name>
- <key>digital_ofdm_sync_pn</key>
- <import>from gnuradio import digital</import>
- <make>digital.ofdm_sync_pn($fft_length, $cp_length, $logging)</make>
- <param>
- <name>FFT Length</name>
- <key>fft_length</key>
- <type>int</type>
- </param>
- <param>
- <name>CP Length</name>
- <key>cp_length</key>
- <type>int</type>
- </param>
- <param>
- <name>Logging</name>
- <key>logging</key>
- <value>False</value>
- <type>bool</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>fine freq</name>
- <type>float</type>
- </source>
- <source>
- <name>timing sig</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/gr-digital/grc/digital_psk_demod.xml b/gr-digital/grc/digital_psk_demod.xml
index 36e803ae73..02beed01ac 100644
--- a/gr-digital/grc/digital_psk_demod.xml
+++ b/gr-digital/grc/digital_psk_demod.xml
@@ -29,6 +29,7 @@
<block>
<name>PSK Demod</name>
<key>digital_psk_demod</key>
+ <category>[Core]/Deprecated</category>
<import>from gnuradio import digital</import>
<make>digital.psk.psk_demod(
constellation_points=$constellation_points,
diff --git a/gr-digital/grc/digital_psk_mod.xml b/gr-digital/grc/digital_psk_mod.xml
index e7788842a8..43e60562ee 100644
--- a/gr-digital/grc/digital_psk_mod.xml
+++ b/gr-digital/grc/digital_psk_mod.xml
@@ -29,6 +29,7 @@
<block>
<name>PSK Mod</name>
<key>digital_psk_mod</key>
+ <category>[Core]/Deprecated</category>
<import>from gnuradio import digital</import>
<make>digital.psk.psk_mod(
constellation_points=$constellation_points,
diff --git a/gr-digital/grc/digital_qam_demod.xml b/gr-digital/grc/digital_qam_demod.xml
index 21ccba856b..c9a6c6aa4b 100644
--- a/gr-digital/grc/digital_qam_demod.xml
+++ b/gr-digital/grc/digital_qam_demod.xml
@@ -29,6 +29,7 @@
<block>
<name>QAM Demod</name>
<key>digital_qam_demod</key>
+ <category>[Core]/Deprecated</category>
<import>from gnuradio import digital</import>
<make>digital.qam.qam_demod(
constellation_points=$constellation_points,
diff --git a/gr-digital/grc/digital_qam_mod.xml b/gr-digital/grc/digital_qam_mod.xml
index 435ca7058e..5c3d5139d2 100644
--- a/gr-digital/grc/digital_qam_mod.xml
+++ b/gr-digital/grc/digital_qam_mod.xml
@@ -29,6 +29,7 @@
<block>
<name>QAM Mod</name>
<key>digital_qam_mod</key>
+ <category>[Core]/Deprecated</category>
<import>from gnuradio import digital</import>
<make>digital.qam.qam_mod(
constellation_points=$constellation_points,
diff --git a/gr-digital/include/gnuradio/digital/CMakeLists.txt b/gr-digital/include/gnuradio/digital/CMakeLists.txt
index 64da41f71a..2b5aa8543c 100644
--- a/gr-digital/include/gnuradio/digital/CMakeLists.txt
+++ b/gr-digital/include/gnuradio/digital/CMakeLists.txt
@@ -72,7 +72,6 @@ install(FILES
map_bb.h
metric_type.h
modulate_vector.h
- mpsk_receiver_cc.h
mpsk_snr_est.h
mpsk_snr_est_cc.h
msk_timing_recovery_cc.h
@@ -82,12 +81,7 @@ install(FILES
ofdm_equalizer_base.h
ofdm_equalizer_simpledfe.h
ofdm_equalizer_static.h
- ofdm_frame_acquisition.h
ofdm_frame_equalizer_vcvc.h
- ofdm_frame_sink.h
- ofdm_insert_preamble.h
- ofdm_mapper_bcv.h
- ofdm_sampler.h
ofdm_serializer_vcc.h
ofdm_sync_sc_cfb.h
header_format_base.h
diff --git a/gr-digital/include/gnuradio/digital/mpsk_receiver_cc.h b/gr-digital/include/gnuradio/digital/mpsk_receiver_cc.h
deleted file mode 100644
index 618d192771..0000000000
--- a/gr-digital/include/gnuradio/digital/mpsk_receiver_cc.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2004,2007,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.
- */
-
-#ifndef INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
-#define INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
-
-#include <gnuradio/digital/api.h>
-#include <gnuradio/block.h>
-#include <gnuradio/blocks/control_loop.h>
-
-namespace gr {
- namespace digital {
-
- /*!
- * \brief This block takes care of receiving M-PSK modulated
- * signals through phase, frequency, and symbol synchronization.
- * \ingroup synchronizers_blk
- *
- * \details
- * It performs carrier frequency and phase locking as well as
- * symbol timing recovery. It works with (D)BPSK, (D)QPSK, and
- * (D)8PSK as tested currently. It should also work for OQPSK and
- * PI/4 DQPSK.
- *
- * The phase and frequency synchronization are based on a Costas
- * loop that finds the error of the incoming signal point compared
- * to its nearest constellation point. The frequency and phase of
- * the NCO are updated according to this error. There are
- * optimized phase error detectors for BPSK and QPSK, but 8PSK is
- * done using a brute-force computation of the constellation
- * points to find the minimum.
- *
- * The symbol synchronization is done using a modified Mueller and
- * Muller circuit from the paper:
- *
- * "G. R. Danesfahani, T. G. Jeans, "Optimisation of modified Mueller
- * and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22
- * June 1995, pp. 1032 - 1033."
- *
- * This circuit interpolates the downconverted sample (using the
- * NCO developed by the Costas loop) every mu samples, then it
- * finds the sampling error based on this and the past symbols and
- * the decision made on the samples. Like the phase error
- * detector, there are optimized decision algorithms for BPSK and
- * QPKS, but 8PSK uses another brute force computation against all
- * possible symbols. The modifications to the M&M used here reduce
- * self-noise.
- *
- */
- class DIGITAL_API mpsk_receiver_cc
- : virtual public block,
- virtual public blocks::control_loop
- {
- public:
- // gr::digital::mpsk_receiver_cc::sptr
- typedef boost::shared_ptr<mpsk_receiver_cc> sptr;
-
- /*!
- * \brief Make a M-PSK receiver block.
- *
- * \param M modulation order of the M-PSK modulation
- * \param theta any constant phase rotation from the real axis of the constellation
- * \param loop_bw Loop bandwidth to set gains of phase/freq tracking loop
- * \param fmin minimum normalized frequency value the loop can achieve
- * \param fmax maximum normalized frequency value the loop can achieve
- * \param mu initial parameter for the interpolator [0,1]
- * \param gain_mu gain parameter of the M&M error signal to adjust mu (~0.05)
- * \param omega initial value for the number of symbols between samples (~number of samples/symbol)
- * \param gain_omega gain parameter to adjust omega based on the error (~omega^2/4)
- * \param omega_rel sets the maximum (omega*(1+omega_rel)) and minimum (omega*(1+omega_rel)) omega (~0.005)
- *
- * The constructor also chooses which phase detector and
- * decision maker to use in the work loop based on the value of
- * M.
- */
- static sptr make(unsigned int M, float theta,
- float loop_bw,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel);
-
- //! Returns the modulation order (M) currently set
- virtual float modulation_order() const = 0;
-
- //! Returns current value of theta
- virtual float theta() const = 0;
-
- //! Returns current value of mu
- virtual float mu() const = 0;
-
- //! Returns current value of omega
- virtual float omega() const = 0;
-
- //! Returns mu gain factor
- virtual float gain_mu() const = 0;
-
- //! Returns omega gain factor
- virtual float gain_omega() const = 0;
-
- //! Returns the relative omega limit
- virtual float gain_omega_rel() const = 0;
-
- //! Sets the modulation order (M) currently
- virtual void set_modulation_order(unsigned int M) = 0;
-
- //! Sets value of theta
- virtual void set_theta(float theta) = 0;
-
- //! Sets value of mu
- virtual void set_mu(float mu) = 0;
-
- //! Sets value of omega and its min and max values
- virtual void set_omega(float omega) = 0;
-
- //! Sets value for mu gain factor
- virtual void set_gain_mu(float gain_mu) = 0;
-
- //! Sets value for omega gain factor
- virtual void set_gain_omega(float gain_omega) = 0;
-
- //! Sets the relative omega limit and resets omega min/max values
- virtual void set_gain_omega_rel(float omega_rel) = 0;
- };
-
- } /* namespace digital */
-} /* namespace gr */
-
-#endif /* INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H */
diff --git a/gr-digital/include/gnuradio/digital/ofdm_frame_acquisition.h b/gr-digital/include/gnuradio/digital/ofdm_frame_acquisition.h
deleted file mode 100644
index a398e18454..0000000000
--- a/gr-digital/include/gnuradio/digital/ofdm_frame_acquisition.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006,2007,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.
- */
-
-#ifndef INCLUDED_DIGITAL_OFDM_FRAME_ACQUISITION_H
-#define INCLUDED_DIGITAL_OFDM_FRAME_ACQUISITION_H
-
-#include <gnuradio/digital/api.h>
-#include <gnuradio/block.h>
-#include <vector>
-
-namespace gr {
- namespace digital {
-
- /*!
- * \brief take a vector of complex constellation points in from an
- * FFT and performs a correlation and equalization.
- * \ingroup ofdm_blk
- *
- * \details
- * This block takes the output of an FFT of a received OFDM symbol
- * and finds the start of a frame based on two known symbols. It
- * also looks at the surrounding bins in the FFT output for the
- * correlation in case there is a large frequency shift in the
- * data. This block assumes that the fine frequency shift has
- * already been corrected and that the samples fall in the middle
- * of one FFT bin.
- *
- * It then uses one of those known symbols to estimate the channel
- * response over all subcarriers and does a simple 1-tap
- * equalization on all subcarriers. This corrects for the phase
- * and amplitude distortion caused by the channel.
- */
- class DIGITAL_API ofdm_frame_acquisition : virtual public block
- {
- public:
- // gr::digital::ofdm_frame_acquisition::sptr
- typedef boost::shared_ptr<ofdm_frame_acquisition> sptr;
-
- /*!
- * Make an OFDM correlator and equalizer.
- *
- * \param occupied_carriers The number of subcarriers with data in the received symbol
- * \param fft_length The size of the FFT vector (occupied_carriers + unused carriers)
- * \param cplen The length of the cycle prefix
- * \param known_symbol A vector of complex numbers representing a known symbol at the
- * start of a frame (usually a BPSK PN sequence)
- * \param max_fft_shift_len Set's the maximum distance you can look between bins for correlation
- */
- static sptr make(unsigned int occupied_carriers, unsigned int fft_length,
- unsigned int cplen,
- const std::vector<gr_complex> &known_symbol,
- unsigned int max_fft_shift_len=4);
-
- /*!
- * \brief Return an estimate of the SNR of the channel
- */
- virtual float snr() = 0;
- };
-
- } /* namespace digital */
-} /* namespace gr */
-
-#endif /* INCLUDED_DIGITAL_OFDM_FRAME_ACQUISITION_H */
diff --git a/gr-digital/include/gnuradio/digital/ofdm_frame_sink.h b/gr-digital/include/gnuradio/digital/ofdm_frame_sink.h
deleted file mode 100644
index 439e1ca135..0000000000
--- a/gr-digital/include/gnuradio/digital/ofdm_frame_sink.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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.
- */
-
-#ifndef INCLUDED_DIGITAL_OFDM_FRAME_SINK_H
-#define INCLUDED_DIGITAL_OFDM_FRAME_SINK_H
-
-#include <gnuradio/digital/api.h>
-#include <gnuradio/sync_block.h>
-#include <gnuradio/msg_queue.h>
-
-namespace gr {
- namespace digital {
-
- /*!
- * \brief Takes an OFDM symbol in, demaps it into bits of 0's and
- * 1's, packs them into packets, and sends to to a message queue
- * sink.
- * \ingroup ofdm_blk
- *
- * \details
- * NOTE: The mod input parameter simply chooses a pre-defined
- * demapper/slicer. Eventually, we want to be able to pass in a
- * reference to an object to do the demapping and slicing for a
- * given modulation type.
- */
- class DIGITAL_API ofdm_frame_sink : virtual public sync_block
- {
- public:
- // gr::digital::ofdm_frame_sink::sptr
- typedef boost::shared_ptr<ofdm_frame_sink> sptr;
-
- /*!
- * Make an OFDM frame sink block.
- *
- * \param sym_position vector of OFDM carrier symbols in complex space
- * \param sym_value_out vector of bit mapped from the complex symbol space
- * \param target_queue message queue for the packets to go into
- * \param occupied_tones The number of subcarriers with data in the received symbol
- * \param phase_gain gain of the phase tracking loop
- * \param freq_gain gain of the frequency tracking loop
- */
- static sptr make(const std::vector<gr_complex> &sym_position,
- const std::vector<char> &sym_value_out,
- msg_queue::sptr target_queue,
- int occupied_tones,
- float phase_gain=0.25, float freq_gain=0.25*0.25/4);
- };
-
- } /* namespace digital */
-} /* namespace gr */
-
-#endif /* INCLUDED_GR_OFDM_FRAME_SINK_H */
diff --git a/gr-digital/include/gnuradio/digital/ofdm_insert_preamble.h b/gr-digital/include/gnuradio/digital/ofdm_insert_preamble.h
deleted file mode 100644
index a98e7cf814..0000000000
--- a/gr-digital/include/gnuradio/digital/ofdm_insert_preamble.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_DIGITAL_OFDM_INSERT_PREAMBLE_H
-#define INCLUDED_DIGITAL_OFDM_INSERT_PREAMBLE_H
-
-#include <gnuradio/digital/api.h>
-#include <gnuradio/block.h>
-#include <vector>
-
-namespace gr {
- namespace digital {
-
- /*!
- * \brief insert "pre-modulated" preamble symbols before each payload.
- * \ingroup ofdm_blk
- * \ingroup synchronizers_blk
- *
- * \details
- * <pre>
- * input 1: stream of vectors of gr_complex [fft_length]
- * These are the modulated symbols of the payload.
- *
- * input 2: stream of char. The LSB indicates whether the corresponding
- * symbol on input 1 is the first symbol of the payload or not.
- * It's a 1 if the corresponding symbol is the first symbol,
- * otherwise 0.
- *
- * N.B., this implies that there must be at least 1 symbol in the payload.
- *
- * output 1: stream of vectors of gr_complex [fft_length]
- * These include the preamble symbols and the payload symbols.
- *
- * output 2: stream of char. The LSB indicates whether the corresponding
- * symbol on input 1 is the first symbol of a packet (i.e., the
- * first symbol of the preamble.) It's a 1 if the corresponding
- * symbol is the first symbol, otherwise 0.
- * </pre>
- */
- class DIGITAL_API ofdm_insert_preamble : virtual public block
- {
- public:
- // gr::digital::ofdm_insert_preamble::sptr
- typedef boost::shared_ptr<ofdm_insert_preamble> sptr;
-
- /*!
- * Make an OFDM preamble inserter block.
- *
- * \param fft_length length of each symbol in samples.
- * \param preamble vector of symbols that represent the pre-modulated preamble.
- */
- static sptr make(int fft_length,
- const std::vector<std::vector<gr_complex> > &preamble);
-
- virtual void enter_preamble() = 0;
- };
-
- } /* namespace digital */
-} /* namespace gr */
-
-#endif /* INCLUDED_DIGITAL_OFDM_INSERT_PREAMBLE_H */
diff --git a/gr-digital/include/gnuradio/digital/ofdm_mapper_bcv.h b/gr-digital/include/gnuradio/digital/ofdm_mapper_bcv.h
deleted file mode 100644
index cdd4a60bc2..0000000000
--- a/gr-digital/include/gnuradio/digital/ofdm_mapper_bcv.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006,2007,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.
- */
-
-#ifndef INCLUDED_DIGITAL_OFDM_MAPPER_BCV_H
-#define INCLUDED_DIGITAL_OFDM_MAPPER_BCV_H
-
-#include <gnuradio/digital/api.h>
-#include <gnuradio/sync_block.h>
-#include <gnuradio/msg_queue.h>
-
-namespace gr {
- namespace digital {
-
- /*!
- * \brief take a stream of bytes in and map to a vector of complex
- * constellation points suitable for IFFT input to be used in an
- * ofdm modulator.
- * \ingroup ofdm_blk
- *
- * \details
- * Abstract class must be subclassed with specific mapping.
- */
- class DIGITAL_API ofdm_mapper_bcv : virtual public sync_block
- {
- public:
- // gr::digital::ofdm_mapper_bcv::sptr
- typedef boost::shared_ptr<ofdm_mapper_bcv> sptr;
-
- /*!
- * Make an OFDM mapper block.
- *
- * \param constellation vector of OFDM carrier symbols in complex space
- * \param msgq_limit limit on number of messages the queue can store
- * \param occupied_carriers The number of subcarriers with data in the received symbol
- * \param fft_length The size of the FFT vector (occupied_carriers + unused carriers)
- */
- static sptr make(const std::vector<gr_complex> &constellation,
- unsigned msgq_limit,
- unsigned occupied_carriers,
- unsigned int fft_length);
-
- virtual msg_queue::sptr msgq() const = 0;
- };
-
- } /* namespace digital */
-} /* namespace gr */
-
-#endif /* INCLUDED_DIGITAL_OFDM_MAPPER_BCV_H */
diff --git a/gr-digital/include/gnuradio/digital/ofdm_sampler.h b/gr-digital/include/gnuradio/digital/ofdm_sampler.h
deleted file mode 100644
index 59bc36a7c2..0000000000
--- a/gr-digital/include/gnuradio/digital/ofdm_sampler.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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.
- */
-
-#ifndef INCLUDED_DIGITAL_OFDM_SAMPLER_H
-#define INCLUDED_DIGITAL_OFDM_SAMPLER_H
-
-#include <gnuradio/digital/api.h>
-#include <gnuradio/sync_block.h>
-
-namespace gr {
- namespace digital {
-
- /*!
- * \brief does the rest of the OFDM stuff
- * \ingroup ofdm_blk
- */
- class DIGITAL_API ofdm_sampler : virtual public block
- {
- public:
- // gr::digital::ofdm_sampler::sptr
- typedef boost::shared_ptr<ofdm_sampler> sptr;
-
- /*!
- * Make an OFDM sampler block.
- *
- * \param fft_length The size of the FFT vector (occupied_carriers + unused carriers)
- * \param symbol_length Length of the full symbol (fft_length + CP length)
- * \param timeout timeout in samples when we stop looking for a symbol after initial ack.
- */
- static sptr make(unsigned int fft_length,
- unsigned int symbol_length,
- unsigned int timeout=1000);
- };
-
- } /* namespace digital */
-} /* namespace gr */
-
-#endif /* INCLUDED_DIGITAL_OFDM_SAMPLER_H */
diff --git a/gr-digital/lib/CMakeLists.txt b/gr-digital/lib/CMakeLists.txt
index b07bcc9d87..e10ef0f615 100644
--- a/gr-digital/lib/CMakeLists.txt
+++ b/gr-digital/lib/CMakeLists.txt
@@ -88,7 +88,6 @@ list(APPEND digital_sources
lms_dd_equalizer_cc_impl.cc
map_bb_impl.cc
modulate_vector.cc
- mpsk_receiver_cc_impl.cc
mpsk_snr_est.cc
mpsk_snr_est_cc_impl.cc
msk_timing_recovery_cc_impl.cc
@@ -98,12 +97,7 @@ list(APPEND digital_sources
ofdm_equalizer_base.cc
ofdm_equalizer_simpledfe.cc
ofdm_equalizer_static.cc
- ofdm_frame_acquisition_impl.cc
ofdm_frame_equalizer_vcvc_impl.cc
- ofdm_frame_sink_impl.cc
- ofdm_insert_preamble_impl.cc
- ofdm_mapper_bcv_impl.cc
- ofdm_sampler_impl.cc
ofdm_serializer_vcc_impl.cc
ofdm_sync_sc_cfb_impl.cc
header_format_base.cc
diff --git a/gr-digital/lib/mpsk_receiver_cc_impl.cc b/gr-digital/lib/mpsk_receiver_cc_impl.cc
deleted file mode 100644
index d6c2ae6fa3..0000000000
--- a/gr-digital/lib/mpsk_receiver_cc_impl.cc
+++ /dev/null
@@ -1,330 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2005-2007,2010-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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "mpsk_receiver_cc_impl.h"
-#include <gnuradio/io_signature.h>
-#include <gnuradio/math.h>
-#include <gnuradio/expj.h>
-#include <stdexcept>
-
-namespace gr {
- namespace digital {
-
-#define M_TWOPI (2*M_PI)
-#define VERBOSE_MM 0 // Used for debugging symbol timing loop
-#define VERBOSE_COSTAS 0 // Used for debugging phase and frequency tracking
-
- mpsk_receiver_cc::sptr
- mpsk_receiver_cc::make(unsigned int M, float theta,
- float loop_bw,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel)
- {
- return gnuradio::get_initial_sptr
- (new mpsk_receiver_cc_impl(M, theta,
- loop_bw,
- fmin, fmax,
- mu, gain_mu,
- omega, gain_omega,
- omega_rel));
- }
-
- mpsk_receiver_cc_impl::mpsk_receiver_cc_impl(unsigned int M, float theta,
- float loop_bw,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega,
- float omega_rel)
- : block("mpsk_receiver_cc",
- io_signature::make(1, 1, sizeof(gr_complex)),
- io_signature::make(1, 1, sizeof(gr_complex))),
- blocks::control_loop(loop_bw, fmax, fmin),
- d_M(M), d_theta(theta),
- d_current_const_point(0),
- d_mu(mu), d_gain_mu(gain_mu), d_gain_omega(gain_omega),
- d_omega_rel(omega_rel), d_max_omega(0), d_min_omega(0),
- d_p_2T(0), d_p_1T(0), d_p_0T(0), d_c_2T(0), d_c_1T(0), d_c_0T(0)
- {
- d_interp = new gr::filter::mmse_fir_interpolator_cc();
- d_dl_idx = 0;
-
- set_omega(omega);
-
- if(omega <= 0.0)
- throw std::out_of_range("clock rate must be > 0");
- if(gain_mu < 0 || gain_omega < 0)
- throw std::out_of_range("Gains must be non-negative");
-
- assert(d_interp->ntaps() <= DLLEN);
-
- // zero double length delay line.
- for(unsigned int i = 0; i < 2 * DLLEN; i++)
- d_dl[i] = gr_complex(0.0,0.0);
-
- set_modulation_order(d_M);
- }
-
- mpsk_receiver_cc_impl::~mpsk_receiver_cc_impl()
- {
- delete d_interp;
- }
-
- void
- mpsk_receiver_cc_impl::set_modulation_order(unsigned int M)
- {
- // build the constellation vector from M
- make_constellation();
-
- // Select a phase detector and a decision maker for the modulation order
- switch(d_M) {
- case 2: // optimized algorithms for BPSK
- d_phase_error_detector = &mpsk_receiver_cc_impl::phase_error_detector_bpsk; //bpsk;
- d_decision = &mpsk_receiver_cc_impl::decision_bpsk;
- break;
-
- case 4: // optimized algorithms for QPSK
- d_phase_error_detector = &mpsk_receiver_cc_impl::phase_error_detector_qpsk; //qpsk;
- d_decision = &mpsk_receiver_cc_impl::decision_qpsk;
- break;
-
- default: // generic algorithms for any M (power of 2?) but not pretty
- d_phase_error_detector = &mpsk_receiver_cc_impl::phase_error_detector_generic;
- d_decision = &mpsk_receiver_cc_impl::decision_generic;
- break;
- }
- }
-
- void
- mpsk_receiver_cc_impl::set_gain_omega_rel(float omega_rel)
- {
- d_omega_rel = omega_rel;
- set_omega(d_omega);
- }
-
- void
- mpsk_receiver_cc_impl::forecast(int noutput_items, gr_vector_int &ninput_items_required)
- {
- unsigned ninputs = ninput_items_required.size();
- for(unsigned i=0; i < ninputs; i++)
- ninput_items_required[i] = (int) ceil((noutput_items * d_omega) + d_interp->ntaps());
- }
-
- // FIXME add these back in an test difference in performance
- float
- mpsk_receiver_cc_impl::phase_error_detector_qpsk(gr_complex sample) const
- {
- float phase_error = 0;
- if(fabsf(sample.real()) > fabsf(sample.imag())) {
- if(sample.real() > 0)
- phase_error = -sample.imag();
- else
- phase_error = sample.imag();
- }
- else {
- if(sample.imag() > 0)
- phase_error = sample.real();
- else
- phase_error = -sample.real();
- }
-
- return phase_error;
- }
-
- float
- mpsk_receiver_cc_impl::phase_error_detector_bpsk(gr_complex sample) const
- {
- return -(sample.real()*sample.imag());
- }
-
- float mpsk_receiver_cc_impl::phase_error_detector_generic(gr_complex sample) const
- {
- //return gr::fast_atan2f(sample*conj(d_constellation[d_current_const_point]));
- return -arg(sample*conj(d_constellation[d_current_const_point]));
- }
-
- unsigned int
- mpsk_receiver_cc_impl::decision_bpsk(gr_complex sample) const
- {
- return (gr::branchless_binary_slicer(sample.real()) ^ 1);
- //return gr_binary_slicer(sample.real()) ^ 1;
- }
-
- unsigned int
- mpsk_receiver_cc_impl::decision_qpsk(gr_complex sample) const
- {
- unsigned int index;
-
- //index = gr::branchless_quad_0deg_slicer(sample);
- index = gr::quad_0deg_slicer(sample);
- return index;
- }
-
- unsigned int
- mpsk_receiver_cc_impl::decision_generic(gr_complex sample) const
- {
- unsigned int min_m = 0;
- float min_s = 65535;
-
- // Develop all possible constellation points and find the one that minimizes
- // the Euclidean distance (error) with the sample
- for(unsigned int m = 0; m < d_M; m++) {
- gr_complex diff = norm(d_constellation[m] - sample);
-
- if(fabs(diff.real()) < min_s) {
- min_s = fabs(diff.real());
- min_m = m;
- }
- }
- // Return the index of the constellation point that minimizes the error
- return min_m;
- }
-
- void
- mpsk_receiver_cc_impl::make_constellation()
- {
- for(unsigned int m = 0; m < d_M; m++) {
- d_constellation.push_back(gr_expj((M_TWOPI/d_M)*m));
- }
- }
-
- void
- mpsk_receiver_cc_impl::mm_sampler(const gr_complex symbol)
- {
- gr_complex sample, nco;
-
- d_mu--; // skip a number of symbols between sampling
- d_phase += d_freq; // increment the phase based on the frequency of the rotation
-
- // Keep phase clamped and not walk to infinity
- while(d_phase > M_TWOPI)
- d_phase -= M_TWOPI;
- while(d_phase < -M_TWOPI)
- d_phase += M_TWOPI;
-
- nco = gr_expj(d_phase+d_theta); // get the NCO value for derotating the current sample
- sample = nco*symbol; // get the downconverted symbol
-
- // Fill up the delay line for the interpolator
- d_dl[d_dl_idx] = sample;
- d_dl[(d_dl_idx + DLLEN)] = sample; // put this in the second half of the buffer for overflows
- d_dl_idx = (d_dl_idx+1) % DLLEN; // Keep the delay line index in bounds
- }
-
- void
- mpsk_receiver_cc_impl::mm_error_tracking(gr_complex sample)
- {
- gr_complex u, x, y;
- float mm_error = 0;
-
- // Make sample timing corrections
-
- // set the delayed samples
- d_p_2T = d_p_1T;
- d_p_1T = d_p_0T;
- d_p_0T = sample;
- d_c_2T = d_c_1T;
- d_c_1T = d_c_0T;
-
- d_current_const_point = (*this.*d_decision)(d_p_0T); // make a decision on the sample value
- d_c_0T = d_constellation[d_current_const_point];
-
- x = (d_c_0T - d_c_2T) * conj(d_p_1T);
- y = (d_p_0T - d_p_2T) * conj(d_c_1T);
- u = y - x;
- mm_error = u.real(); // the error signal is in the real part
- mm_error = gr::branchless_clip(mm_error, 1.0); // limit mm_val
-
- d_omega = d_omega + d_gain_omega * mm_error; // update omega based on loop error
- d_omega = d_omega_mid + gr::branchless_clip(d_omega-d_omega_mid, d_omega_rel); // make sure we don't walk away
-
- d_mu += d_omega + d_gain_mu * mm_error; // update mu based on loop error
-
-#if VERBOSE_MM
- printf("mm: mu: %f omega: %f mm_error: %f sample: %f+j%f constellation: %f+j%f\n",
- d_mu, d_omega, mm_error, sample.real(), sample.imag(),
- d_constellation[d_current_const_point].real(), d_constellation[d_current_const_point].imag());
-#endif
- }
-
-
- void
- mpsk_receiver_cc_impl::phase_error_tracking(gr_complex sample)
- {
- float phase_error = 0;
-
- // Make phase and frequency corrections based on sampled value
- phase_error = (*this.*d_phase_error_detector)(sample);
-
- advance_loop(phase_error);
- phase_wrap();
- frequency_limit();
-
-#if VERBOSE_COSTAS
- printf("cl: phase_error: %f phase: %f freq: %f sample: %f+j%f constellation: %f+j%f\n",
- phase_error, d_phase, d_freq, sample.real(), sample.imag(),
- d_constellation[d_current_const_point].real(), d_constellation[d_current_const_point].imag());
-#endif
-}
-
- int
- mpsk_receiver_cc_impl::general_work(int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
- {
- const gr_complex *in = (const gr_complex*)input_items[0];
- gr_complex *out = (gr_complex*)output_items[0];
-
- int i=0, o=0;
-
- while((o < noutput_items) && (i < ninput_items[0])) {
- while((d_mu > 1) && (i < ninput_items[0])) {
- mm_sampler(in[i]); // puts symbols into a buffer and adjusts d_mu
- i++;
- }
-
- if(i < ninput_items[0]) {
- gr_complex interp_sample = d_interp->interpolate(&d_dl[d_dl_idx], d_mu);
-
- mm_error_tracking(interp_sample); // corrects M&M sample time
- phase_error_tracking(interp_sample); // corrects phase and frequency offsets
-
- out[o++] = interp_sample;
- }
- }
-
-#if 0
- printf("ninput_items: %d noutput_items: %d consuming: %d returning: %d\n",
- ninput_items[0], noutput_items, i, o);
-#endif
-
- consume_each(i);
- return o;
- }
-
- } /* namespace digital */
-} /* namespace gr */
diff --git a/gr-digital/lib/mpsk_receiver_cc_impl.h b/gr-digital/lib/mpsk_receiver_cc_impl.h
deleted file mode 100644
index 48a9e43e58..0000000000
--- a/gr-digital/lib/mpsk_receiver_cc_impl.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2004,2007,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.
- */
-
-#ifndef INCLUDED_DIGITAL_MPSK_RECEIVER_CC_IMPL_H
-#define INCLUDED_DIGITAL_MPSK_RECEIVER_CC_IMPL_H
-
-#include <gnuradio/digital/mpsk_receiver_cc.h>
-#include <gnuradio/attributes.h>
-#include <gnuradio/gr_complex.h>
-#include <fstream>
-#include <gnuradio/filter/mmse_fir_interpolator_cc.h>
-
-namespace gr {
- namespace digital {
-
- class mpsk_receiver_cc_impl : public mpsk_receiver_cc
- {
- public:
- mpsk_receiver_cc_impl(unsigned int M, float theta,
- float loop_bw,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel);
- ~mpsk_receiver_cc_impl();
-
- void forecast(int noutput_items, gr_vector_int &ninput_items_required);
- int general_work(int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-
- //! Returns the modulation order (M) currently set
- float modulation_order() const { return d_M; }
-
- //! Returns current value of theta
- float theta() const { return d_theta; }
-
- //! Returns current value of mu
- float mu() const { return d_mu; }
-
- //! Returns current value of omega
- float omega() const { return d_omega; }
-
- //! Returns mu gain factor
- float gain_mu() const { return d_gain_mu; }
-
- //! Returns omega gain factor
- float gain_omega() const { return d_gain_omega; }
-
- //! Returns the relative omega limit
- float gain_omega_rel() const {return d_omega_rel; }
-
- //! Sets the modulation order (M) currently
- void set_modulation_order(unsigned int M);
-
- //! Sets value of theta
- void set_theta(float theta) { d_theta = theta; }
-
- //! Sets value of mu
- void set_mu(float mu) { d_mu = mu; }
-
- //! Sets value of omega and its min and max values
- void set_omega(float omega) {
- d_omega = omega;
- d_min_omega = omega*(1.0 - d_omega_rel);
- d_max_omega = omega*(1.0 + d_omega_rel);
- d_omega_mid = 0.5*(d_min_omega+d_max_omega);
- }
-
- //! Sets value for mu gain factor
- void set_gain_mu(float gain_mu) { d_gain_mu = gain_mu; }
-
- //! Sets value for omega gain factor
- void set_gain_omega(float gain_omega) { d_gain_omega = gain_omega; }
-
- //! Sets the relative omega limit and resets omega min/max values
- void set_gain_omega_rel(float omega_rel);
-
- protected:
- void make_constellation();
- void mm_sampler(const gr_complex symbol);
- void mm_error_tracking(gr_complex sample);
- void phase_error_tracking(gr_complex sample);
-
- /*!
- * \brief Phase error detector for MPSK modulations.
- *
- * \param sample the I&Q sample from which to determine the phase error
- *
- * This function determines the phase error for any MPSK signal
- * by creating a set of PSK constellation points and doing a
- * brute-force search to see which point minimizes the Euclidean
- * distance. This point is then used to derotate the sample to
- * the real-axis and a atan (using the fast approximation
- * function) to determine the phase difference between the
- * incoming sample and the real constellation point
- *
- * This should be cleaned up and made more efficient.
- *
- * \returns the approximated phase error.
- */
- float phase_error_detector_generic(gr_complex sample) const;
-
- /*!
- * \brief Phase error detector for BPSK modulation.
- *
- * \param sample the I&Q sample from which to determine the phase error
- *
- * This function determines the phase error using a simple BPSK
- * phase error detector by multiplying the real and imaginary (the
- * error signal) components together. As the imaginary part goes to
- * 0, so does this error.
- *
- * \returns the approximated phase error.
- */
- float phase_error_detector_bpsk(gr_complex sample) const;
-
- /*!
- * \brief Phase error detector for QPSK modulation.
- *
- * \param sample the I&Q sample from which to determine the phase error
- *
- * This function determines the phase error using the limiter
- * approach in a standard 4th order Costas loop
- *
- * \returns the approximated phase error.
- */
- float phase_error_detector_qpsk(gr_complex sample) const;
-
- /*!
- * \brief Decision maker for a generic MPSK constellation.
- *
- * \param sample the baseband I&Q sample from which to make the decision
- *
- * This decision maker is a generic implementation that does a
- * brute-force search for the constellation point that minimizes
- * the error between it and the incoming signal.
- *
- * \returns the index to d_constellation that minimizes the error/
- */
- unsigned int decision_generic(gr_complex sample) const;
-
- /*!
- * \brief Decision maker for BPSK constellation.
- *
- * \param sample the baseband I&Q sample from which to make the decision
- *
- * This decision maker is a simple slicer function that makes a
- * decision on the symbol based on its placement on the real
- * axis of greater than 0 or less than 0; the quadrature
- * component is always 0.
- *
- * \returns the index to d_constellation that minimizes the error/
- */
- unsigned int decision_bpsk(gr_complex sample) const;
-
- /*!
- * \brief Decision maker for QPSK constellation.
- *
- * \param sample the baseband I&Q sample from which to make the decision
- *
- * This decision maker is a simple slicer function that makes a
- * decision on the symbol based on its placement versus both
- * axes and returns which quadrant the symbol is in.
- *
- * \returns the index to d_constellation that minimizes the error/
- */
- unsigned int decision_qpsk(gr_complex sample) const;
-
- private:
- unsigned int d_M;
- float d_theta;
-
- /*!
- * \brief Decision maker function pointer
- *
- * \param sample the baseband I&Q sample from which to make the decision
- *
- * This is a function pointer that is set in the constructor to
- * point to the proper decision function for the specified
- * constellation order.
- *
- * \return index into d_constellation point that is the closest to the recieved sample
- */
- unsigned int (mpsk_receiver_cc_impl::*d_decision)(gr_complex sample) const;
-
- std::vector<gr_complex> d_constellation;
- unsigned int d_current_const_point;
-
- // Members related to symbol timing
- float d_mu, d_gain_mu;
- float d_omega, d_gain_omega, d_omega_rel, d_max_omega, d_min_omega, d_omega_mid;
- gr_complex d_p_2T, d_p_1T, d_p_0T;
- gr_complex d_c_2T, d_c_1T, d_c_0T;
-
- /*!
- * \brief Phase error detector function pointer
- *
- * \param sample the I&Q sample from which to determine the phase error
- *
- * This is a function pointer that is set in the constructor to
- * point to the proper phase error detector function for the
- * specified constellation order.
- */
- float (mpsk_receiver_cc_impl::*d_phase_error_detector)(gr_complex sample) const;
-
- //! get interpolated value
- gr::filter::mmse_fir_interpolator_cc *d_interp;
-
- //! delay line length.
- static const unsigned int DLLEN = 8;
-
- //! delay line plus some length for overflow protection
- __GR_ATTR_ALIGNED(8) gr_complex d_dl[2*DLLEN];
-
- //! index to delay line
- unsigned int d_dl_idx;
- };
-
- } /* namespace digital */
-} /* namespace gr */
-
-#endif /* INCLUDED_DIGITAL_MPSK_RECEIVER_CC_IMPL_H */
diff --git a/gr-digital/lib/msk_timing_recovery_cc_impl.cc b/gr-digital/lib/msk_timing_recovery_cc_impl.cc
index 4b26573870..1473aa88c5 100644
--- a/gr-digital/lib/msk_timing_recovery_cc_impl.cc
+++ b/gr-digital/lib/msk_timing_recovery_cc_impl.cc
@@ -145,8 +145,16 @@ namespace gr {
tags.erase(tags.begin());
goto out;
}
+ if(std::abs(center) >= 1.0f) {
+ GR_LOG_WARN(d_logger, boost::format("work: ignoring time_est tag "
+ "(%.2f) outside of (-1, 1)") \
+ % center);
+ tags.erase(tags.begin());
+ goto out;
+ }
d_mu = center;
iidx = offset;
+ //we want positive mu, so offset iidx to compensate
if(d_mu<0) {
d_mu++;
iidx--;
diff --git a/gr-digital/lib/ofdm_frame_acquisition_impl.cc b/gr-digital/lib/ofdm_frame_acquisition_impl.cc
index 2c2d6eff7a..02b587c1de 100644
--- a/gr-digital/lib/ofdm_frame_acquisition_impl.cc
+++ b/gr-digital/lib/ofdm_frame_acquisition_impl.cc
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2006-2008,2010,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,
@@ -32,14 +32,14 @@
namespace gr {
namespace digital {
-
+
#define VERBOSE 0
#define M_TWOPI (2*M_PI)
#define MAX_NUM_SYMBOLS 1000
ofdm_frame_acquisition::sptr
ofdm_frame_acquisition::make(unsigned int occupied_carriers,
- unsigned int fft_length,
+ unsigned int fft_length,
unsigned int cplen,
const std::vector<gr_complex> &known_symbol,
unsigned int max_fft_shift_len)
@@ -50,7 +50,7 @@ namespace gr {
}
ofdm_frame_acquisition_impl::ofdm_frame_acquisition_impl(unsigned occupied_carriers,
- unsigned int fft_length,
+ unsigned int fft_length,
unsigned int cplen,
const std::vector<gr_complex> &known_symbol,
unsigned int max_fft_shift_len)
@@ -65,6 +65,8 @@ namespace gr {
d_coarse_freq(0),
d_phase_count(0)
{
+ GR_LOG_WARN(d_logger, "The gr::digital::ofdm_frame_acquisition block has been deprecated.");
+
d_symbol_phase_diff.resize(d_fft_length);
d_known_phase_diff.resize(d_occupied_carriers);
d_hestimate.resize(d_occupied_carriers);
@@ -75,7 +77,7 @@ namespace gr {
for(i = 0; i < d_known_symbol.size()-2; i+=2) {
d_known_phase_diff[i] = norm(d_known_symbol[i] - d_known_symbol[i+2]);
}
-
+
d_phase_lut = new gr_complex[(2*d_freq_shift_len+1) * MAX_NUM_SYMBOLS];
for(i = 0; i <= 2*d_freq_shift_len; i++) {
for(j = 0; j < MAX_NUM_SYMBOLS; j++) {
@@ -112,7 +114,7 @@ namespace gr {
ofdm_frame_acquisition_impl::correlate(const gr_complex *symbol, int zeros_on_left)
{
unsigned int i,j;
-
+
std::fill(d_symbol_phase_diff.begin(), d_symbol_phase_diff.end(), 0);
for(i = 0; i < d_fft_length-2; i++) {
d_symbol_phase_diff[i] = norm(symbol[i] - symbol[i+2]);
@@ -142,16 +144,16 @@ namespace gr {
unsigned int i=0;
// Set first tap of equalizer
- d_hestimate[0] = d_known_symbol[0] /
+ d_hestimate[0] = d_known_symbol[0] /
(coarse_freq_comp(d_coarse_freq,1)*symbol[zeros_on_left+d_coarse_freq]);
// set every even tap based on known symbol
// linearly interpolate between set carriers to set zero-filled carriers
// FIXME: is this the best way to set this?
for(i = 2; i < d_occupied_carriers; i+=2) {
- d_hestimate[i] = d_known_symbol[i] /
+ d_hestimate[i] = d_known_symbol[i] /
(coarse_freq_comp(d_coarse_freq,1)*(symbol[i+zeros_on_left+d_coarse_freq]));
- d_hestimate[i-1] = (d_hestimate[i] + d_hestimate[i-2]) / gr_complex(2.0, 0.0);
+ d_hestimate[i-1] = (d_hestimate[i] + d_hestimate[i-2]) / gr_complex(2.0, 0.0);
}
// with even number of carriers; last equalizer tap is wrong
@@ -164,7 +166,7 @@ namespace gr {
for(i = 0; i < d_occupied_carriers; i++) {
gr_complex sym = coarse_freq_comp(d_coarse_freq,1)*symbol[i+zeros_on_left+d_coarse_freq];
gr_complex output = sym * d_hestimate[i];
- fprintf(stderr, "sym: %+.4f + j%+.4f ks: %+.4f + j%+.4f eq: %+.4f + j%+.4f ==> %+.4f + j%+.4f\n",
+ fprintf(stderr, "sym: %+.4f + j%+.4f ks: %+.4f + j%+.4f eq: %+.4f + j%+.4f ==> %+.4f + j%+.4f\n",
sym .real(), sym.imag(),
d_known_symbol[i].real(), d_known_symbol[i].imag(),
d_hestimate[i].real(), d_hestimate[i].imag(),
@@ -185,7 +187,7 @@ namespace gr {
gr_complex *out = (gr_complex *) output_items[0];
char *signal_out = (char *) output_items[1];
-
+
int unoccupied_carriers = d_fft_length - d_occupied_carriers;
int zeros_on_left = (int)ceil(unoccupied_carriers/2.0);
@@ -203,7 +205,7 @@ namespace gr {
out[i] = d_hestimate[i]*coarse_freq_comp(d_coarse_freq,d_phase_count)
*symbol[i+zeros_on_left+d_coarse_freq];
}
-
+
d_phase_count++;
if(d_phase_count == MAX_NUM_SYMBOLS) {
d_phase_count = 1;
diff --git a/gr-digital/lib/ofdm_frame_sink_impl.cc b/gr-digital/lib/ofdm_frame_sink_impl.cc
index b2e4f44ec9..2493667255 100644
--- a/gr-digital/lib/ofdm_frame_sink_impl.cc
+++ b/gr-digital/lib/ofdm_frame_sink_impl.cc
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2007,2008,2010-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,
@@ -47,7 +47,7 @@ namespace gr {
d_state = STATE_SYNC_SEARCH;
}
-
+
inline void
ofdm_frame_sink_impl::enter_have_sync()
{
@@ -82,7 +82,7 @@ namespace gr {
d_packetlen_cnt = 0;
if(VERBOSE)
- fprintf(stderr, "@ enter_have_header (payload_len = %d) (offset = %d)\n",
+ fprintf(stderr, "@ enter_have_header (payload_len = %d) (offset = %d)\n",
d_packetlen, d_packet_whitener_offset);
}
@@ -93,7 +93,7 @@ namespace gr {
unsigned int min_index = 0;
float min_euclid_dist = norm(x - d_sym_position[0]);
float euclid_dist = 0;
-
+
for(unsigned int j = 1; j < table_size; j++){
euclid_dist = norm(x - d_sym_position[j]);
if(euclid_dist < min_euclid_dist){
@@ -121,26 +121,26 @@ namespace gr {
d_nresid = 0;
d_resid = 0;
}
-
+
//while((d_byte_offset < 8) && (i < d_occupied_carriers)) {
while((d_byte_offset < 8) && (i < d_subcarrier_map.size())) {
//gr_complex sigrot = in[i]*carrier*d_dfe[i];
gr_complex sigrot = in[d_subcarrier_map[i]]*carrier*d_dfe[i];
-
+
if(d_derotated_output != NULL){
d_derotated_output[i] = sigrot;
}
-
+
char bits = slicer(sigrot);
gr_complex closest_sym = d_sym_position[bits];
-
+
accum_error += sigrot * conj(closest_sym);
// FIX THE FOLLOWING STATEMENT
if(norm(sigrot)> 0.001)
d_dfe[i] += d_eq_gain*(closest_sym/sigrot-d_dfe[i]);
-
+
i++;
if((8 - d_byte_offset) >= d_nbits) {
@@ -154,7 +154,7 @@ namespace gr {
d_resid = bits >> (8-d_byte_offset);
d_byte_offset += (d_nbits - d_nresid);
}
- //printf("demod symbol: %.4f + j%.4f bits: %x partial_byte: %x byte_offset: %d resid: %x nresid: %d\n",
+ //printf("demod symbol: %.4f + j%.4f bits: %x partial_byte: %x byte_offset: %d resid: %x nresid: %d\n",
// in[i-1].real(), in[i-1].imag(), bits, d_partial_byte, d_byte_offset, d_resid, d_nresid);
}
@@ -175,16 +175,16 @@ namespace gr {
d_phase -= 2*M_PI;
if(d_phase <0)
d_phase += 2*M_PI;
-
+
//if(VERBOSE)
// std::cerr << angle << "\t" << d_freq << "\t" << d_phase << "\t" << std::endl;
-
+
return bytes_produced;
}
ofdm_frame_sink::sptr
- ofdm_frame_sink::make(const std::vector<gr_complex> &sym_position,
+ ofdm_frame_sink::make(const std::vector<gr_complex> &sym_position,
const std::vector<char> &sym_value_out,
msg_queue::sptr target_queue,
int occupied_carriers,
@@ -196,7 +196,7 @@ namespace gr {
phase_gain, freq_gain));
}
- ofdm_frame_sink_impl::ofdm_frame_sink_impl(const std::vector<gr_complex> &sym_position,
+ ofdm_frame_sink_impl::ofdm_frame_sink_impl(const std::vector<gr_complex> &sym_position,
const std::vector<char> &sym_value_out,
msg_queue::sptr target_queue,
int occupied_carriers,
@@ -204,22 +204,24 @@ namespace gr {
: sync_block("ofdm_frame_sink",
io_signature::make2(2, 2, sizeof(gr_complex)*occupied_carriers, sizeof(char)),
io_signature::make(1, 1, sizeof(gr_complex)*occupied_carriers)),
- d_target_queue(target_queue), d_occupied_carriers(occupied_carriers),
+ d_target_queue(target_queue), d_occupied_carriers(occupied_carriers),
d_byte_offset(0), d_partial_byte(0),
d_resid(0), d_nresid(0),d_phase(0),d_freq(0),
d_phase_gain(phase_gain),d_freq_gain(freq_gain),
d_eq_gain(0.05)
{
+ GR_LOG_WARN(d_logger, "The gr::digital::ofdm_frame_sync block has been deprecated.");
+
std::string carriers = "FE7F";
// A bit hacky to fill out carriers to occupied_carriers length
- int diff = (d_occupied_carriers - 4*carriers.length());
+ int diff = (d_occupied_carriers - 4*carriers.length());
while(diff > 7) {
carriers.insert(0, "f");
carriers.insert(carriers.length(), "f");
diff -= 8;
}
-
+
// if there's extras left to be processed
// divide remaining to put on either side of current map
// all of this is done to stick with the concept of a carrier map string that
@@ -229,7 +231,7 @@ namespace gr {
int diff_right=0;
// dictionary to convert from integers to ascii hex representation
- char abc[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
+ char abc[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
if(diff > 0) {
char c[2] = {0,0};
@@ -237,7 +239,7 @@ namespace gr {
diff_left = (int)ceil((float)diff/2.0f); // number of carriers to put on the left side
c[0] = abc[(1 << diff_left) - 1]; // convert to bits and move to ASCI integer
carriers.insert(0, c);
-
+
diff_right = diff - diff_left; // number of carriers to put on the right side
c[0] = abc[0xF^((1 << diff_right) - 1)]; // convert to bits and move to ASCI integer
carriers.insert(carriers.length(), c);
@@ -258,7 +260,7 @@ namespace gr {
}
}
}
-
+
// make sure we stay in the limit currently imposed by the occupied_carriers
if(d_subcarrier_map.size() > (size_t)d_occupied_carriers) {
throw std::invalid_argument("ofdm_frame_sink_impl: subcarriers allocated exceeds size of occupied carriers");
@@ -269,7 +271,7 @@ namespace gr {
fill(d_dfe.begin(), d_dfe.end(), gr_complex(1.0,0.0));
set_sym_value_out(sym_position, sym_value_out);
-
+
enter_search();
}
@@ -279,7 +281,7 @@ namespace gr {
}
bool
- ofdm_frame_sink_impl::set_sym_value_out(const std::vector<gr_complex> &sym_position,
+ ofdm_frame_sink_impl::set_sym_value_out(const std::vector<gr_complex> &sym_position,
const std::vector<char> &sym_value_out)
{
if(sym_position.size() != sym_value_out.size())
@@ -310,7 +312,7 @@ namespace gr {
d_derotated_output = (gr_complex *)output_items[0];
else
d_derotated_output = NULL;
-
+
if(VERBOSE)
fprintf(stderr,">>> Entering state machine\n");
@@ -318,17 +320,17 @@ namespace gr {
case STATE_SYNC_SEARCH: // Look for flag indicating beginning of pkt
if(VERBOSE)
fprintf(stderr,"SYNC Search, noutput=%d\n", noutput_items);
-
+
if(sig[0]) { // Found it, set up for header decode
enter_have_sync();
}
break;
case STATE_HAVE_SYNC:
- // only demod after getting the preamble signal; otherwise, the
+ // only demod after getting the preamble signal; otherwise, the
// equalizer taps will screw with the PLL performance
bytes = demapper(&in[0], d_bytes_out);
-
+
if(VERBOSE) {
if(sig[0])
printf("ERROR -- Found SYNC in HAVE_SYNC\n");
@@ -340,29 +342,29 @@ namespace gr {
while(j < bytes) {
d_header = (d_header << 8) | (d_bytes_out[j] & 0xFF);
j++;
-
+
if(++d_headerbytelen_cnt == HEADERBYTELEN) {
if(VERBOSE)
fprintf(stderr, "got header: 0x%08x\n", d_header);
-
+
// we have a full header, check to see if it has been received properly
if(header_ok()) {
enter_have_header();
-
+
if(VERBOSE)
printf("\nPacket Length: %d\n", d_packetlen);
-
+
while((j < bytes) && (d_packetlen_cnt < d_packetlen)) {
d_packet[d_packetlen_cnt++] = d_bytes_out[j++];
}
-
+
if(d_packetlen_cnt == d_packetlen) {
message::sptr msg =
message::make(0, d_packet_whitener_offset, 0, d_packetlen);
memcpy(msg->msg(), d_packet, d_packetlen_cnt);
d_target_queue->insert_tail(msg); // send it
msg.reset(); // free it up
-
+
enter_search();
}
}
@@ -372,7 +374,7 @@ namespace gr {
}
}
break;
-
+
case STATE_HAVE_HEADER:
bytes = demapper(&in[0], d_bytes_out);
@@ -381,27 +383,27 @@ namespace gr {
printf("ERROR -- Found SYNC in HAVE_HEADER at %d, length of %d\n", d_packetlen_cnt, d_packetlen);
fprintf(stderr,"Packet Build\n");
}
-
+
j = 0;
while(j < bytes) {
d_packet[d_packetlen_cnt++] = d_bytes_out[j++];
-
+
if (d_packetlen_cnt == d_packetlen){ // packet is filled
// build a message
// NOTE: passing header field as arg1 is not scalable
message::sptr msg =
message::make(0, d_packet_whitener_offset, 0, d_packetlen_cnt);
memcpy(msg->msg(), d_packet, d_packetlen_cnt);
-
+
d_target_queue->insert_tail(msg); // send it
msg.reset(); // free it up
-
+
enter_search();
break;
}
}
break;
-
+
default:
assert(0);
} // switch
diff --git a/gr-digital/lib/ofdm_insert_preamble_impl.cc b/gr-digital/lib/ofdm_insert_preamble_impl.cc
index dcc3a900a4..4a617cecb2 100644
--- a/gr-digital/lib/ofdm_insert_preamble_impl.cc
+++ b/gr-digital/lib/ofdm_insert_preamble_impl.cc
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2007,2010-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 this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -31,7 +31,7 @@
namespace gr {
namespace digital {
-
+
ofdm_insert_preamble::sptr
ofdm_insert_preamble::make(int fft_length,
const std::vector<std::vector<gr_complex> > &preamble)
@@ -55,6 +55,8 @@ namespace gr {
d_pending_flag(0),
d_preamble(preamble)
{
+ GR_LOG_WARN(d_logger, "The gr::digital::ofdm_insert_preamble block has been deprecated.");
+
// sanity check preamble symbols
for(size_t i = 0; i < d_preamble.size(); i++) {
if(d_preamble[i].size() != (size_t) d_fft_length)
@@ -113,7 +115,7 @@ namespace gr {
else
ni++; // eat one input symbol
break;
-
+
case ST_PREAMBLE:
assert(!in_flag || in_flag[ni] & 0x1);
if(d_nsymbols_output >= (int) d_preamble.size()) {
@@ -130,7 +132,7 @@ namespace gr {
d_nsymbols_output++;
}
break;
-
+
case ST_FIRST_PAYLOAD:
// copy first payload symbol from input to output
memcpy(&out_sym[no * d_fft_length],
@@ -142,7 +144,7 @@ namespace gr {
ni++;
enter_payload();
break;
-
+
case ST_PAYLOAD:
if(in_flag && in_flag[ni] & 0x1) { // this is first symbol of a new payload
enter_preamble();
diff --git a/gr-digital/lib/ofdm_mapper_bcv_impl.cc b/gr-digital/lib/ofdm_mapper_bcv_impl.cc
index b241a3be71..c763d2f71b 100644
--- a/gr-digital/lib/ofdm_mapper_bcv_impl.cc
+++ b/gr-digital/lib/ofdm_mapper_bcv_impl.cc
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2006-2008,2010-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,
@@ -34,19 +34,19 @@ namespace gr {
ofdm_mapper_bcv::sptr
ofdm_mapper_bcv::make(const std::vector<gr_complex> &constellation,
- unsigned int msgq_limit,
+ unsigned int msgq_limit,
unsigned int occupied_carriers,
unsigned int fft_length)
{
return gnuradio::get_initial_sptr
- (new ofdm_mapper_bcv_impl(constellation, msgq_limit,
+ (new ofdm_mapper_bcv_impl(constellation, msgq_limit,
occupied_carriers, fft_length));
}
// Consumes 1 packet and produces as many OFDM symbols of
// fft_length to hold the full packet
ofdm_mapper_bcv_impl::ofdm_mapper_bcv_impl(const std::vector<gr_complex> &constellation,
- unsigned int msgq_limit,
+ unsigned int msgq_limit,
unsigned int occupied_carriers,
unsigned int fft_length)
: sync_block("ofdm_mapper_bcv",
@@ -61,6 +61,8 @@ namespace gr {
d_resid(0),
d_nresid(0)
{
+ GR_LOG_WARN(d_logger, "The gr::digital::ofdm_mapper_bcv block has been deprecated.");
+
if(!(d_occupied_carriers <= d_fft_length))
throw std::invalid_argument("ofdm_mapper_bcv_impl: occupied carriers must be <= fft_length");
@@ -72,7 +74,7 @@ namespace gr {
std::string carriers = "FE7F";
// A bit hacky to fill out carriers to occupied_carriers length
- int diff = (d_occupied_carriers - 4*carriers.length());
+ int diff = (d_occupied_carriers - 4*carriers.length());
while(diff > 7) {
carriers.insert(0, "f");
carriers.insert(carriers.length(), "f");
@@ -88,7 +90,7 @@ namespace gr {
int diff_right=0;
// dictionary to convert from integers to ascii hex representation
- char abc[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
+ char abc[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
if(diff > 0) {
char c[2] = {0,0};
@@ -96,23 +98,23 @@ namespace gr {
diff_left = (int)ceil((float)diff/2.0f); // number of carriers to put on the left side
c[0] = abc[(1 << diff_left) - 1]; // convert to bits and move to ASCI integer
carriers.insert(0, c);
-
+
diff_right = diff - diff_left; // number of carriers to put on the right side
c[0] = abc[0xF^((1 << diff_right) - 1)]; // convert to bits and move to ASCI integer
carriers.insert(carriers.length(), c);
}
-
+
// find out how many zeros to pad on the sides; the difference between the fft length and the subcarrier
- // mapping size in chunks of four. This is the number to pack on the left and this number plus any
- // residual nulls (if odd) will be packed on the right.
- diff = (d_fft_length/4 - carriers.length())/2;
+ // mapping size in chunks of four. This is the number to pack on the left and this number plus any
+ // residual nulls (if odd) will be packed on the right.
+ diff = (d_fft_length/4 - carriers.length())/2;
unsigned int i,j,k;
for(i = 0; i < carriers.length(); i++) {
char c = carriers[i]; // get the current hex character from the string
for(j = 0; j < 4; j++) { // walk through all four bits
k = (strtol(&c, NULL, 16) >> (3-j)) & 0x1; // convert to int and extract next bit
- if(k) { // if bit is a 1,
+ if(k) { // if bit is a 1,
d_subcarrier_map.push_back(4*(i+diff) + j); // use this subcarrier
}
}
@@ -122,7 +124,7 @@ namespace gr {
if(d_subcarrier_map.size() > d_occupied_carriers) {
throw std::invalid_argument("ofdm_mapper_bcv_impl: subcarriers allocated exceeds size of occupied carriers");
}
-
+
d_nbits = (unsigned long)ceil(log10(float(d_constellation.size())) / log10(2.0));
}
@@ -141,7 +143,7 @@ namespace gr {
gr_vector_void_star &output_items)
{
gr_complex *out = (gr_complex *)output_items[0];
-
+
unsigned int i=0;
//printf("OFDM BPSK Mapper: ninput_items: %d noutput_items: %d\n", ninput_items[0], noutput_items);
@@ -149,13 +151,13 @@ namespace gr {
if(d_eof) {
return -1;
}
-
+
if(!d_msg) {
d_msg = d_msgq->delete_head(); // block, waiting for a message
d_msg_offset = 0;
d_bit_offset = 0;
d_pending_flag = 1; // new packet, write start of packet flag
-
+
if((d_msg->length() == 0) && (d_msg->type() == 1)) {
d_msg.reset();
return -1; // We're done; no more messages coming.
@@ -165,12 +167,12 @@ namespace gr {
char *out_flag = 0;
if(output_items.size() == 2)
out_flag = (char *) output_items[1];
-
+
// Build a single symbol:
// Initialize all bins to 0 to set unused carriers
memset(out, 0, d_fft_length*sizeof(gr_complex));
-
+
i = 0;
unsigned char bits = 0;
//while((d_msg_offset < d_msg->length()) && (i < d_occupied_carriers)) {
@@ -193,7 +195,7 @@ namespace gr {
d_bit_offset += d_nresid;
d_nresid = 0;
d_resid = 0;
- //printf("mod bit(r): %x resid: %x nresid: %d bit_offset: %d\n",
+ //printf("mod bit(r): %x resid: %x nresid: %d bit_offset: %d\n",
// bits, d_resid, d_nresid, d_bit_offset);
}
else {
@@ -201,11 +203,11 @@ namespace gr {
// take the nbits number of bits at a time from the byte to add to the symbol
bits = ((1 << d_nbits)-1) & (d_msgbytes >> d_bit_offset);
d_bit_offset += d_nbits;
-
+
out[d_subcarrier_map[i]] = d_constellation[bits];
i++;
}
- else { // if we can't fit nbits, store them for the next
+ else { // if we can't fit nbits, store them for the next
// saves d_nresid bits of this message where d_nresid < d_nbits
unsigned int extra = 8-d_bit_offset;
d_resid = ((1 << extra)-1) & (d_msgbytes >> d_bit_offset);
@@ -213,7 +215,7 @@ namespace gr {
d_nresid = d_nbits - extra;
}
}
-
+
if(d_bit_offset == 8) {
d_bit_offset = 0;
d_msg_offset++;
diff --git a/gr-digital/lib/ofdm_sampler_impl.cc b/gr-digital/lib/ofdm_sampler_impl.cc
index dd6197dfc7..01fa24d9a9 100644
--- a/gr-digital/lib/ofdm_sampler_impl.cc
+++ b/gr-digital/lib/ofdm_sampler_impl.cc
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2007,2008,2010-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,
@@ -31,9 +31,9 @@
namespace gr {
namespace digital {
-
+
ofdm_sampler::sptr
- ofdm_sampler::make(unsigned int fft_length,
+ ofdm_sampler::make(unsigned int fft_length,
unsigned int symbol_length,
unsigned int timeout)
{
@@ -41,7 +41,7 @@ namespace gr {
(new ofdm_sampler_impl(fft_length, symbol_length, timeout));
}
- ofdm_sampler_impl::ofdm_sampler_impl(unsigned int fft_length,
+ ofdm_sampler_impl::ofdm_sampler_impl(unsigned int fft_length,
unsigned int symbol_length,
unsigned int timeout)
: block("ofdm_sampler",
@@ -50,6 +50,8 @@ namespace gr {
d_state(STATE_NO_SIG), d_timeout_max(timeout),
d_fft_length(fft_length), d_symbol_length(symbol_length)
{
+ GR_LOG_WARN(d_logger, "The gr::digital::ofdm_sampler block has been deprecated.");
+
set_relative_rate(1.0/(double) fft_length); // buffer allocator hint
}
@@ -80,7 +82,7 @@ namespace gr {
gr_complex *optr = (gr_complex*)output_items[0];
char *outsig = (char*)output_items[1];
- //FIXME: we only process a single OFDM symbol at a time; after the preamble, we can
+ //FIXME: we only process a single OFDM symbol at a time; after the preamble, we can
// process a few at a time as long as we always look out for the next preamble.
unsigned int index = d_fft_length; // start one fft length into the input so we can always look back this far
@@ -96,7 +98,7 @@ namespace gr {
else
index++;
}
-
+
unsigned int i, pos, ret;
switch(d_state) {
case(STATE_PREAMBLE):
@@ -104,13 +106,13 @@ namespace gr {
for(i = (index - d_fft_length + 1); i <= index; i++) {
*optr++ = iptr[i];
}
-
+
d_timeout = d_timeout_max; // tell the system to expect at least this many symbols for a frame
d_state = STATE_FRAME;
consume_each(index - d_fft_length + 1); // consume up to one fft_length away to keep the history
ret = 1;
break;
-
+
case(STATE_FRAME):
// use this state when we have processed a preamble and are getting the rest of the frames
//FIXME: we could also have a power squelch system here to enter STATE_NO_SIG if no power is received
diff --git a/gr-digital/python/digital/qa_mpsk_receiver.py b/gr-digital/python/digital/qa_mpsk_receiver.py
deleted file mode 100755
index df7519dcf6..0000000000
--- a/gr-digital/python/digital/qa_mpsk_receiver.py
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2011-2013 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.
-#
-
-import random
-import cmath
-import time
-
-from gnuradio import gr, gr_unittest, digital, filter, blocks
-
-class test_mpsk_receiver(gr_unittest.TestCase):
-
- def setUp(self):
- self.tb = gr.top_block()
-
- def tearDown(self):
- self.tb = None
-
- def test01(self):
- # Test BPSK sync
- M = 2
- theta = 0
- loop_bw = cmath.pi/100.0
- fmin = -0.5
- fmax = 0.5
- mu = 0.5
- gain_mu = 0.01
- omega = 2
- gain_omega = 0.001
- omega_rel = 0.001
-
- self.test = digital.mpsk_receiver_cc(M, theta, loop_bw,
- fmin, fmax, mu, gain_mu,
- omega, gain_omega,
- omega_rel)
-
- data = 10000*[complex(1,0), complex(-1,0)]
- #data = [2*random.randint(0,1)-1 for x in xrange(10000)]
- self.src = blocks.vector_source_c(data, False)
- self.snk = blocks.vector_sink_c()
-
- # pulse shaping interpolation filter
- nfilts = 32
- excess_bw = 0.35
- ntaps = 11 * int(omega*nfilts)
- rrc_taps0 = filter.firdes.root_raised_cosine(
- nfilts, nfilts, 1.0, excess_bw, ntaps)
- rrc_taps1 = filter.firdes.root_raised_cosine(
- 1, omega, 1.0, excess_bw, 11*omega)
- self.rrc0 = filter.pfb_arb_resampler_ccf(omega, rrc_taps0)
- self.rrc1 = filter.fir_filter_ccf(1, rrc_taps1)
-
- self.tb.connect(self.src, self.rrc0, self.rrc1, self.test, self.snk)
- self.tb.run()
-
- expected_result = [-0.5*d for d in data]
- dst_data = self.snk.data()
-
- # Only Ncmp samples after Nstrt samples
- Nstrt = 9000
- Ncmp = 1000
- expected_result = expected_result[Nstrt:Nstrt+Ncmp]
- dst_data = dst_data[Nstrt:Nstrt+Ncmp]
-
- #for e,d in zip(expected_result, dst_data):
- # print "{0:+.02f} {1:+.02f}".format(e, d)
-
- self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 1)
-
-
- def test02(self):
- # Test QPSK sync
- M = 4
- theta = 0
- loop_bw = cmath.pi/100.0
- fmin = -0.5
- fmax = 0.5
- mu = 0.5
- gain_mu = 0.01
- omega = 2
- gain_omega = 0.001
- omega_rel = 0.001
-
- self.test = digital.mpsk_receiver_cc(M, theta, loop_bw,
- fmin, fmax, mu, gain_mu,
- omega, gain_omega,
- omega_rel)
-
- data = 10000*[complex( 0.707, 0.707),
- complex(-0.707, 0.707),
- complex(-0.707, -0.707),
- complex( 0.707, -0.707)]
- data = [0.5*d for d in data]
- self.src = blocks.vector_source_c(data, False)
- self.snk = blocks.vector_sink_c()
-
- # pulse shaping interpolation filter
- nfilts = 32
- excess_bw = 0.35
- ntaps = 11 * int(omega*nfilts)
- rrc_taps0 = filter.firdes.root_raised_cosine(
- nfilts, nfilts, 1.0, excess_bw, ntaps)
- rrc_taps1 = filter.firdes.root_raised_cosine(
- 1, omega, 1.0, excess_bw, 11*omega)
- self.rrc0 = filter.pfb_arb_resampler_ccf(omega, rrc_taps0)
- self.rrc1 = filter.fir_filter_ccf(1, rrc_taps1)
-
- self.tb.connect(self.src, self.rrc0, self.rrc1, self.test, self.snk)
- self.tb.run()
-
- expected_result = 10000*[complex(-0.5, +0.0), complex(+0.0, -0.5),
- complex(+0.5, +0.0), complex(+0.0, +0.5)]
-
- dst_data = self.snk.data()
-
- # Only Ncmp samples after Nstrt samples
- Nstrt = 9000
- Ncmp = 1000
- expected_result = expected_result[Nstrt:Nstrt+Ncmp]
- dst_data = dst_data[Nstrt:Nstrt+Ncmp]
-
- #for e,d in zip(expected_result, dst_data):
- # print "{0:+.02f} {1:+.02f}".format(e, d)
-
- self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 1)
-
-if __name__ == '__main__':
- gr_unittest.run(test_mpsk_receiver, "test_mpsk_receiver.xml")
diff --git a/gr-digital/python/digital/qa_ofdm_insert_preamble.py b/gr-digital/python/digital/qa_ofdm_insert_preamble.py
deleted file mode 100755
index 4edd54c8c6..0000000000
--- a/gr-digital/python/digital/qa_ofdm_insert_preamble.py
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2007,2010-2013 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 pprint import pprint
-
-from gnuradio import gr, gr_unittest, digital, blocks
-
-class test_ofdm_insert_preamble(gr_unittest.TestCase):
-
- def setUp(self):
- self.tb = gr.top_block()
-
- def tearDown(self):
- self.tb = None
-
- def helper(self, v0, v1, fft_length, preamble):
- tb = self.tb
- src0 = blocks.vector_source_c(v0)
- src1 = blocks.vector_source_b(v1)
-
- s2v = blocks.stream_to_vector(gr.sizeof_gr_complex, fft_length)
-
- # print "len(v) = %d" % (len(v))
-
- op = digital.ofdm_insert_preamble(fft_length, preamble)
-
- v2s = blocks.vector_to_stream(gr.sizeof_gr_complex, fft_length)
- dst0 = blocks.vector_sink_c()
- dst1 = blocks.vector_sink_b()
-
- tb.connect(src0, s2v, (op, 0))
- tb.connect(src1, (op, 1))
- tb.connect((op, 0), v2s, dst0)
- tb.connect((op, 1), dst1)
-
- tb.run()
- r0 = dst0.data()
- r0v = []
- for i in range(len(r0)//fft_length):
- r0v.append(r0[i*fft_length:(i+1)*fft_length])
-
- r1 = dst1.data()
- self.assertEqual(len(r0v), len(r1))
- return (r1, r0v)
-
- def check_match(self, actual, expected_list):
- lst = []
- map(lambda x: lst.append(x), expected_list)
- self.assertEqual(actual, lst)
-
-
- # ----------------------------------------------------------------
-
- def test_000(self):
- # no preamble, 1 symbol payloads
-
- preamble = ()
- fft_length = 8
- npayloads = 8
- v = []
- p = []
- for i in range(npayloads):
- t = fft_length*[(i + i*1j)]
- p.append(tuple(t))
- v += t
-
- p = tuple(p)
-
- r = self.helper(v, npayloads*[1], fft_length, preamble)
- # pprint(r)
-
- self.assertEqual(r[0], tuple(npayloads*[1]))
- self.check_match(r[1], (p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7]))
-
-
- def test_001(self):
- # 1 symbol preamble, 1 symbol payloads
- preamble = ((100, 101, 102, 103, 104, 105, 106, 107),)
- p0 = preamble[0]
- fft_length = 8
- npayloads = 8
- v = []
- p = []
- for i in range(npayloads):
- t = fft_length*[(i + i*1j)]
- p.append(tuple(t))
- v += t
-
- r = self.helper(v, npayloads*[1], fft_length, preamble)
-
- self.assertEqual(r[0], tuple(npayloads*[1, 0]))
- self.check_match(r[1], (p0, p[0],
- p0, p[1],
- p0, p[2],
- p0, p[3],
- p0, p[4],
- p0, p[5],
- p0, p[6],
- p0, p[7]))
-
- def test_002(self):
- # 2 symbol preamble, 1 symbol payloads
- preamble = ((100, 101, 102, 103, 104, 105, 106, 107),
- (200, 201, 202, 203, 204, 205, 206, 207))
- p0 = preamble[0]
- p1 = preamble[1]
-
- fft_length = 8
- npayloads = 8
- v = []
- p = []
- for i in range(npayloads):
- t = fft_length*[(i + i*1j)]
- p.append(tuple(t))
- v += t
-
- r = self.helper(v, npayloads*[1], fft_length, preamble)
-
- self.assertEqual(r[0], tuple(npayloads*[1, 0, 0]))
- self.check_match(r[1], (p0, p1, p[0],
- p0, p1, p[1],
- p0, p1, p[2],
- p0, p1, p[3],
- p0, p1, p[4],
- p0, p1, p[5],
- p0, p1, p[6],
- p0, p1, p[7]))
-
-
- def xtest_003_preamble(self):
- # 2 symbol preamble, 2 symbol payloads
- preamble = ((100, 101, 102, 103, 104, 105, 106, 107),
- (200, 201, 202, 203, 204, 205, 206, 207))
- p0 = preamble[0]
- p1 = preamble[1]
-
- fft_length = 8
- npayloads = 8
- v = []
- p = []
- for i in range(npayloads * 2):
- t = fft_length*[(i + i*1j)]
- p.append(tuple(t))
- v += t
-
- r = self.helper(v, npayloads*[1, 0], fft_length, preamble)
-
- self.assertEqual(r[0], tuple(npayloads*[1, 0, 0, 0]))
- self.check_match(r[1], (p0, p1, p[0], p[1],
- p0, p1, p[2], p[3],
- p0, p1, p[4], p[5],
- p0, p1, p[6], p[7],
- p0, p1, p[8], p[9],
- p0, p1, p[10], p[11],
- p0, p1, p[12], p[13],
- p0, p1, p[14], p[15]))
-
-if __name__ == '__main__':
- gr_unittest.run(test_ofdm_insert_preamble, "test_ofdm_insert_preamble.xml")
diff --git a/gr-digital/python/grc_gnuradio/blks2/packet.py b/gr-digital/python/grc_gnuradio/blks2/packet.py
deleted file mode 100644
index ef79afde64..0000000000
--- a/gr-digital/python/grc_gnuradio/blks2/packet.py
+++ /dev/null
@@ -1,257 +0,0 @@
-# Copyright 2008,2009,2012-2013 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, digital
-from gnuradio import blocks
-from gnuradio.digital import packet_utils
-import gnuradio.gr.gr_threading as _threading
-
-##payload length in bytes
-DEFAULT_PAYLOAD_LEN = 512
-
-##how many messages in a queue
-DEFAULT_MSGQ_LIMIT = 2
-
-##threshold for unmaking packets
-DEFAULT_THRESHOLD = 12
-
-##################################################
-## Options Class for OFDM
-##################################################
-class options(object):
- def __init__(self, **kwargs):
- for key, value in kwargs.iteritems(): setattr(self, key, value)
-
-##################################################
-## Packet Encoder
-##################################################
-class _packet_encoder_thread(_threading.Thread):
-
- def __init__(self, msgq, payload_length, send):
- self._msgq = msgq
- self._payload_length = payload_length
- self._send = send
- _threading.Thread.__init__(self)
- self.setDaemon(1)
- self.keep_running = True
- self.start()
-
- def run(self):
- sample = '' #residual sample
- while self.keep_running:
- msg = self._msgq.delete_head() #blocking read of message queue
- sample = sample + msg.to_string() #get the body of the msg as a string
- while len(sample) >= self._payload_length:
- payload = sample[:self._payload_length]
- sample = sample[self._payload_length:]
- self._send(payload)
-
-class packet_encoder(gr.hier_block2):
- """
- Hierarchical block for wrapping packet-based modulators.
- """
-
- def __init__(self, samples_per_symbol, bits_per_symbol, preamble='', access_code='', pad_for_usrp=True):
- """
- packet_mod constructor.
-
- Args:
- samples_per_symbol: number of samples per symbol
- bits_per_symbol: number of bits per symbol
- preamble: string of ascii 0's and 1's
- access_code: AKA sync vector
- pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples
- """
- #setup parameters
- self._samples_per_symbol = samples_per_symbol
- self._bits_per_symbol = bits_per_symbol
- self._pad_for_usrp = pad_for_usrp
- if not preamble: #get preamble
- preamble = packet_utils.default_preamble
- if not access_code: #get access code
- access_code = packet_utils.default_access_code
- if not packet_utils.is_1_0_string(preamble):
- raise ValueError, "Invalid preamble %r. Must be string of 1's and 0's" % (preamble,)
- if not packet_utils.is_1_0_string(access_code):
- raise ValueError, "Invalid access_code %r. Must be string of 1's and 0's" % (access_code,)
- self._preamble = preamble
- self._access_code = access_code
- self._pad_for_usrp = pad_for_usrp
- #create blocks
- msg_source = blocks.message_source(gr.sizeof_char, DEFAULT_MSGQ_LIMIT)
- self._msgq_out = msg_source.msgq()
- #initialize hier2
- gr.hier_block2.__init__(
- self,
- "packet_encoder",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char) # Output signature
- )
- #connect
- self.connect(msg_source, self)
-
- def send_pkt(self, payload):
- """
- Wrap the payload in a packet and push onto the message queue.
-
- Args:
- payload: string, data to send
- """
- packet = packet_utils.make_packet(
- payload,
- self._samples_per_symbol,
- self._bits_per_symbol,
- self._preamble,
- self._access_code,
- self._pad_for_usrp
- )
- msg = gr.message_from_string(packet)
- self._msgq_out.insert_tail(msg)
-
-##################################################
-## Packet Decoder
-##################################################
-class _packet_decoder_thread(_threading.Thread):
-
- def __init__(self, msgq, callback):
- _threading.Thread.__init__(self)
- self.setDaemon(1)
- self._msgq = msgq
- self.callback = callback
- self.keep_running = True
- self.start()
-
- def run(self):
- while self.keep_running:
- msg = self._msgq.delete_head()
- ok, payload = packet_utils.unmake_packet(msg.to_string(), int(msg.arg1()))
- if self.callback:
- self.callback(ok, payload)
-
-class packet_decoder(gr.hier_block2):
- """
- Hierarchical block for wrapping packet-based demodulators.
- """
-
- def __init__(self, access_code='', threshold=-1, callback=None):
- """
- packet_demod constructor.
-
- Args:
- access_code: AKA sync vector
- threshold: detect access_code with up to threshold bits wrong (0 -> use default)
- callback: a function of args: ok, payload
- """
- #access code
- if not access_code: #get access code
- access_code = packet_utils.default_access_code
- if not packet_utils.is_1_0_string(access_code):
- raise ValueError, "Invalid access_code %r. Must be string of 1's and 0's" % (access_code,)
- self._access_code = access_code
- #threshold
- if threshold < 0: threshold = DEFAULT_THRESHOLD
- self._threshold = threshold
- #blocks
- msgq = gr.msg_queue(DEFAULT_MSGQ_LIMIT) #holds packets from the PHY
- correlator = digital.correlate_access_code_bb(self._access_code, self._threshold)
- framer_sink = digital.framer_sink_1(msgq)
- #initialize hier2
- gr.hier_block2.__init__(
- self,
- "packet_decoder",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(0, 0, 0) # Output signature
- )
- #connect
- self.connect(self, correlator, framer_sink)
- #start thread
- _packet_decoder_thread(msgq, callback)
-
-##################################################
-## Packet Mod for OFDM Mod and Packet Encoder
-##################################################
-class packet_mod_base(gr.hier_block2):
- """
- Hierarchical block for wrapping packet source block.
- """
-
- def __init__(self, packet_source=None, payload_length=0):
- if not payload_length: #get payload length
- payload_length = DEFAULT_PAYLOAD_LEN
- if payload_length%self._item_size_in != 0: #verify that packet length is a multiple of the stream size
- raise ValueError, 'The payload length: "%d" is not a mutiple of the stream size: "%d".'%(payload_length, self._item_size_in)
- #initialize hier2
- gr.hier_block2.__init__(
- self,
- "ofdm_mod",
- gr.io_signature(1, 1, self._item_size_in), # Input signature
- gr.io_signature(1, 1, packet_source.output_signature().sizeof_stream_item(0)) # Output signature
- )
- #create blocks
- msgq = gr.msg_queue(DEFAULT_MSGQ_LIMIT)
- msg_sink = blocks.message_sink(self._item_size_in, msgq, False) #False -> blocking
- #connect
- self.connect(self, msg_sink)
- self.connect(packet_source, self)
- #start thread
- _packet_encoder_thread(msgq, payload_length, packet_source.send_pkt)
-
-class packet_mod_b(packet_mod_base): _item_size_in = gr.sizeof_char
-class packet_mod_s(packet_mod_base): _item_size_in = gr.sizeof_short
-class packet_mod_i(packet_mod_base): _item_size_in = gr.sizeof_int
-class packet_mod_f(packet_mod_base): _item_size_in = gr.sizeof_float
-class packet_mod_c(packet_mod_base): _item_size_in = gr.sizeof_gr_complex
-
-##################################################
-## Packet Demod for OFDM Demod and Packet Decoder
-##################################################
-class packet_demod_base(gr.hier_block2):
- """
- Hierarchical block for wrapping packet sink block.
- """
-
- def __init__(self, packet_sink=None):
- #initialize hier2
- gr.hier_block2.__init__(
- self,
- "ofdm_mod",
- gr.io_signature(1, 1, packet_sink.input_signature().sizeof_stream_item(0)), # Input signature
- gr.io_signature(1, 1, self._item_size_out) # Output signature
- )
- #create blocks
- msg_source = blocks.message_source(self._item_size_out, DEFAULT_MSGQ_LIMIT)
- self._msgq_out = msg_source.msgq()
- #connect
- self.connect(self, packet_sink)
- self.connect(msg_source, self)
- if packet_sink.output_signature().sizeof_stream_item(0):
- self.connect(packet_sink,
- blocks.null_sink(packet_sink.output_signature().sizeof_stream_item(0)))
-
- def recv_pkt(self, ok, payload):
- msg = gr.message_from_string(payload, 0, self._item_size_out,
- len(payload)/self._item_size_out)
- if ok: self._msgq_out.insert_tail(msg)
-
-class packet_demod_b(packet_demod_base): _item_size_out = gr.sizeof_char
-class packet_demod_s(packet_demod_base): _item_size_out = gr.sizeof_short
-class packet_demod_i(packet_demod_base): _item_size_out = gr.sizeof_int
-class packet_demod_f(packet_demod_base): _item_size_out = gr.sizeof_float
-class packet_demod_c(packet_demod_base): _item_size_out = gr.sizeof_gr_complex
diff --git a/gr-digital/swig/CMakeLists.txt b/gr-digital/swig/CMakeLists.txt
index 0f1138ff30..658ac46ed6 100644
--- a/gr-digital/swig/CMakeLists.txt
+++ b/gr-digital/swig/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2011,2012 Free Software Foundation, Inc.
+# Copyright 2011-2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -24,45 +24,70 @@ include(GrPython)
include(GrSwig)
set(GR_SWIG_INCLUDE_DIRS
- ${GR_DIGITAL_INCLUDE_DIRS}
- ${GR_BLOCKS_INCLUDE_DIRS}
- ${GR_ANALOG_INCLUDE_DIRS}
- ${GR_FFT_INCLUDE_DIRS}
- ${GR_FILTER_INCLUDE_DIRS}
- ${GNURADIO_RUNTIME_SWIG_INCLUDE_DIRS}
- ${VOLK_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS}
+ ${GR_DIGITAL_INCLUDE_DIRS}
+ ${GR_BLOCKS_INCLUDE_DIRS}
+ ${GR_ANALOG_INCLUDE_DIRS}
+ ${GR_FFT_INCLUDE_DIRS}
+ ${GR_FILTER_INCLUDE_DIRS}
+ ${GNURADIO_RUNTIME_SWIG_INCLUDE_DIRS}
+ ${VOLK_INCLUDE_DIRS}
+ ${Boost_INCLUDE_DIRS}
)
if(ENABLE_GR_CTRLPORT)
list(APPEND GR_SWIG_FLAGS "-DGR_CTRLPORT")
endif(ENABLE_GR_CTRLPORT)
-# Setup swig docs to depend on includes and pull in from build directory
-set(GR_SWIG_TARGET_DEPS digital_generated_includes)
-set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/digital_swig_doc.i)
-set(GR_SWIG_DOC_DIRS
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/digital_swig.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/digital_swig.py
+@ONLY)
+
+# We split up the swig files into multiple sections to minimize the
+# memory overhead. If a .i file grows too large, create a new file
+# named 'digital_swigN.i' and add it to this list.
+#
+# Also add the line "from swig_blocksN import *" line to
+# digital_swig.py.in.
+set(GR_SWIG_BLOCK_IFILES
+ digital_swig0
+ digital_swig1
+ digital_swig2
+)
+
+foreach(swigfile ${GR_SWIG_BLOCK_IFILES})
+ set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${swigfile}_doc.i)
+ set(GR_SWIG_DOC_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/digital
${CMAKE_CURRENT_BINARY_DIR}/../include/gnuradio/digital
-)
-set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc)
+ )
+ set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc)
+ set(GR_SWIG_TARGET_DEPS digital_generated_includes)
+ set(GR_SWIG_LIBRARIES gnuradio-digital
+ gnuradio-filter gnuradio-analog gnuradio-blocks)
+ GR_SWIG_MAKE(${swigfile} ${swigfile}.i)
-set(GR_SWIG_LIBRARIES gnuradio-digital
- gnuradio-filter gnuradio-analog gnuradio-blocks)
+ GR_SWIG_INSTALL(
+ TARGETS ${swigfile}
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/digital
+ )
-GR_SWIG_MAKE(digital_swig digital_swig.i)
+ list(APPEND SWIGFILES ${swigfile}.i)
+ list(APPEND SWIGDOCFILES ${CMAKE_CURRENT_BINARY_DIR}/${swigfile}_doc.i)
+endforeach(swigfile)
-GR_SWIG_INSTALL(
- TARGETS digital_swig
- DESTINATION ${GR_PYTHON_DIR}/gnuradio/digital
+install(
+ FILES
+ ${SWIGFILES}
+ constellation.i
+ ofdm_equalizer.i
+ packet_header.i
+ ${SWIGDOCFILES}
+ DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
)
-install(
- FILES
- digital_swig.i
- constellation.i
- ofdm_equalizer.i
- packet_header.i
- ${CMAKE_CURRENT_BINARY_DIR}/digital_swig_doc.i
- DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
+# Install the Python file that pulls in the swig built files.
+GR_PYTHON_INSTALL(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/digital_swig.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/digital
)
diff --git a/gr-digital/swig/digital_swig.i b/gr-digital/swig/digital_swig.i
deleted file mode 100644
index 6039554623..0000000000
--- a/gr-digital/swig/digital_swig.i
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright 2011-2016 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.
- */
-
-#define DIGITAL_API
-#define ANALOG_API
-#define BLOCKS_API
-
-%include "gnuradio.i"
-%include "stdint.i"
-
-//load generated python docstrings
-%include "digital_swig_doc.i"
-
-%include "gnuradio/analog/cpm.h"
-
-%{
-#include <gnuradio/blocks/control_loop.h>
-%}
-%include <gnuradio/blocks/control_loop.h>
-
-%{
-#include "gnuradio/digital/glfsr.h"
-#include "gnuradio/digital/additive_scrambler_bb.h"
-#include "gnuradio/digital/binary_slicer_fb.h"
-#include "gnuradio/digital/burst_shaper_cc.h"
-#include "gnuradio/digital/burst_shaper_ff.h"
-#include "gnuradio/digital/chunks_to_symbols_bc.h"
-#include "gnuradio/digital/chunks_to_symbols_bf.h"
-#include "gnuradio/digital/chunks_to_symbols_ic.h"
-#include "gnuradio/digital/chunks_to_symbols_if.h"
-#include "gnuradio/digital/chunks_to_symbols_sc.h"
-#include "gnuradio/digital/chunks_to_symbols_sf.h"
-#include "gnuradio/digital/clock_recovery_mm_cc.h"
-#include "gnuradio/digital/clock_recovery_mm_ff.h"
-#include "gnuradio/digital/cma_equalizer_cc.h"
-#include "gnuradio/digital/constellation.h"
-#include "gnuradio/digital/constellation_decoder_cb.h"
-#include "gnuradio/digital/constellation_receiver_cb.h"
-#include "gnuradio/digital/constellation_soft_decoder_cf.h"
-#include "gnuradio/digital/corr_est_cc.h"
-#include "gnuradio/digital/correlate_access_code_bb.h"
-#include "gnuradio/digital/correlate_access_code_tag_bb.h"
-#include "gnuradio/digital/correlate_access_code_bb_ts.h"
-#include "gnuradio/digital/correlate_access_code_ff_ts.h"
-#include "gnuradio/digital/costas_loop_cc.h"
-#include "gnuradio/digital/cpmmod_bc.h"
-#include "gnuradio/digital/crc32.h"
-#include "gnuradio/digital/crc32_bb.h"
-#include "gnuradio/digital/crc32_async_bb.h"
-#include "gnuradio/digital/descrambler_bb.h"
-#include "gnuradio/digital/diff_decoder_bb.h"
-#include "gnuradio/digital/diff_encoder_bb.h"
-#include "gnuradio/digital/diff_phasor_cc.h"
-#include "gnuradio/digital/fll_band_edge_cc.h"
-#include "gnuradio/digital/framer_sink_1.h"
-#include "gnuradio/digital/glfsr_source_b.h"
-#include "gnuradio/digital/glfsr_source_f.h"
-#include "gnuradio/digital/hdlc_deframer_bp.h"
-#include "gnuradio/digital/hdlc_framer_pb.h"
-#include "gnuradio/digital/header_payload_demux.h"
-#include "gnuradio/digital/kurtotic_equalizer_cc.h"
-#include "gnuradio/digital/lfsr.h"
-#include "gnuradio/digital/lms_dd_equalizer_cc.h"
-#include "gnuradio/digital/map_bb.h"
-#include "gnuradio/digital/metric_type.h"
-#include "gnuradio/digital/modulate_vector.h"
-#include "gnuradio/digital/mpsk_receiver_cc.h"
-#include "gnuradio/digital/mpsk_snr_est.h"
-#include "gnuradio/digital/mpsk_snr_est_cc.h"
-#include "gnuradio/digital/msk_timing_recovery_cc.h"
-#include "gnuradio/digital/ofdm_carrier_allocator_cvc.h"
-#include "gnuradio/digital/ofdm_chanest_vcvc.h"
-#include "gnuradio/digital/ofdm_cyclic_prefixer.h"
-#include "gnuradio/digital/ofdm_equalizer_base.h"
-#include "gnuradio/digital/ofdm_equalizer_simpledfe.h"
-#include "gnuradio/digital/ofdm_equalizer_static.h"
-#include "gnuradio/digital/ofdm_frame_acquisition.h"
-#include "gnuradio/digital/ofdm_frame_equalizer_vcvc.h"
-#include "gnuradio/digital/ofdm_frame_sink.h"
-#include "gnuradio/digital/ofdm_insert_preamble.h"
-#include "gnuradio/digital/ofdm_mapper_bcv.h"
-#include "gnuradio/digital/ofdm_sampler.h"
-#include "gnuradio/digital/ofdm_serializer_vcc.h"
-#include "gnuradio/digital/ofdm_sync_sc_cfb.h"
-#include "gnuradio/digital/header_format_base.h"
-#include "gnuradio/digital/header_format_default.h"
-#include "gnuradio/digital/header_format_counter.h"
-#include "gnuradio/digital/header_format_crc.h"
-#include "gnuradio/digital/header_format_ofdm.h"
-#include "gnuradio/digital/protocol_formatter_async.h"
-#include "gnuradio/digital/protocol_formatter_bb.h"
-#include "gnuradio/digital/protocol_parser_b.h"
-#include "gnuradio/digital/packet_header_default.h"
-#include "gnuradio/digital/packet_header_ofdm.h"
-#include "gnuradio/digital/packet_headergenerator_bb.h"
-#include "gnuradio/digital/packet_headerparser_b.h"
-#include "gnuradio/digital/packet_sink.h"
-#include "gnuradio/digital/pfb_clock_sync_ccf.h"
-#include "gnuradio/digital/pfb_clock_sync_fff.h"
-#include "gnuradio/digital/pn_correlator_cc.h"
-#include "gnuradio/digital/probe_density_b.h"
-#include "gnuradio/digital/probe_mpsk_snr_est_c.h"
-#include "gnuradio/digital/scrambler_bb.h"
-#include "gnuradio/digital/simple_correlator.h"
-#include "gnuradio/digital/simple_framer.h"
-#include "gnuradio/digital/ofdm_serializer_vcc.h"
-#include "gnuradio/digital/packet_headerparser_b.h"
-#include "gnuradio/digital/header_payload_demux.h"
-%}
-
-%include "gnuradio/digital/glfsr.h"
-%include "gnuradio/digital/additive_scrambler_bb.h"
-%include "gnuradio/digital/binary_slicer_fb.h"
-%include "gnuradio/digital/burst_shaper_cc.h"
-%include "gnuradio/digital/burst_shaper_ff.h"
-%include "gnuradio/digital/chunks_to_symbols_bc.h"
-%include "gnuradio/digital/chunks_to_symbols_bf.h"
-%include "gnuradio/digital/chunks_to_symbols_ic.h"
-%include "gnuradio/digital/chunks_to_symbols_if.h"
-%include "gnuradio/digital/chunks_to_symbols_sc.h"
-%include "gnuradio/digital/chunks_to_symbols_sf.h"
-%include "gnuradio/digital/clock_recovery_mm_cc.h"
-%include "gnuradio/digital/clock_recovery_mm_ff.h"
-%include "gnuradio/digital/cma_equalizer_cc.h"
-%include "gnuradio/digital/constellation.h"
-%include "gnuradio/digital/constellation_decoder_cb.h"
-%include "gnuradio/digital/constellation_receiver_cb.h"
-%include "gnuradio/digital/constellation_soft_decoder_cf.h"
-%include "gnuradio/digital/corr_est_cc.h"
-%include "gnuradio/digital/correlate_access_code_bb.h"
-%include "gnuradio/digital/correlate_access_code_tag_bb.h"
-%include "gnuradio/digital/correlate_access_code_bb_ts.h"
-%include "gnuradio/digital/correlate_access_code_ff_ts.h"
-%include "gnuradio/digital/costas_loop_cc.h"
-%include "gnuradio/digital/cpmmod_bc.h"
-%include "gnuradio/digital/crc32.h"
-%include "gnuradio/digital/crc32_bb.h"
-%include "gnuradio/digital/crc32_async_bb.h"
-%include "gnuradio/digital/descrambler_bb.h"
-%include "gnuradio/digital/diff_decoder_bb.h"
-%include "gnuradio/digital/diff_encoder_bb.h"
-%include "gnuradio/digital/diff_phasor_cc.h"
-%include "gnuradio/digital/fll_band_edge_cc.h"
-%include "gnuradio/digital/framer_sink_1.h"
-%include "gnuradio/digital/glfsr_source_b.h"
-%include "gnuradio/digital/glfsr_source_f.h"
-%include "gnuradio/digital/hdlc_deframer_bp.h"
-%include "gnuradio/digital/hdlc_framer_pb.h"
-%include "gnuradio/digital/header_payload_demux.h"
-%include "gnuradio/digital/kurtotic_equalizer_cc.h"
-%include "gnuradio/digital/lfsr.h"
-%include "gnuradio/digital/lms_dd_equalizer_cc.h"
-%include "gnuradio/digital/map_bb.h"
-%include "gnuradio/digital/metric_type.h"
-%include "gnuradio/digital/modulate_vector.h"
-%include "gnuradio/digital/mpsk_receiver_cc.h"
-%include "gnuradio/digital/mpsk_snr_est.h"
-%include "gnuradio/digital/mpsk_snr_est_cc.h"
-%include "gnuradio/digital/msk_timing_recovery_cc.h"
-%include "gnuradio/digital/ofdm_carrier_allocator_cvc.h"
-%include "gnuradio/digital/ofdm_chanest_vcvc.h"
-%include "gnuradio/digital/ofdm_cyclic_prefixer.h"
-%include "gnuradio/digital/ofdm_equalizer_base.h"
-%include "gnuradio/digital/ofdm_equalizer_simpledfe.h"
-%include "gnuradio/digital/ofdm_equalizer_static.h"
-%include "gnuradio/digital/ofdm_frame_acquisition.h"
-%include "gnuradio/digital/ofdm_frame_equalizer_vcvc.h"
-%include "gnuradio/digital/ofdm_frame_sink.h"
-%include "gnuradio/digital/ofdm_insert_preamble.h"
-%include "gnuradio/digital/ofdm_mapper_bcv.h"
-%include "gnuradio/digital/ofdm_sampler.h"
-%include "gnuradio/digital/ofdm_serializer_vcc.h"
-%include "gnuradio/digital/ofdm_sync_sc_cfb.h"
-%include "gnuradio/digital/header_format_base.h"
-%include "gnuradio/digital/header_format_default.h"
-%include "gnuradio/digital/header_format_counter.h"
-%include "gnuradio/digital/header_format_crc.h"
-%include "gnuradio/digital/header_format_ofdm.h"
-%include "gnuradio/digital/protocol_formatter_async.h"
-%include "gnuradio/digital/protocol_formatter_bb.h"
-%include "gnuradio/digital/protocol_parser_b.h"
-%include "gnuradio/digital/packet_header_default.h"
-%include "gnuradio/digital/packet_header_ofdm.h"
-%include "gnuradio/digital/packet_headergenerator_bb.h"
-%include "gnuradio/digital/packet_headerparser_b.h"
-%include "gnuradio/digital/packet_sink.h"
-%include "gnuradio/digital/pfb_clock_sync_ccf.h"
-%include "gnuradio/digital/pfb_clock_sync_fff.h"
-%include "gnuradio/digital/pn_correlator_cc.h"
-%include "gnuradio/digital/probe_density_b.h"
-%include "gnuradio/digital/probe_mpsk_snr_est_c.h"
-%include "gnuradio/digital/scrambler_bb.h"
-%include "gnuradio/digital/simple_correlator.h"
-%include "gnuradio/digital/simple_framer.h"
-
-GR_SWIG_BLOCK_MAGIC2(digital, additive_scrambler_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, binary_slicer_fb);
-GR_SWIG_BLOCK_MAGIC2(digital, burst_shaper_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, burst_shaper_ff);
-GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_bc);
-GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_bf);
-GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_ic);
-GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_if);
-GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_sc);
-GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_sf);
-GR_SWIG_BLOCK_MAGIC2(digital, clock_recovery_mm_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, clock_recovery_mm_ff);
-GR_SWIG_BLOCK_MAGIC2(digital, cma_equalizer_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, constellation_decoder_cb);
-GR_SWIG_BLOCK_MAGIC2(digital, constellation_receiver_cb);
-GR_SWIG_BLOCK_MAGIC2(digital, constellation_soft_decoder_cf);
-GR_SWIG_BLOCK_MAGIC2(digital, corr_est_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_tag_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_bb_ts);
-GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_ff_ts);
-GR_SWIG_BLOCK_MAGIC2(digital, costas_loop_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, crc32_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, crc32_async_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, cpmmod_bc);
-GR_SWIG_BLOCK_MAGIC2(digital, descrambler_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, diff_decoder_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, diff_encoder_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, diff_phasor_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, fll_band_edge_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, framer_sink_1);
-GR_SWIG_BLOCK_MAGIC2(digital, glfsr_source_b);
-GR_SWIG_BLOCK_MAGIC2(digital, glfsr_source_f);
-GR_SWIG_BLOCK_MAGIC2(digital, hdlc_deframer_bp);
-GR_SWIG_BLOCK_MAGIC2(digital, hdlc_framer_pb);
-GR_SWIG_BLOCK_MAGIC2(digital, header_payload_demux);
-GR_SWIG_BLOCK_MAGIC2(digital, kurtotic_equalizer_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, lms_dd_equalizer_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, map_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, mpsk_receiver_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, mpsk_snr_est_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, msk_timing_recovery_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_carrier_allocator_cvc);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_chanest_vcvc);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_cyclic_prefixer);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_frame_acquisition);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_frame_equalizer_vcvc);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_frame_sink);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_insert_preamble);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_mapper_bcv);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_sampler);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_serializer_vcc);
-GR_SWIG_BLOCK_MAGIC2(digital, ofdm_sync_sc_cfb);
-GR_SWIG_BLOCK_MAGIC2(digital, protocol_formatter_async);
-GR_SWIG_BLOCK_MAGIC2(digital, protocol_formatter_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, protocol_parser_b);
-GR_SWIG_BLOCK_MAGIC2(digital, packet_headergenerator_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, packet_headerparser_b);
-GR_SWIG_BLOCK_MAGIC2(digital, packet_sink);
-GR_SWIG_BLOCK_MAGIC2(digital, pfb_clock_sync_ccf);
-GR_SWIG_BLOCK_MAGIC2(digital, pfb_clock_sync_fff);
-GR_SWIG_BLOCK_MAGIC2(digital, pn_correlator_cc);
-GR_SWIG_BLOCK_MAGIC2(digital, probe_density_b);
-GR_SWIG_BLOCK_MAGIC2(digital, probe_mpsk_snr_est_c);
-GR_SWIG_BLOCK_MAGIC2(digital, scrambler_bb);
-GR_SWIG_BLOCK_MAGIC2(digital, simple_correlator);
-GR_SWIG_BLOCK_MAGIC2(digital, simple_framer);
-
-GR_SWIG_BLOCK_MAGIC_FACTORY(digital, cpmmod_bc, gmskmod_bc);
-
-// Properly package up non-block objects
-%include "constellation.i"
-%include "packet_header.i"
-%include "ofdm_equalizer.i"
diff --git a/gr-digital/python/grc_gnuradio/CMakeLists.txt b/gr-digital/swig/digital_swig.py.in
index 7284573775..d5d55a0f4e 100644
--- a/gr-digital/python/grc_gnuradio/CMakeLists.txt
+++ b/gr-digital/swig/digital_swig.py.in
@@ -1,4 +1,5 @@
-# Copyright 2011 Free Software Foundation, Inc.
+#
+# Copyright 2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -16,14 +17,8 @@
# 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)
-
-# __init__ files come from gr-blocks
-
-GR_PYTHON_INSTALL(FILES
- blks2/packet.py
- DESTINATION ${GR_PYTHON_DIR}/grc_gnuradio/blks2
-)
+from digital_swig0 import *
+from digital_swig1 import *
+from digital_swig2 import *
diff --git a/gr-digital/swig/digital_swig0.i b/gr-digital/swig/digital_swig0.i
new file mode 100644
index 0000000000..4741cc08e5
--- /dev/null
+++ b/gr-digital/swig/digital_swig0.i
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2011-2016 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.
+ */
+
+#define DIGITAL_API
+#define ANALOG_API
+#define BLOCKS_API
+
+%include "gnuradio.i"
+%include "stdint.i"
+
+//load generated python docstrings
+%include "digital_swig0_doc.i"
+
+%include "gnuradio/analog/cpm.h"
+
+%{
+#include <gnuradio/blocks/control_loop.h>
+%}
+%include <gnuradio/blocks/control_loop.h>
+
+%{
+#include "gnuradio/digital/binary_slicer_fb.h"
+#include "gnuradio/digital/cma_equalizer_cc.h"
+#include "gnuradio/digital/constellation.h"
+#include "gnuradio/digital/constellation_decoder_cb.h"
+#include "gnuradio/digital/constellation_receiver_cb.h"
+#include "gnuradio/digital/constellation_soft_decoder_cf.h"
+#include "gnuradio/digital/corr_est_cc.h"
+#include "gnuradio/digital/correlate_access_code_bb.h"
+#include "gnuradio/digital/correlate_access_code_tag_bb.h"
+#include "gnuradio/digital/correlate_access_code_bb_ts.h"
+#include "gnuradio/digital/correlate_access_code_ff_ts.h"
+#include "gnuradio/digital/costas_loop_cc.h"
+#include "gnuradio/digital/cpmmod_bc.h"
+#include "gnuradio/digital/crc32.h"
+#include "gnuradio/digital/crc32_bb.h"
+#include "gnuradio/digital/crc32_async_bb.h"
+#include "gnuradio/digital/descrambler_bb.h"
+#include "gnuradio/digital/lms_dd_equalizer_cc.h"
+#include "gnuradio/digital/ofdm_carrier_allocator_cvc.h"
+#include "gnuradio/digital/ofdm_chanest_vcvc.h"
+#include "gnuradio/digital/ofdm_cyclic_prefixer.h"
+#include "gnuradio/digital/ofdm_equalizer_base.h"
+#include "gnuradio/digital/ofdm_equalizer_simpledfe.h"
+#include "gnuradio/digital/ofdm_equalizer_static.h"
+#include "gnuradio/digital/ofdm_frame_equalizer_vcvc.h"
+#include "gnuradio/digital/ofdm_serializer_vcc.h"
+#include "gnuradio/digital/ofdm_sync_sc_cfb.h"
+%}
+
+%include "gnuradio/digital/binary_slicer_fb.h"
+%include "gnuradio/digital/cma_equalizer_cc.h"
+%include "gnuradio/digital/constellation.h"
+%include "gnuradio/digital/constellation_decoder_cb.h"
+%include "gnuradio/digital/constellation_receiver_cb.h"
+%include "gnuradio/digital/constellation_soft_decoder_cf.h"
+%include "gnuradio/digital/corr_est_cc.h"
+%include "gnuradio/digital/correlate_access_code_bb.h"
+%include "gnuradio/digital/correlate_access_code_tag_bb.h"
+%include "gnuradio/digital/correlate_access_code_bb_ts.h"
+%include "gnuradio/digital/correlate_access_code_ff_ts.h"
+%include "gnuradio/digital/costas_loop_cc.h"
+%include "gnuradio/digital/cpmmod_bc.h"
+%include "gnuradio/digital/crc32.h"
+%include "gnuradio/digital/crc32_bb.h"
+%include "gnuradio/digital/crc32_async_bb.h"
+%include "gnuradio/digital/descrambler_bb.h"
+%include "gnuradio/digital/lms_dd_equalizer_cc.h"
+%include "gnuradio/digital/ofdm_carrier_allocator_cvc.h"
+%include "gnuradio/digital/ofdm_chanest_vcvc.h"
+%include "gnuradio/digital/ofdm_cyclic_prefixer.h"
+%include "gnuradio/digital/ofdm_equalizer_base.h"
+%include "gnuradio/digital/ofdm_equalizer_simpledfe.h"
+%include "gnuradio/digital/ofdm_equalizer_static.h"
+%include "gnuradio/digital/ofdm_frame_equalizer_vcvc.h"
+%include "gnuradio/digital/ofdm_serializer_vcc.h"
+%include "gnuradio/digital/ofdm_sync_sc_cfb.h"
+
+GR_SWIG_BLOCK_MAGIC2(digital, binary_slicer_fb);
+GR_SWIG_BLOCK_MAGIC2(digital, cma_equalizer_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, constellation_decoder_cb);
+GR_SWIG_BLOCK_MAGIC2(digital, constellation_receiver_cb);
+GR_SWIG_BLOCK_MAGIC2(digital, constellation_soft_decoder_cf);
+GR_SWIG_BLOCK_MAGIC2(digital, corr_est_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_tag_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_bb_ts);
+GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_ff_ts);
+GR_SWIG_BLOCK_MAGIC2(digital, costas_loop_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, crc32_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, crc32_async_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, cpmmod_bc);
+GR_SWIG_BLOCK_MAGIC2(digital, descrambler_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, lms_dd_equalizer_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, ofdm_carrier_allocator_cvc);
+GR_SWIG_BLOCK_MAGIC2(digital, ofdm_chanest_vcvc);
+GR_SWIG_BLOCK_MAGIC2(digital, ofdm_cyclic_prefixer);
+GR_SWIG_BLOCK_MAGIC2(digital, ofdm_frame_equalizer_vcvc);
+GR_SWIG_BLOCK_MAGIC2(digital, ofdm_serializer_vcc);
+GR_SWIG_BLOCK_MAGIC2(digital, ofdm_sync_sc_cfb);
+
+GR_SWIG_BLOCK_MAGIC_FACTORY(digital, cpmmod_bc, gmskmod_bc);
+
+// Properly package up non-block objects
+%include "constellation.i"
+%include "ofdm_equalizer.i"
diff --git a/gr-digital/swig/digital_swig1.i b/gr-digital/swig/digital_swig1.i
new file mode 100644
index 0000000000..972ddf5cb2
--- /dev/null
+++ b/gr-digital/swig/digital_swig1.i
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2016 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.
+ */
+
+#define DIGITAL_API
+#define ANALOG_API
+#define BLOCKS_API
+
+%include "gnuradio.i"
+%include "stdint.i"
+
+//load generated python docstrings
+%include "digital_swig1_doc.i"
+
+ //%include "gnuradio/analog/cpm.h"
+
+%{
+#include <gnuradio/blocks/control_loop.h>
+%}
+%include <gnuradio/blocks/control_loop.h>
+
+%{
+#include "gnuradio/digital/additive_scrambler_bb.h"
+#include "gnuradio/digital/burst_shaper_cc.h"
+#include "gnuradio/digital/burst_shaper_ff.h"
+#include "gnuradio/digital/chunks_to_symbols_bc.h"
+#include "gnuradio/digital/chunks_to_symbols_bf.h"
+#include "gnuradio/digital/chunks_to_symbols_ic.h"
+#include "gnuradio/digital/chunks_to_symbols_if.h"
+#include "gnuradio/digital/chunks_to_symbols_sc.h"
+#include "gnuradio/digital/chunks_to_symbols_sf.h"
+#include "gnuradio/digital/clock_recovery_mm_cc.h"
+#include "gnuradio/digital/clock_recovery_mm_ff.h"
+#include "gnuradio/digital/diff_decoder_bb.h"
+#include "gnuradio/digital/diff_encoder_bb.h"
+#include "gnuradio/digital/diff_phasor_cc.h"
+#include "gnuradio/digital/fll_band_edge_cc.h"
+#include "gnuradio/digital/framer_sink_1.h"
+#include "gnuradio/digital/glfsr_source_b.h"
+#include "gnuradio/digital/glfsr_source_f.h"
+#include "gnuradio/digital/hdlc_deframer_bp.h"
+#include "gnuradio/digital/hdlc_framer_pb.h"
+#include "gnuradio/digital/header_payload_demux.h"
+#include "gnuradio/digital/kurtotic_equalizer_cc.h"
+#include "gnuradio/digital/lfsr.h"
+#include "gnuradio/digital/map_bb.h"
+#include "gnuradio/digital/metric_type.h"
+#include "gnuradio/digital/modulate_vector.h"
+#include "gnuradio/digital/msk_timing_recovery_cc.h"
+%}
+
+%include "gnuradio/digital/additive_scrambler_bb.h"
+%include "gnuradio/digital/burst_shaper_cc.h"
+%include "gnuradio/digital/burst_shaper_ff.h"
+%include "gnuradio/digital/chunks_to_symbols_bc.h"
+%include "gnuradio/digital/chunks_to_symbols_bf.h"
+%include "gnuradio/digital/chunks_to_symbols_ic.h"
+%include "gnuradio/digital/chunks_to_symbols_if.h"
+%include "gnuradio/digital/chunks_to_symbols_sc.h"
+%include "gnuradio/digital/chunks_to_symbols_sf.h"
+%include "gnuradio/digital/clock_recovery_mm_cc.h"
+%include "gnuradio/digital/clock_recovery_mm_ff.h"
+%include "gnuradio/digital/diff_decoder_bb.h"
+%include "gnuradio/digital/diff_encoder_bb.h"
+%include "gnuradio/digital/diff_phasor_cc.h"
+%include "gnuradio/digital/fll_band_edge_cc.h"
+%include "gnuradio/digital/framer_sink_1.h"
+%include "gnuradio/digital/glfsr_source_b.h"
+%include "gnuradio/digital/glfsr_source_f.h"
+%include "gnuradio/digital/hdlc_deframer_bp.h"
+%include "gnuradio/digital/hdlc_framer_pb.h"
+%include "gnuradio/digital/header_payload_demux.h"
+%include "gnuradio/digital/kurtotic_equalizer_cc.h"
+%include "gnuradio/digital/lfsr.h"
+%include "gnuradio/digital/map_bb.h"
+%include "gnuradio/digital/metric_type.h"
+%include "gnuradio/digital/modulate_vector.h"
+%include "gnuradio/digital/msk_timing_recovery_cc.h"
+
+GR_SWIG_BLOCK_MAGIC2(digital, additive_scrambler_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, burst_shaper_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, burst_shaper_ff);
+GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_bc);
+GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_bf);
+GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_ic);
+GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_if);
+GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_sc);
+GR_SWIG_BLOCK_MAGIC2(digital, chunks_to_symbols_sf);
+GR_SWIG_BLOCK_MAGIC2(digital, clock_recovery_mm_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, clock_recovery_mm_ff);
+GR_SWIG_BLOCK_MAGIC2(digital, diff_decoder_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, diff_encoder_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, diff_phasor_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, fll_band_edge_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, framer_sink_1);
+GR_SWIG_BLOCK_MAGIC2(digital, glfsr_source_b);
+GR_SWIG_BLOCK_MAGIC2(digital, glfsr_source_f);
+GR_SWIG_BLOCK_MAGIC2(digital, hdlc_deframer_bp);
+GR_SWIG_BLOCK_MAGIC2(digital, hdlc_framer_pb);
+GR_SWIG_BLOCK_MAGIC2(digital, header_payload_demux);
+GR_SWIG_BLOCK_MAGIC2(digital, kurtotic_equalizer_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, map_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, msk_timing_recovery_cc);
diff --git a/gr-digital/swig/digital_swig2.i b/gr-digital/swig/digital_swig2.i
new file mode 100644
index 0000000000..1836ad576c
--- /dev/null
+++ b/gr-digital/swig/digital_swig2.i
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2016 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.
+ */
+
+#define DIGITAL_API
+#define ANALOG_API
+#define BLOCKS_API
+
+%include "gnuradio.i"
+%include "stdint.i"
+
+//load generated python docstrings
+%include "digital_swig2_doc.i"
+
+// %include "gnuradio/analog/cpm.h"
+
+%{
+#include <gnuradio/blocks/control_loop.h>
+%}
+%include <gnuradio/blocks/control_loop.h>
+
+%{
+#include "gnuradio/digital/mpsk_snr_est.h"
+#include "gnuradio/digital/mpsk_snr_est_cc.h"
+#include "gnuradio/digital/header_format_base.h"
+#include "gnuradio/digital/header_format_default.h"
+#include "gnuradio/digital/header_format_counter.h"
+#include "gnuradio/digital/header_format_crc.h"
+#include "gnuradio/digital/header_format_ofdm.h"
+#include "gnuradio/digital/protocol_formatter_async.h"
+#include "gnuradio/digital/protocol_formatter_bb.h"
+#include "gnuradio/digital/protocol_parser_b.h"
+#include "gnuradio/digital/packet_header_default.h"
+#include "gnuradio/digital/packet_header_ofdm.h"
+#include "gnuradio/digital/packet_headergenerator_bb.h"
+#include "gnuradio/digital/packet_headerparser_b.h"
+#include "gnuradio/digital/packet_sink.h"
+#include "gnuradio/digital/pfb_clock_sync_ccf.h"
+#include "gnuradio/digital/pfb_clock_sync_fff.h"
+#include "gnuradio/digital/pn_correlator_cc.h"
+#include "gnuradio/digital/probe_density_b.h"
+#include "gnuradio/digital/probe_mpsk_snr_est_c.h"
+#include "gnuradio/digital/scrambler_bb.h"
+#include "gnuradio/digital/simple_correlator.h"
+#include "gnuradio/digital/simple_framer.h"
+#include "gnuradio/digital/ofdm_serializer_vcc.h"
+#include "gnuradio/digital/packet_headerparser_b.h"
+#include "gnuradio/digital/header_payload_demux.h"
+%}
+
+%include "gnuradio/digital/mpsk_snr_est.h"
+%include "gnuradio/digital/mpsk_snr_est_cc.h"
+%include "gnuradio/digital/header_format_base.h"
+%include "gnuradio/digital/header_format_default.h"
+%include "gnuradio/digital/header_format_counter.h"
+%include "gnuradio/digital/header_format_crc.h"
+%include "gnuradio/digital/header_format_ofdm.h"
+%include "gnuradio/digital/protocol_formatter_async.h"
+%include "gnuradio/digital/protocol_formatter_bb.h"
+%include "gnuradio/digital/protocol_parser_b.h"
+%include "gnuradio/digital/packet_header_default.h"
+%include "gnuradio/digital/packet_header_ofdm.h"
+%include "gnuradio/digital/packet_headergenerator_bb.h"
+%include "gnuradio/digital/packet_headerparser_b.h"
+%include "gnuradio/digital/packet_sink.h"
+%include "gnuradio/digital/pfb_clock_sync_ccf.h"
+%include "gnuradio/digital/pfb_clock_sync_fff.h"
+%include "gnuradio/digital/pn_correlator_cc.h"
+%include "gnuradio/digital/probe_density_b.h"
+%include "gnuradio/digital/probe_mpsk_snr_est_c.h"
+%include "gnuradio/digital/scrambler_bb.h"
+%include "gnuradio/digital/simple_correlator.h"
+%include "gnuradio/digital/simple_framer.h"
+
+GR_SWIG_BLOCK_MAGIC2(digital, mpsk_snr_est_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, protocol_formatter_async);
+GR_SWIG_BLOCK_MAGIC2(digital, protocol_formatter_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, protocol_parser_b);
+GR_SWIG_BLOCK_MAGIC2(digital, packet_headergenerator_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, packet_headerparser_b);
+GR_SWIG_BLOCK_MAGIC2(digital, packet_sink);
+GR_SWIG_BLOCK_MAGIC2(digital, pfb_clock_sync_ccf);
+GR_SWIG_BLOCK_MAGIC2(digital, pfb_clock_sync_fff);
+GR_SWIG_BLOCK_MAGIC2(digital, pn_correlator_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, probe_density_b);
+GR_SWIG_BLOCK_MAGIC2(digital, probe_mpsk_snr_est_c);
+GR_SWIG_BLOCK_MAGIC2(digital, scrambler_bb);
+GR_SWIG_BLOCK_MAGIC2(digital, simple_correlator);
+GR_SWIG_BLOCK_MAGIC2(digital, simple_framer);
+
+// Properly package up non-block objects
+%include "packet_header.i"
diff --git a/gr-dtv/CMakeLists.txt b/gr-dtv/CMakeLists.txt
index f045af5ef8..cf17d0971d 100644
--- a/gr-dtv/CMakeLists.txt
+++ b/gr-dtv/CMakeLists.txt
@@ -29,6 +29,7 @@ include(GrComponent)
GR_REGISTER_COMPONENT("gr-dtv" ENABLE_GR_DTV
Boost_FOUND
+ GSL_FOUND
ENABLE_GNURADIO_RUNTIME
ENABLE_GR_ANALOG
ENABLE_GR_FILTER
diff --git a/gr-dtv/examples/vv003-cr23.grc b/gr-dtv/examples/vv003-cr23.grc
index 4e3df5a968..a81551664c 100644
--- a/gr-dtv/examples/vv003-cr23.grc
+++ b/gr-dtv/examples/vv003-cr23.grc
@@ -351,7 +351,7 @@
<key>dtv_dvb_bbheader_bb</key>
<param>
<key>mode</key>
- <value>INPUTMODE_NORMAL</value>
+ <value>INPUTMODE_HIEFF</value>
</param>
<param>
<key>alias</key>
@@ -486,7 +486,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(632, 36)</value>
+ <value>(656, 36)</value>
</param>
<param>
<key>_rotation</key>
@@ -557,7 +557,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(856, 36)</value>
+ <value>(864, 36)</value>
</param>
<param>
<key>_rotation</key>
diff --git a/gr-dtv/examples/vv018-miso.grc b/gr-dtv/examples/vv018-miso.grc
index f3434a5dc9..b8d296b505 100644
--- a/gr-dtv/examples/vv018-miso.grc
+++ b/gr-dtv/examples/vv018-miso.grc
@@ -504,7 +504,7 @@
<key>dtv_dvb_bbheader_bb</key>
<param>
<key>mode</key>
- <value>INPUTMODE_NORMAL</value>
+ <value>INPUTMODE_HIEFF</value>
</param>
<param>
<key>alias</key>
@@ -639,7 +639,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(608, 20)</value>
+ <value>(640, 20)</value>
</param>
<param>
<key>_rotation</key>
@@ -710,7 +710,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(824, 20)</value>
+ <value>(848, 20)</value>
</param>
<param>
<key>_rotation</key>
diff --git a/gr-dtv/grc/dtv_dvbt2_framemapper_cc.xml b/gr-dtv/grc/dtv_dvbt2_framemapper_cc.xml
index 8cfb4908b6..e795c8a1dc 100644
--- a/gr-dtv/grc/dtv_dvbt2_framemapper_cc.xml
+++ b/gr-dtv/grc/dtv_dvbt2_framemapper_cc.xml
@@ -494,12 +494,12 @@ $inputmode.val, $reservedbiasbits.val, $l1scrambled.val, $inband.val)</make>
<hide>$version.hide_131</hide>
<option>
<name>Normal</name>
- <key>FECFRAME_NORMAL</key>
+ <key>INPUTMODE_NORMAL</key>
<opt>val:dtv.INPUTMODE_NORMAL</opt>
</option>
<option>
<name>High Efficiency</name>
- <key>FECFRAME_SHORT</key>
+ <key>INPUTMODE_HIEFF</key>
<opt>val:dtv.INPUTMODE_HIEFF</opt>
</option>
</param>
diff --git a/gr-dtv/lib/atsc/atsc_sync_impl.cc b/gr-dtv/lib/atsc/atsc_sync_impl.cc
index d83bccc5e0..7ecc33612a 100644
--- a/gr-dtv/lib/atsc/atsc_sync_impl.cc
+++ b/gr-dtv/lib/atsc/atsc_sync_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2014 Free Software Foundation, Inc.
+ * Copyright 2014,2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -35,8 +35,8 @@ namespace gr {
static const double ADJUSTMENT_GAIN = 1.0e-5 / (10 * ATSC_DATA_SEGMENT_LENGTH);
static const int SYMBOL_INDEX_OFFSET = 3;
static const int MIN_SEG_LOCK_CORRELATION_VALUE = 5;
- static const int SSI_MIN = -16;
- static const int SSI_MAX = 15;
+ static const char SSI_MIN = -16;
+ static const char SSI_MAX = 15;
atsc_sync::sptr
atsc_sync::make(float rate)
@@ -62,9 +62,6 @@ namespace gr {
d_w = d_rx_clock_to_symbol_freq;
d_mu = 0.5;
- for (int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++)
- sample_mem[i] = 0;
-
d_timing_adjust = 0;
d_counter = 0;
d_symbol_index = 0;
@@ -72,8 +69,9 @@ namespace gr {
d_sr = 0;
- for (int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++)
- d_integrator[i] = SSI_MIN;
+ memset(d_sample_mem, 0, ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_sample_mem)); // (float)0 = 0x00000000
+ memset(d_data_mem, 0, ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_data_mem)); // (float)0 = 0x00000000
+ memset(d_integrator, SSI_MIN, ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_integrator)); // signed char
}
atsc_sync_impl::~atsc_sync_impl()
@@ -103,7 +101,7 @@ namespace gr {
// amount actually consumed
d_si = 0;
- for (output_produced = 0; output_produced < noutput_items && (d_si + (int)d_interp.ntaps()) < ninput_items[0];) {
+ for (d_output_produced = 0; d_output_produced < noutput_items && (d_si + (int)d_interp.ntaps()) < ninput_items[0];) {
// First we interpolate a sample from input to work with
interp_sample = d_interp.interpolate(&in[d_si], d_mu);
@@ -119,7 +117,7 @@ namespace gr {
d_si += d_incr;
// Remember the sample at this count position
- sample_mem[d_counter] = interp_sample;
+ d_sample_mem[d_counter] = interp_sample;
// Is the sample positive or negative?
int bit = (interp_sample < 0 ? 0 : 1);
@@ -154,22 +152,22 @@ namespace gr {
d_seg_locked = best_correlation_value >= MIN_SEG_LOCK_CORRELATION_VALUE;
// the coefficients are -1,-1,+1,+1
- //d_timing_adjust = sample_mem[best_correlation_index - 3] +
- // sample_mem[best_correlation_index - 2] -
- // sample_mem[best_correlation_index - 1] -
- // sample_mem[best_correlation_index];
+ //d_timing_adjust = d_sample_mem[best_correlation_index - 3] +
+ // d_sample_mem[best_correlation_index - 2] -
+ // d_sample_mem[best_correlation_index - 1] -
+ // d_sample_mem[best_correlation_index];
//printf( "d_timing_adjust = %f\n", d_timing_adjust );
int corr_count = best_correlation_index;
- d_timing_adjust = -sample_mem[corr_count--];
+ d_timing_adjust = -d_sample_mem[corr_count--];
if( corr_count < 0 ) corr_count = ATSC_DATA_SEGMENT_LENGTH - 1;
- d_timing_adjust -= sample_mem[corr_count--];
+ d_timing_adjust -= d_sample_mem[corr_count--];
if( corr_count < 0 ) corr_count = ATSC_DATA_SEGMENT_LENGTH - 1;
- d_timing_adjust += sample_mem[corr_count--];
+ d_timing_adjust += d_sample_mem[corr_count--];
if( corr_count < 0 ) corr_count = ATSC_DATA_SEGMENT_LENGTH - 1;
- d_timing_adjust += sample_mem[corr_count--];
+ d_timing_adjust += d_sample_mem[corr_count--];
d_symbol_index = SYMBOL_INDEX_OFFSET - 1 - best_correlation_index;
if (d_symbol_index < 0)
@@ -183,19 +181,19 @@ namespace gr {
// half full, this is OK becouse the fs_checker will not let packets though
// untill a non-corrupted field packet is found
if( d_seg_locked ) {
- data_mem[d_symbol_index] = interp_sample;
+ d_data_mem[d_symbol_index] = interp_sample;
if( d_symbol_index >= (ATSC_DATA_SEGMENT_LENGTH - 1) )
{
for( int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++ )
- soft_data_segment_out[output_produced].data[i] = data_mem[i];
- output_produced++;
+ soft_data_segment_out[d_output_produced].data[i] = d_data_mem[i];
+ d_output_produced++;
}
}
}
consume_each(d_si);
- return output_produced;
+ return d_output_produced;
}
diff --git a/gr-dtv/lib/atsc/atsc_sync_impl.h b/gr-dtv/lib/atsc/atsc_sync_impl.h
index f5e645049c..670cb311e1 100644
--- a/gr-dtv/lib/atsc/atsc_sync_impl.h
+++ b/gr-dtv/lib/atsc/atsc_sync_impl.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2014 Free Software Foundation, Inc.
+ * Copyright 2014,2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -44,16 +44,16 @@ namespace gr {
double d_mu; // fractional delay [0,1]
int d_incr;
- float sample_mem[ATSC_DATA_SEGMENT_LENGTH];
- float data_mem[ATSC_DATA_SEGMENT_LENGTH];
+ float d_sample_mem[ATSC_DATA_SEGMENT_LENGTH];
+ float d_data_mem[ATSC_DATA_SEGMENT_LENGTH];
double d_timing_adjust;
int d_counter; // free running mod 832 counter
int d_symbol_index;
bool d_seg_locked;
- int d_sr; // 4 bit shift register
+ unsigned char d_sr; // 4 bit shift register
signed char d_integrator[ATSC_DATA_SEGMENT_LENGTH];
- int output_produced;
+ int d_output_produced;
public:
atsc_sync_impl(float rate);
diff --git a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc
index ca4c6a6099..3ae1debb01 100644
--- a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc
+++ b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc
@@ -211,9 +211,6 @@ namespace gr {
m_16apsk[13] = gr_complex(0.4984, -1.2088);
m_16apsk[14] = gr_complex(-1.2088, -0.4984);
m_16apsk[15] = gr_complex(-0.4984, -1.2088);
- for (int i = 0; i < 16; i++) {
- m_16apsk[i] /= 1.2088;
- }
}
else if (rate == C20_30) {
m_16apsk[0] = gr_complex(0.5061, 0.2474);
@@ -232,9 +229,6 @@ namespace gr {
m_16apsk[13] = gr_complex(0.4909, -1.2007);
m_16apsk[14] = gr_complex(-1.2007, -0.4909);
m_16apsk[15] = gr_complex(-0.4909, -1.2007);
- for (int i = 0; i < 16; i++) {
- m_16apsk[i] /= 1.2007;
- }
}
else {
r2 = m;
@@ -1102,9 +1096,6 @@ namespace gr {
m_256apsk[253] = gr_complex(-0.1909, -0.3627);
m_256apsk[254] = gr_complex(-0.3224, -0.5236);
m_256apsk[255] = gr_complex(-0.3016, -0.5347);
- for (int i = 0; i < 256; i++) {
- m_256apsk[i] /= 1.6747;
- }
}
else if (rate == C22_30) {
m_256apsk[0] = gr_complex(1.5977, 0.1526);
@@ -1363,9 +1354,6 @@ namespace gr {
m_256apsk[253] = gr_complex(0.3110, -0.5686);
m_256apsk[254] = gr_complex(-0.3893, -0.7143);
m_256apsk[255] = gr_complex(-0.3110, -0.5686);
- for (int i = 0; i < 256; i++) {
- m_256apsk[i] /= 1.6329;
- }
}
else {
r8 = m;
diff --git a/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.cc
index 9ebfb143ed..3e3dc430b6 100644
--- a/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.cc
+++ b/gr-dtv/lib/dvbt2/dvbt2_interleaver_bb_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2015 Free Software Foundation, Inc.
+ * Copyright 2015,2016 Free Software Foundation, Inc.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -271,13 +271,10 @@ namespace gr {
pack = 0;
for (int e = 0; e < (mod * 2); e++) {
offset = mux[e];
- pack |= tempu[index + offset];
- pack <<= 1;
+ pack |= tempu[index++] << (((mod * 2) - 1) - offset);
}
- pack >>= 1;
out[produced++] = pack >> 4;
out[produced++] = pack & 0xf;
- index += (mod * 2);
consumed += (mod * 2);
}
}
@@ -356,13 +353,10 @@ namespace gr {
pack = 0;
for (int e = 0; e < (mod * 2); e++) {
offset = mux[e];
- pack |= tempu[index + offset];
- pack <<= 1;
+ pack |= tempu[index++] << (((mod * 2) - 1) - offset);
}
- pack >>= 1;
out[produced++] = pack >> 6;
out[produced++] = pack & 0x3f;
- index += (mod * 2);
consumed += (mod * 2);
}
}
@@ -442,13 +436,10 @@ namespace gr {
pack = 0;
for (int e = 0; e < (mod * 2); e++) {
offset = mux[e];
- pack |= tempu[index + offset];
- pack <<= 1;
+ pack |= tempu[index++] << (((mod * 2) - 1) - offset);
}
- pack >>= 1;
out[produced++] = pack >> 8;
out[produced++] = pack & 0xff;
- index += (mod * 2);
consumed += (mod * 2);
}
}
@@ -510,12 +501,9 @@ namespace gr {
pack = 0;
for (int e = 0; e < mod; e++) {
offset = mux[e];
- pack |= tempu[index + offset];
- pack <<= 1;
+ pack |= tempu[index++] << ((mod - 1) - offset);
}
- pack >>= 1;
out[produced++] = pack & 0xff;
- index += mod;
consumed += mod;
}
}
@@ -563,72 +551,72 @@ namespace gr {
const int dvbt2_interleaver_bb_impl::mux16[8] =
{
- 7, 1, 3, 5, 2, 4, 6, 0
+ 7, 1, 4, 2, 5, 3, 6, 0
};
const int dvbt2_interleaver_bb_impl::mux64[12] =
{
- 11, 8, 5, 2, 10, 7, 4, 1, 9, 6, 3, 0
+ 11, 7, 3, 10, 6, 2, 9, 5, 1, 8, 4, 0
};
const int dvbt2_interleaver_bb_impl::mux256[16] =
{
- 15, 1, 13, 3, 10, 7, 9, 11, 4, 6, 8, 5, 12, 2, 14, 0
+ 15, 1, 13, 3, 8, 11, 9, 5, 10, 6, 4, 7, 12, 2, 14, 0
};
const int dvbt2_interleaver_bb_impl::mux16_35[8] =
{
- 0, 2, 3, 6, 4, 1, 7, 5
+ 0, 5, 1, 2, 4, 7, 3, 6
};
const int dvbt2_interleaver_bb_impl::mux16_13[8] =
{
- 1, 6, 5, 2, 3, 4, 0, 7
+ 6, 0, 3, 4, 5, 2, 1, 7
};
const int dvbt2_interleaver_bb_impl::mux16_25[8] =
{
- 3, 5, 6, 4, 2, 1, 7, 0
+ 7, 5, 4, 0, 3, 1, 2, 6
};
const int dvbt2_interleaver_bb_impl::mux64_35[12] =
{
- 4, 6, 0, 5, 8, 10, 2, 1, 7, 3, 11, 9
+ 2, 7, 6, 9, 0, 3, 1, 8, 4, 11, 5, 10
};
const int dvbt2_interleaver_bb_impl::mux64_13[12] =
{
- 2, 5, 1, 6, 0, 3, 4, 7, 8, 9, 10, 11
+ 4, 2, 0, 5, 6, 1, 3, 7, 8, 9, 10, 11
};
const int dvbt2_interleaver_bb_impl::mux64_25[12] =
{
- 1, 2, 4, 5, 0, 6, 3, 8, 7, 10, 9, 11
+ 4, 0, 1, 6, 2, 3, 5, 8, 7, 10, 9, 11
};
const int dvbt2_interleaver_bb_impl::mux256_35[16] =
{
- 4, 6, 0, 2, 3, 14, 12, 10, 7, 5, 8, 1, 15, 9, 11, 13
+ 2, 11, 3, 4, 0, 9, 1, 8, 10, 13, 7, 14, 6, 15, 5, 12
};
const int dvbt2_interleaver_bb_impl::mux256_23[16] =
{
- 3, 15, 1, 7, 4, 11, 5, 0, 12, 2, 9, 14, 13, 6, 8, 10
+ 7, 2, 9, 0, 4, 6, 13, 3, 14, 10, 15, 5, 8, 12, 11, 1
};
const int dvbt2_interleaver_bb_impl::mux256s[8] =
{
- 7, 2, 4, 1, 6, 3, 5, 0
+ 7, 3, 1, 5, 2, 6, 4, 0
};
const int dvbt2_interleaver_bb_impl::mux256s_13[8] =
{
- 1, 2, 3, 5, 0, 4, 6, 7
+ 4, 0, 1, 2, 5, 3, 6, 7
};
const int dvbt2_interleaver_bb_impl::mux256s_25[8] =
{
- 1, 3, 4, 5, 0, 2, 6, 7
+ 4, 0, 5, 1, 2, 3, 6, 7
};
} /* namespace dtv */
diff --git a/gr-dtv/swig/CMakeLists.txt b/gr-dtv/swig/CMakeLists.txt
index 7e98fa3b45..b3fb4c3cdd 100644
--- a/gr-dtv/swig/CMakeLists.txt
+++ b/gr-dtv/swig/CMakeLists.txt
@@ -36,7 +36,7 @@ endif(ENABLE_GR_CTRLPORT)
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/dtv_swig_doc.i)
set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/dtv)
set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc)
-set(GR_SWIG_LIBRARIES gnuradio-dtv)
+set(GR_SWIG_LIBRARIES gnuradio-dtv ${GSL_LDFLAGS})
GR_SWIG_MAKE(dtv_swig dtv_swig.i)
diff --git a/gr-fec/lib/cc_decoder_impl.cc b/gr-fec/lib/cc_decoder_impl.cc
index be505e2f8e..21af22e36f 100644
--- a/gr-fec/lib/cc_decoder_impl.cc
+++ b/gr-fec/lib/cc_decoder_impl.cc
@@ -156,6 +156,9 @@ namespace gr {
kerneltype << k_ << d_k << r_ << d_rate;
d_kernel = yp_kernel[kerneltype.str()];
+ if (d_kernel == NULL) {
+ throw std::runtime_error("cc_decoder: parameters not supported");
+ }
}
cc_decoder_impl::~cc_decoder_impl()
diff --git a/gr-filter/lib/pfb_arb_resampler_ccc_impl.cc b/gr-filter/lib/pfb_arb_resampler_ccc_impl.cc
index db1680085b..3437524386 100644
--- a/gr-filter/lib/pfb_arb_resampler_ccc_impl.cc
+++ b/gr-filter/lib/pfb_arb_resampler_ccc_impl.cc
@@ -53,7 +53,6 @@ namespace gr {
d_resamp = new kernel::pfb_arb_resampler_ccc(rate, taps, filter_size);
set_history(d_resamp->taps_per_filter());
set_relative_rate(rate);
- enable_update_rate(true);
}
pfb_arb_resampler_ccc_impl::~pfb_arb_resampler_ccc_impl()
diff --git a/gr-filter/lib/pfb_arb_resampler_ccf_impl.cc b/gr-filter/lib/pfb_arb_resampler_ccf_impl.cc
index aa6cb775ae..246b3d99cf 100644
--- a/gr-filter/lib/pfb_arb_resampler_ccf_impl.cc
+++ b/gr-filter/lib/pfb_arb_resampler_ccf_impl.cc
@@ -53,7 +53,6 @@ namespace gr {
d_resamp = new kernel::pfb_arb_resampler_ccf(rate, taps, filter_size);
set_history(d_resamp->taps_per_filter());
set_relative_rate(rate);
- enable_update_rate(true);
}
pfb_arb_resampler_ccf_impl::~pfb_arb_resampler_ccf_impl()
diff --git a/gr-filter/lib/pfb_arb_resampler_fff_impl.cc b/gr-filter/lib/pfb_arb_resampler_fff_impl.cc
index 8602a2f0fa..1d994cce7e 100644
--- a/gr-filter/lib/pfb_arb_resampler_fff_impl.cc
+++ b/gr-filter/lib/pfb_arb_resampler_fff_impl.cc
@@ -52,7 +52,6 @@ namespace gr {
d_resamp = new kernel::pfb_arb_resampler_fff(rate, taps, filter_size);
set_history(d_resamp->taps_per_filter());
set_relative_rate(rate);
- enable_update_rate(true);
}
pfb_arb_resampler_fff_impl::~pfb_arb_resampler_fff_impl()
diff --git a/gr-qtgui/apps/qt_digital.py b/gr-qtgui/apps/qt_digital.py
deleted file mode 100755
index fef4f448b4..0000000000
--- a/gr-qtgui/apps/qt_digital.py
+++ /dev/null
@@ -1,307 +0,0 @@
-#!/usr/bin/env python
-#
-# 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.
-#
-
-from gnuradio import gr, digital
-from gnuradio import blocks
-from gnuradio import filter
-from gnuradio import channels
-from gnuradio import eng_notation
-import sys
-
-try:
- from gnuradio import qtgui
- from PyQt4 import QtGui, QtCore
- import sip
-except ImportError:
- print "Error: Program requires PyQt4 and gr-qtgui."
- sys.exit(1)
-
-try:
- import scipy
-except ImportError:
- print "Error: Program requires scipy (see: www.scipy.org)."
- sys.exit(1)
-
-try:
- from qt_digital_window import Ui_DigitalWindow
-except ImportError:
- print "Error: could not find qt_digital_window.py:"
- print "\t\"Please run: pyuic4 qt_digital_window.ui -o qt_digital_window.py\""
- sys.exit(1)
-
-class dialog_box(QtGui.QMainWindow):
- def __init__(self, snkTx, snkRx, fg, parent=None):
- QtGui.QWidget.__init__(self, parent)
- self.gui = Ui_DigitalWindow()
- self.gui.setupUi(self)
-
- self.fg = fg
-
- self.set_sample_rate(self.fg.sample_rate())
-
- self.set_snr(self.fg.snr())
- self.set_frequency(self.fg.frequency_offset())
- self.set_time_offset(self.fg.timing_offset())
-
- self.set_gain_mu(self.fg.rx_gain_mu())
- self.set_loop_bw(self.fg.loop_bw())
-
- # Add the qtsnk widgets to the hlayout box
- self.gui.sinkLayout.addWidget(snkTx)
- self.gui.sinkLayout.addWidget(snkRx)
-
-
- # Connect up some signals
- self.connect(self.gui.pauseButton, QtCore.SIGNAL("clicked()"),
- self.pauseFg)
-
- self.connect(self.gui.sampleRateEdit, QtCore.SIGNAL("editingFinished()"),
- self.sampleRateEditText)
-
- self.connect(self.gui.snrEdit, QtCore.SIGNAL("editingFinished()"),
- self.snrEditText)
- self.connect(self.gui.freqEdit, QtCore.SIGNAL("editingFinished()"),
- self.freqEditText)
- self.connect(self.gui.timeEdit, QtCore.SIGNAL("editingFinished()"),
- self.timeEditText)
-
- self.connect(self.gui.gainMuEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainMuEditText)
- self.connect(self.gui.alphaEdit, QtCore.SIGNAL("editingFinished()"),
- self.alphaEditText)
-
-
- def pauseFg(self):
- if(self.gui.pauseButton.text() == "Pause"):
- self.fg.stop()
- self.fg.wait()
- self.gui.pauseButton.setText("Unpause")
- else:
- self.fg.start()
- self.gui.pauseButton.setText("Pause")
-
- # Accessor functions for Gui to manipulate system parameters
- def set_sample_rate(self, sr):
- ssr = eng_notation.num_to_str(sr)
- self.gui.sampleRateEdit.setText(QtCore.QString("%1").arg(ssr))
-
- def sampleRateEditText(self):
- try:
- rate = self.gui.sampleRateEdit.text().toAscii()
- srate = eng_notation.str_to_num(rate)
- self.fg.set_sample_rate(srate)
- except RuntimeError:
- pass
-
-
- # Accessor functions for Gui to manipulate channel model
- def set_snr(self, snr):
- self.gui.snrEdit.setText(QtCore.QString("%1").arg(snr))
-
- def set_frequency(self, fo):
- self.gui.freqEdit.setText(QtCore.QString("%1").arg(fo))
-
- def set_time_offset(self, to):
- self.gui.timeEdit.setText(QtCore.QString("%1").arg(to))
-
- def snrEditText(self):
- try:
- snr = self.gui.snrEdit.text().toDouble()[0]
- self.fg.set_snr(snr)
- except RuntimeError:
- pass
-
- def freqEditText(self):
- try:
- freq = self.gui.freqEdit.text().toDouble()[0]
- self.fg.set_frequency_offset(freq)
- except RuntimeError:
- pass
-
- def timeEditText(self):
- try:
- to = self.gui.timeEdit.text().toDouble()[0]
- self.fg.set_timing_offset(to)
- except RuntimeError:
- pass
-
-
- # Accessor functions for Gui to manipulate receiver parameters
- def set_gain_mu(self, gain):
- self.gui.gainMuEdit.setText(QtCore.QString("%1").arg(gain))
-
- def set_loop_bw(self, bw):
- self.gui.alphaEdit.setText(QtCore.QString("%1").arg(bw))
-
- def alphaEditText(self):
- try:
- bw = self.gui.alphaEdit.text().toDouble()[0]
- self.fg.set_loop_bw(bw)
- except RuntimeError:
- pass
-
- def gainMuEditText(self):
- try:
- gain = self.gui.gainMuEdit.text().toDouble()[0]
- self.fg.set_rx_gain_mu(gain)
- except RuntimeError:
- pass
-
-
-class my_top_block(gr.top_block):
- def __init__(self):
- gr.top_block.__init__(self)
-
- self.qapp = QtGui.QApplication(sys.argv)
-
- self._sample_rate = 2000e3
-
- self.sps = 2
- self.excess_bw = 0.35
- self.gray_code = digital.mod_codes.GRAY_CODE
-
- fftsize = 2048
-
- self.data = scipy.random.randint(0, 255, 1000)
- self.src = blocks.vector_source_b(self.data.tolist(), True)
- self.mod = digital.dqpsk_mod(self.gray_code,
- samples_per_symbol=self.sps,
- excess_bw=self.excess_bw,
- verbose=False, log=False)
-
- self.rrctaps = filter.firdes.root_raised_cosine(1, self.sps, 1, self.excess_bw, 21)
- self.rx_rrc = filter.fir_filter_ccf(1, self.rrctaps)
-
-
- # Set up the carrier & clock recovery parameters
- self.arity = 4
- self.mu = 0.5
- self.gain_mu = 0.05
- self.omega = self.sps
- self.gain_omega = .25 * self.gain_mu * self.gain_mu
- self.omega_rel_lim = 0.05
-
- self._loop_bw = 2*scipy.pi/100.0
- self.fmin = -1000/self.sample_rate()
- self.fmax = 1000/self.sample_rate()
-
- self.receiver = digital.mpsk_receiver_cc(self.arity, 0,
- self._loop_bw,
- self.fmin, self.fmax,
- self.mu, self.gain_mu,
- self.omega, self.gain_omega,
- self.omega_rel_lim)
-
-
- self.snr_dB = 15
- noise = self.get_noise_voltage(self.snr_dB)
- self.fo = 100/self.sample_rate()
- self.to = 1.0
- self.channel = channels.channel_model(noise, self.fo, self.to)
-
- self.thr = blocks.throttle(gr.sizeof_char, self._sample_rate)
- self.snk_tx = qtgui.sink_c(fftsize, filter.firdes.WIN_BLACKMAN_hARRIS,
- 0, self._sample_rate*self.sps,
- "Tx", True, True, True, True)
-
- self.snk_rx = qtgui.sink_c(fftsize, filter.firdes.WIN_BLACKMAN_hARRIS,
- 0, self._sample_rate,
- "Rx", True, True, True, True)
-
- self.connect(self.src, self.thr, self.mod, self.channel, self.snk_tx)
- self.connect(self.channel, self.rx_rrc, self.receiver, self.snk_rx)
-
- pyTxQt = self.snk_tx.pyqwidget()
- pyTx = sip.wrapinstance(pyTxQt, QtGui.QWidget)
-
- pyRxQt = self.snk_rx.pyqwidget()
- pyRx = sip.wrapinstance(pyRxQt, QtGui.QWidget)
-
- self.main_box = dialog_box(pyTx, pyRx, self);
- self.main_box.show()
-
-
- def get_noise_voltage(self, SNR):
- S = 0 # dBm, assuming signal power normalized
- N = S - SNR # dBm
- npwr = pow(10.0, N/10.0) # ratio
- nv = scipy.sqrt(npwr * self.sps) # convert the noise voltage
- return nv
-
-
- # System Parameters
- def sample_rate(self):
- return self._sample_rate
-
- def set_sample_rate(self, sr):
- self._sample_rate = sr
-
-
- # Channel Model Parameters
- def snr(self):
- return self.snr_dB
-
- def set_snr(self, snr):
- self.snr_dB = snr
- noise = self.get_noise_voltage(self.snr_dB)
- self.channel.set_noise_voltage(noise)
-
- def frequency_offset(self):
- return self.fo * self.sample_rate()
-
- def set_frequency_offset(self, fo):
- self.fo = fo / self.sample_rate()
- self.channel.set_frequency_offset(self.fo)
-
- def timing_offset(self):
- return self.to
-
- def set_timing_offset(self, to):
- self.to = to
- self.channel.set_timing_offset(self.to)
-
-
- # Receiver Parameters
- def rx_gain_mu(self):
- return self.gain_mu
-
- def rx_gain_omega(self):
- return self.gain_omega
-
- def set_rx_gain_mu(self, gain):
- self.gain_mu = gain
- self.gain_omega = .25 * self.gain_mu * self.gain_mu
- self.receiver.set_gain_mu(self.gain_mu)
- self.receiver.set_gain_omega(self.gain_omega)
-
- def set_loop_bw(self, loop_bw):
- self._loop_bw = bw
- self.receiver.set_loop_bw(self._loop_bw)
-
- def loop_bw(self):
- return self._loop_bw
-
-if __name__ == "__main__":
- tb = my_top_block();
- tb.start()
- tb.qapp.exec_()
- tb.stop()
diff --git a/gr-qtgui/apps/qt_digital_window.py b/gr-qtgui/apps/qt_digital_window.py
deleted file mode 100644
index 50dd53a923..0000000000
--- a/gr-qtgui/apps/qt_digital_window.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'qt_digital_window.ui'
-#
-# Created: Sat May 1 20:14:02 2010
-# by: PyQt4 UI code generator 4.6.1
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-
-class Ui_DigitalWindow(object):
- def setupUi(self, DigitalWindow):
- DigitalWindow.setObjectName("DigitalWindow")
- DigitalWindow.resize(1236, 741)
- self.centralwidget = QtGui.QWidget(DigitalWindow)
- self.centralwidget.setObjectName("centralwidget")
- self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
- self.verticalLayout.setObjectName("verticalLayout")
- self.sinkFrame = QtGui.QFrame(self.centralwidget)
- self.sinkFrame.setMinimumSize(QtCore.QSize(0, 550))
- self.sinkFrame.setFrameShape(QtGui.QFrame.StyledPanel)
- self.sinkFrame.setFrameShadow(QtGui.QFrame.Raised)
- self.sinkFrame.setObjectName("sinkFrame")
- self.horizontalLayout_2 = QtGui.QHBoxLayout(self.sinkFrame)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
- self.sinkLayout = QtGui.QHBoxLayout()
- self.sinkLayout.setObjectName("sinkLayout")
- self.horizontalLayout_2.addLayout(self.sinkLayout)
- self.verticalLayout.addWidget(self.sinkFrame)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.sysBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.sysBox.sizePolicy().hasHeightForWidth())
- self.sysBox.setSizePolicy(sizePolicy)
- self.sysBox.setMinimumSize(QtCore.QSize(0, 0))
- self.sysBox.setMaximumSize(QtCore.QSize(16777215, 120))
- self.sysBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
- self.sysBox.setObjectName("sysBox")
- self.gridLayout_2 = QtGui.QGridLayout(self.sysBox)
- self.gridLayout_2.setObjectName("gridLayout_2")
- self.sampleRateEdit = QtGui.QLineEdit(self.sysBox)
- self.sampleRateEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.sampleRateEdit.setObjectName("sampleRateEdit")
- self.gridLayout_2.addWidget(self.sampleRateEdit, 0, 3, 1, 1)
- self.sampleRateLabel = QtGui.QLabel(self.sysBox)
- self.sampleRateLabel.setObjectName("sampleRateLabel")
- self.gridLayout_2.addWidget(self.sampleRateLabel, 0, 2, 1, 1)
- self.horizontalLayout.addWidget(self.sysBox)
- self.rxBox = QtGui.QGroupBox(self.centralwidget)
- self.rxBox.setMaximumSize(QtCore.QSize(16777215, 120))
- self.rxBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
- self.rxBox.setObjectName("rxBox")
- self.gridLayout_3 = QtGui.QGridLayout(self.rxBox)
- self.gridLayout_3.setObjectName("gridLayout_3")
- self.alphaLabel = QtGui.QLabel(self.rxBox)
- self.alphaLabel.setObjectName("alphaLabel")
- self.gridLayout_3.addWidget(self.alphaLabel, 1, 0, 1, 1)
- self.alphaEdit = QtGui.QLineEdit(self.rxBox)
- self.alphaEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.alphaEdit.setObjectName("alphaEdit")
- self.gridLayout_3.addWidget(self.alphaEdit, 1, 1, 1, 1)
- self.gainMuLabel = QtGui.QLabel(self.rxBox)
- self.gainMuLabel.setObjectName("gainMuLabel")
- self.gridLayout_3.addWidget(self.gainMuLabel, 0, 0, 1, 1)
- self.gainMuEdit = QtGui.QLineEdit(self.rxBox)
- self.gainMuEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.gainMuEdit.setObjectName("gainMuEdit")
- self.gridLayout_3.addWidget(self.gainMuEdit, 0, 1, 1, 1)
- self.horizontalLayout.addWidget(self.rxBox)
- self.channelModeBox = QtGui.QGroupBox(self.centralwidget)
- self.channelModeBox.setMaximumSize(QtCore.QSize(16777215, 120))
- self.channelModeBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
- self.channelModeBox.setObjectName("channelModeBox")
- self.gridLayout = QtGui.QGridLayout(self.channelModeBox)
- self.gridLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
- self.gridLayout.setObjectName("gridLayout")
- self.snrLabel = QtGui.QLabel(self.channelModeBox)
- self.snrLabel.setObjectName("snrLabel")
- self.gridLayout.addWidget(self.snrLabel, 0, 1, 1, 1)
- self.snrEdit = QtGui.QLineEdit(self.channelModeBox)
- self.snrEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.snrEdit.setObjectName("snrEdit")
- self.gridLayout.addWidget(self.snrEdit, 0, 2, 1, 1)
- self.freqLabel = QtGui.QLabel(self.channelModeBox)
- self.freqLabel.setObjectName("freqLabel")
- self.gridLayout.addWidget(self.freqLabel, 1, 1, 1, 1)
- self.freqEdit = QtGui.QLineEdit(self.channelModeBox)
- self.freqEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.freqEdit.setObjectName("freqEdit")
- self.gridLayout.addWidget(self.freqEdit, 1, 2, 1, 1)
- self.timeLabel = QtGui.QLabel(self.channelModeBox)
- self.timeLabel.setObjectName("timeLabel")
- self.gridLayout.addWidget(self.timeLabel, 2, 1, 1, 1)
- self.timeEdit = QtGui.QLineEdit(self.channelModeBox)
- self.timeEdit.setMaximumSize(QtCore.QSize(100, 16777215))
- self.timeEdit.setObjectName("timeEdit")
- self.gridLayout.addWidget(self.timeEdit, 2, 2, 1, 1)
- self.horizontalLayout.addWidget(self.channelModeBox)
- spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem)
- self.verticalLayout_2 = QtGui.QVBoxLayout()
- self.verticalLayout_2.setObjectName("verticalLayout_2")
- spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
- self.verticalLayout_2.addItem(spacerItem1)
- self.pauseButton = QtGui.QPushButton(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.pauseButton.sizePolicy().hasHeightForWidth())
- self.pauseButton.setSizePolicy(sizePolicy)
- self.pauseButton.setMaximumSize(QtCore.QSize(80, 16777215))
- self.pauseButton.setObjectName("pauseButton")
- self.verticalLayout_2.addWidget(self.pauseButton)
- self.closeButton = QtGui.QPushButton(self.centralwidget)
- self.closeButton.setMaximumSize(QtCore.QSize(80, 16777215))
- self.closeButton.setObjectName("closeButton")
- self.verticalLayout_2.addWidget(self.closeButton)
- self.horizontalLayout.addLayout(self.verticalLayout_2)
- self.verticalLayout.addLayout(self.horizontalLayout)
- DigitalWindow.setCentralWidget(self.centralwidget)
- self.menubar = QtGui.QMenuBar(DigitalWindow)
- self.menubar.setGeometry(QtCore.QRect(0, 0, 1236, 23))
- self.menubar.setObjectName("menubar")
- self.menuFile = QtGui.QMenu(self.menubar)
- self.menuFile.setObjectName("menuFile")
- DigitalWindow.setMenuBar(self.menubar)
- self.statusbar = QtGui.QStatusBar(DigitalWindow)
- self.statusbar.setObjectName("statusbar")
- DigitalWindow.setStatusBar(self.statusbar)
- self.actionExit = QtGui.QAction(DigitalWindow)
- self.actionExit.setObjectName("actionExit")
- self.menuFile.addAction(self.actionExit)
- self.menubar.addAction(self.menuFile.menuAction())
-
- self.retranslateUi(DigitalWindow)
- QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), DigitalWindow.close)
- QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL("triggered()"), DigitalWindow.close)
- QtCore.QMetaObject.connectSlotsByName(DigitalWindow)
- DigitalWindow.setTabOrder(self.snrEdit, self.freqEdit)
- DigitalWindow.setTabOrder(self.freqEdit, self.timeEdit)
-
- def retranslateUi(self, DigitalWindow):
- DigitalWindow.setWindowTitle(QtGui.QApplication.translate("DigitalWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))
- self.sysBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "System Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.sampleRateLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Sample Rate (sps)", None, QtGui.QApplication.UnicodeUTF8))
- self.rxBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Receiver Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.alphaLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Alpha", None, QtGui.QApplication.UnicodeUTF8))
- self.gainMuLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Gain mu", None, QtGui.QApplication.UnicodeUTF8))
- self.channelModeBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Channel Model Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.snrLabel.setText(QtGui.QApplication.translate("DigitalWindow", "SNR (dB)", None, QtGui.QApplication.UnicodeUTF8))
- self.freqLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Frequency Offset (Hz)", None, QtGui.QApplication.UnicodeUTF8))
- self.timeLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Timing Offset", None, QtGui.QApplication.UnicodeUTF8))
- self.pauseButton.setText(QtGui.QApplication.translate("DigitalWindow", "Pause", None, QtGui.QApplication.UnicodeUTF8))
- self.closeButton.setText(QtGui.QApplication.translate("DigitalWindow", "Close", None, QtGui.QApplication.UnicodeUTF8))
- self.menuFile.setTitle(QtGui.QApplication.translate("DigitalWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
- self.actionExit.setText(QtGui.QApplication.translate("DigitalWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8))
-
diff --git a/gr-qtgui/apps/qt_digital_window.ui b/gr-qtgui/apps/qt_digital_window.ui
deleted file mode 100644
index 9672521815..0000000000
--- a/gr-qtgui/apps/qt_digital_window.ui
+++ /dev/null
@@ -1,342 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>DigitalWindow</class>
- <widget class="QMainWindow" name="DigitalWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>1236</width>
- <height>741</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QFrame" name="sinkFrame">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>550</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <layout class="QHBoxLayout" name="sinkLayout"/>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QGroupBox" name="sysBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>120</height>
- </size>
- </property>
- <property name="title">
- <string>System Parameters</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="3">
- <widget class="QLineEdit" name="sampleRateEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="sampleRateLabel">
- <property name="text">
- <string>Sample Rate (sps)</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="rxBox">
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>120</height>
- </size>
- </property>
- <property name="title">
- <string>Receiver Parameters</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="1" column="0">
- <widget class="QLabel" name="alphaLabel">
- <property name="text">
- <string>Alpha</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="alphaEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="gainMuLabel">
- <property name="text">
- <string>Gain mu</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="gainMuEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="channelModeBox">
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>120</height>
- </size>
- </property>
- <property name="title">
- <string>Channel Model Parameters</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetMinimumSize</enum>
- </property>
- <item row="0" column="1">
- <widget class="QLabel" name="snrLabel">
- <property name="text">
- <string>SNR (dB)</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLineEdit" name="snrEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="freqLabel">
- <property name="text">
- <string>Frequency Offset (Hz)</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="freqEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLabel" name="timeLabel">
- <property name="text">
- <string>Timing Offset</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLineEdit" name="timeEdit">
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="pauseButton">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Pause</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="closeButton">
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Close</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>1236</width>
- <height>23</height>
- </rect>
- </property>
- <widget class="QMenu" name="menuFile">
- <property name="title">
- <string>&amp;File</string>
- </property>
- <addaction name="actionExit"/>
- </widget>
- <addaction name="menuFile"/>
- </widget>
- <widget class="QStatusBar" name="statusbar"/>
- <action name="actionExit">
- <property name="text">
- <string>E&amp;xit</string>
- </property>
- </action>
- </widget>
- <tabstops>
- <tabstop>snrEdit</tabstop>
- <tabstop>freqEdit</tabstop>
- <tabstop>timeEdit</tabstop>
- </tabstops>
- <resources/>
- <connections>
- <connection>
- <sender>closeButton</sender>
- <signal>clicked()</signal>
- <receiver>DigitalWindow</receiver>
- <slot>close()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>322</x>
- <y>623</y>
- </hint>
- <hint type="destinationlabel">
- <x>66</x>
- <y>561</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>actionExit</sender>
- <signal>triggered()</signal>
- <receiver>DigitalWindow</receiver>
- <slot>close()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>-1</x>
- <y>-1</y>
- </hint>
- <hint type="destinationlabel">
- <x>617</x>
- <y>327</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/gr-qtgui/examples/c++/CMakeLists.txt b/gr-qtgui/examples/c++/CMakeLists.txt
index fb0b19a6d9..88275196d0 100644
--- a/gr-qtgui/examples/c++/CMakeLists.txt
+++ b/gr-qtgui/examples/c++/CMakeLists.txt
@@ -18,14 +18,14 @@
# Boston, MA 02110-1301, USA.
include_directories(
- ${GR_QTGUI_INCLUDE_DIRS}
- ${GR_ANALOG_INCLUDE_DIRS}
- ${GR_FILTER_INCLUDE_DIRS}
- ${GR_BLOCKS_INCLUDE_DIRS}
- ${GR_FFT_INCLUDE_DIRS}
- ${GNURADIO_RUNTIME_INCLUDE_DIRS}
- ${QT_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS}
+ ${GR_QTGUI_INCLUDE_DIRS}
+ ${GR_ANALOG_INCLUDE_DIRS}
+ ${GR_FILTER_INCLUDE_DIRS}
+ ${GR_BLOCKS_INCLUDE_DIRS}
+ ${GR_FFT_INCLUDE_DIRS}
+ ${GNURADIO_RUNTIME_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${Boost_INCLUDE_DIRS}
)
list(APPEND QTGUI_LIBRARIES
@@ -35,7 +35,6 @@ list(APPEND QTGUI_LIBRARIES
gnuradio-blocks
gnuradio-fft
gnuradio-runtime
- ${QWT_LIBRARY_DIRS}
${QT_LIBRARIES}
)
diff --git a/gr-qtgui/include/gnuradio/qtgui/freqcontrolpanel.h b/gr-qtgui/include/gnuradio/qtgui/freqcontrolpanel.h
index ec3ef6cfd1..5fb8f462c5 100644
--- a/gr-qtgui/include/gnuradio/qtgui/freqcontrolpanel.h
+++ b/gr-qtgui/include/gnuradio/qtgui/freqcontrolpanel.h
@@ -44,7 +44,9 @@ public:
public slots:
void notifyAvgSlider(int val);
+ void setFFTAverage(float val);
void toggleGrid(bool en);
+ void toggleAxisLabels(bool en);
void toggleMaxHold(bool en);
void toggleMinHold(bool en);
diff --git a/gr-qtgui/include/gnuradio/qtgui/utils.h b/gr-qtgui/include/gnuradio/qtgui/utils.h
index 2c51b24820..438c965ed5 100644
--- a/gr-qtgui/include/gnuradio/qtgui/utils.h
+++ b/gr-qtgui/include/gnuradio/qtgui/utils.h
@@ -28,6 +28,7 @@
#include <qwt_plot_picker.h>
#include <qwt_picker_machine.h>
#include <QString>
+#include <QCoreApplication>
/*!
* From QSS file name, extracts the file contents and returns a
@@ -66,4 +67,6 @@ public:
const QEvent *e);
};
+void check_set_qss(QApplication *app);
+
#endif /* INCLUDED_QTGUI_UTILS_H */
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc b/gr-qtgui/lib/FrequencyDisplayPlot.cc
index 233c786d0a..2820bae2f5 100644
--- a/gr-qtgui/lib/FrequencyDisplayPlot.cc
+++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc
@@ -607,7 +607,6 @@ FrequencyDisplayPlot::setYLabel(const std::string &label,
if(unit.length() > 0)
l += " (" + unit + ")";
setAxisTitle(QwtPlot::yLeft, QString(l.c_str()));
- ((FreqDisplayZoomer*)d_zoomer)->setUnitType(unit);
}
void
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index bc9f630235..51a1989a9a 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -343,9 +343,7 @@ TimeDomainDisplayPlot::plotNewData(const std::vector<double*> dataPoints,
m->setXValue(sample_offset);
m->setYValue(yval);
- QBrush brush;
- brush.setColor(QColor(0xC8, 0x2F, 0x1F));
- brush.setStyle(Qt::SolidPattern);
+ QBrush brush(getTagBackgroundColor(), getTagBackgroundStyle());
QPen pen;
pen.setColor(Qt::black);
@@ -367,8 +365,10 @@ TimeDomainDisplayPlot::plotNewData(const std::vector<double*> dataPoints,
#else
m->setSymbol(sym);
#endif
+ QwtText tag_label(s.str().c_str());
+ tag_label.setColor(getTagTextColor());
+ m->setLabel(tag_label);
- m->setLabel(QwtText(s.str().c_str()));
m->attach(this);
if(!(show && d_tag_markers_en[which])) {
diff --git a/gr-qtgui/lib/VectorDisplayPlot.cc b/gr-qtgui/lib/VectorDisplayPlot.cc
index 2babfea1cc..54d5c49acc 100644
--- a/gr-qtgui/lib/VectorDisplayPlot.cc
+++ b/gr-qtgui/lib/VectorDisplayPlot.cc
@@ -284,12 +284,12 @@ void VectorDisplayPlot::setYAxisLabel(const QString &label)
void VectorDisplayPlot::setXAxisUnit(const QString &unit)
{
- ((VectorDisplayZoomer*)d_zoomer)->setXUnits(unit);
+ ((VectorDisplayZoomer*)d_zoomer)->setXUnits(unit);
}
void VectorDisplayPlot::setYAxisUnit(const QString &unit)
{
- ((VectorDisplayZoomer*)d_zoomer)->setYUnits(unit);
+ ((VectorDisplayZoomer*)d_zoomer)->setYUnits(unit);
}
void
@@ -301,17 +301,17 @@ VectorDisplayPlot::setXAxisValues(
if((start != d_x_axis_start) || (step != d_x_axis_step))
reset = true;
- d_x_axis_start = start;
- d_x_axis_step = step;
+ d_x_axis_start = start;
+ d_x_axis_step = step;
- if((axisScaleDraw(QwtPlot::xBottom) != NULL) && (d_zoomer != NULL)) {
- setAxisTitle(QwtPlot::xBottom, d_x_axis_label);
- if(reset) {
- _resetXAxisPoints();
- clearMaxData();
- clearMinData();
- }
+ if((axisScaleDraw(QwtPlot::xBottom) != NULL) && (d_zoomer != NULL)) {
+ setAxisTitle(QwtPlot::xBottom, d_x_axis_label);
+ if(reset) {
+ _resetXAxisPoints();
+ clearMaxData();
+ clearMinData();
}
+ }
}
void
diff --git a/gr-qtgui/lib/const_sink_c_impl.cc b/gr-qtgui/lib/const_sink_c_impl.cc
index 7aa99a1c68..26ddf793dc 100644
--- a/gr-qtgui/lib/const_sink_c_impl.cc
+++ b/gr-qtgui/lib/const_sink_c_impl.cc
@@ -136,11 +136,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new ConstellationDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/edit_box_msg_impl.cc b/gr-qtgui/lib/edit_box_msg_impl.cc
index e0b5f256b6..0dee1fa18b 100644
--- a/gr-qtgui/lib/edit_box_msg_impl.cc
+++ b/gr-qtgui/lib/edit_box_msg_impl.cc
@@ -69,11 +69,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
d_is_pair = is_pair;
d_is_static = is_static;
diff --git a/gr-qtgui/lib/freq_sink_c_impl.cc b/gr-qtgui/lib/freq_sink_c_impl.cc
index 544c8b3c47..c697e8c269 100644
--- a/gr-qtgui/lib/freq_sink_c_impl.cc
+++ b/gr-qtgui/lib/freq_sink_c_impl.cc
@@ -162,11 +162,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new FreqDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc
index 816b37415e..046414ffaf 100644
--- a/gr-qtgui/lib/freq_sink_f_impl.cc
+++ b/gr-qtgui/lib/freq_sink_f_impl.cc
@@ -161,11 +161,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new FreqDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/freqcontrolpanel.cc b/gr-qtgui/lib/freqcontrolpanel.cc
index 9729005f50..c0a8ed4158 100644
--- a/gr-qtgui/lib/freqcontrolpanel.cc
+++ b/gr-qtgui/lib/freqcontrolpanel.cc
@@ -229,6 +229,12 @@ FreqControlPanel::toggleGrid(bool en)
}
void
+FreqControlPanel::toggleAxisLabels(bool en)
+{
+ d_axislabels_check->setChecked(en);
+}
+
+void
FreqControlPanel::toggleMaxHold(bool en)
{
d_maxhold_check->setChecked(en);
@@ -243,12 +249,23 @@ FreqControlPanel::toggleMinHold(bool en)
void
FreqControlPanel::notifyAvgSlider(int val)
{
- float fval = static_cast<float>(val) / (d_slider_max - d_slider_min);
+ float fval = static_cast<float>(val) / (d_slider_max - d_slider_min + 1);
emit signalAvgSlider(fval);
emit signalAvg(true);
}
void
+FreqControlPanel::setFFTAverage(float val)
+{
+ int slider_val = static_cast<int>(roundf(val * (d_slider_max - d_slider_min + 1)));
+ if (slider_val > d_slider_max)
+ slider_val = d_slider_max;
+ else if (slider_val < d_slider_min)
+ slider_val = d_slider_min;
+ d_avg_slider->setValue(slider_val);
+}
+
+void
FreqControlPanel::toggleFFTSize(int val)
{
int index = static_cast<int>(round(logf(static_cast<float>(val))/logf(2.0f))) - 5;
diff --git a/gr-qtgui/lib/freqdisplayform.cc b/gr-qtgui/lib/freqdisplayform.cc
index 141df5475c..6aa4894a96 100644
--- a/gr-qtgui/lib/freqdisplayform.cc
+++ b/gr-qtgui/lib/freqdisplayform.cc
@@ -177,6 +177,8 @@ FreqDisplayForm::setupControlPanel()
// Connect action items in menu to controlpanel widgets
connect(d_grid_act, SIGNAL(triggered(bool)),
d_controlpanel, SLOT(toggleGrid(bool)));
+ connect(d_axislabelsmenu, SIGNAL(triggered(bool)),
+ d_controlpanel, SLOT(toggleAxisLabels(bool)));
connect(d_sizemenu, SIGNAL(whichTrigger(int)),
d_controlpanel, SLOT(toggleFFTSize(int)));
connect(d_winmenu, SIGNAL(whichTrigger(gr::filter::firdes::win_type)),
@@ -189,6 +191,8 @@ FreqDisplayForm::setupControlPanel()
d_controlpanel, SLOT(toggleMaxHold(bool)));
connect(d_minhold_act, SIGNAL(triggered(bool)),
d_controlpanel, SLOT(toggleMinHold(bool)));
+ connect(d_avgmenu, SIGNAL(whichTrigger(float)),
+ d_controlpanel, SLOT(setFFTAverage(float)));
connect(d_tr_mode_menu, SIGNAL(whichTrigger(gr::qtgui::trigger_mode)),
d_controlpanel, SLOT(toggleTriggerMode(gr::qtgui::trigger_mode)));
connect(this, SIGNAL(signalTriggerMode(gr::qtgui::trigger_mode)),
@@ -199,10 +203,12 @@ FreqDisplayForm::setupControlPanel()
d_layout->addLayout(d_controlpanel, 0, 1);
d_controlpanel->toggleGrid(d_grid_act->isChecked());
+ d_controlpanel->toggleAxisLabels(d_axislabelsmenu->isChecked());
d_controlpanelmenu->setChecked(true);
d_controlpanel->toggleTriggerMode(getTriggerMode());
d_controlpanel->toggleMaxHold(d_maxhold_act->isChecked());
d_controlpanel->toggleMinHold(d_minhold_act->isChecked());
+ d_controlpanel->setFFTAverage(getFFTAverage());
emit signalFFTSize(getFFTSize());
emit signalFFTWindow(getFFTWindowType());
diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc
index 376f50a4a4..13e50b217c 100644
--- a/gr-qtgui/lib/histogram_sink_f_impl.cc
+++ b/gr-qtgui/lib/histogram_sink_f_impl.cc
@@ -123,11 +123,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new HistogramDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/qtgui_util.cc b/gr-qtgui/lib/qtgui_util.cc
index 07cf3cc9a3..0a0c826bbe 100644
--- a/gr-qtgui/lib/qtgui_util.cc
+++ b/gr-qtgui/lib/qtgui_util.cc
@@ -21,8 +21,11 @@
*/
#include <gnuradio/qtgui/utils.h>
+#include <gnuradio/prefs.h>
#include <QDebug>
#include <QFile>
+#include <QCoreApplication>
+#include <qapplication.h>
QString
get_qt_style_sheet(QString filename)
@@ -101,3 +104,12 @@ QwtDblClickPlotPicker::stateMachine(int n) const
{
return new QwtPickerDblClickPointMachine;
}
+
+void check_set_qss(QApplication *app){
+ std::string qssfile = gr::prefs::singleton()->get_string("qtgui","qss","");
+ if(qssfile.size() > 0) {
+ QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
+ app->setStyleSheet(sstext);
+ }
+}
+
diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc
index 14ddde8e20..ba1be4b7c3 100644
--- a/gr-qtgui/lib/sink_c_impl.cc
+++ b/gr-qtgui/lib/sink_c_impl.cc
@@ -138,11 +138,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
if(d_center_freq < 0) {
throw std::runtime_error("sink_c_impl: Received bad center frequency.\n");
diff --git a/gr-qtgui/lib/sink_f_impl.cc b/gr-qtgui/lib/sink_f_impl.cc
index e60e98a59b..73b6fcad83 100644
--- a/gr-qtgui/lib/sink_f_impl.cc
+++ b/gr-qtgui/lib/sink_f_impl.cc
@@ -138,11 +138,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
uint64_t maxBufferSize = 32768;
d_main_gui = new SpectrumGUIClass(maxBufferSize, d_fftsize,
diff --git a/gr-qtgui/lib/time_raster_sink_b_impl.cc b/gr-qtgui/lib/time_raster_sink_b_impl.cc
index 7b252a4d1c..1e2fe360b1 100644
--- a/gr-qtgui/lib/time_raster_sink_b_impl.cc
+++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc
@@ -138,11 +138,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
// Create time raster plot; as a bit input, we expect to see 1's
// and 0's from each stream, so we set the maximum intensity
diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.cc b/gr-qtgui/lib/time_raster_sink_f_impl.cc
index 0e4cb1d345..e4cbb0d38f 100644
--- a/gr-qtgui/lib/time_raster_sink_f_impl.cc
+++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc
@@ -136,11 +136,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
// Create time raster plot; as a bit input, we expect to see 1's
// and 0's from each stream, so we set the maximum intensity
diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc
index b59e4c9461..25d5a687d1 100644
--- a/gr-qtgui/lib/time_sink_c_impl.cc
+++ b/gr-qtgui/lib/time_sink_c_impl.cc
@@ -137,11 +137,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 2;
d_main_gui = new TimeDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc
index 28bbb44ee9..419a9243c4 100644
--- a/gr-qtgui/lib/time_sink_f_impl.cc
+++ b/gr-qtgui/lib/time_sink_f_impl.cc
@@ -134,11 +134,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new TimeDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/vector_sink_f_impl.cc b/gr-qtgui/lib/vector_sink_f_impl.cc
index bafd1b73aa..fedef9654d 100644
--- a/gr-qtgui/lib/vector_sink_f_impl.cc
+++ b/gr-qtgui/lib/vector_sink_f_impl.cc
@@ -147,11 +147,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
d_main_gui = new VectorDisplayForm(d_nconnections, d_parent);
d_main_gui->setVecSize(d_vlen);
diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.cc b/gr-qtgui/lib/waterfall_sink_c_impl.cc
index d3ca347c36..4306b97d71 100644
--- a/gr-qtgui/lib/waterfall_sink_c_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc
@@ -162,11 +162,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new WaterfallDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.cc b/gr-qtgui/lib/waterfall_sink_f_impl.cc
index 4b062de14d..9789c2cf6d 100644
--- a/gr-qtgui/lib/waterfall_sink_f_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc
@@ -162,11 +162,7 @@ namespace gr {
}
// If a style sheet is set in the prefs file, enable it here.
- std::string qssfile = prefs::singleton()->get_string("qtgui","qss","");
- if(qssfile.size() > 0) {
- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
- d_qApplication->setStyleSheet(sstext);
- }
+ check_set_qss(d_qApplication);
int numplots = (d_nconnections > 0) ? d_nconnections : 1;
d_main_gui = new WaterfallDisplayForm(numplots, d_parent);
diff --git a/gr-qtgui/python/qtgui/CMakeLists.txt b/gr-qtgui/python/qtgui/CMakeLists.txt
index 23e75e6583..5df3a7d91b 100644
--- a/gr-qtgui/python/qtgui/CMakeLists.txt
+++ b/gr-qtgui/python/qtgui/CMakeLists.txt
@@ -27,10 +27,12 @@ else()
endif()
configure_file(range.py.cmakein "${CMAKE_CURRENT_BINARY_DIR}/range.py" @ONLY)
+configure_file(util.py.cmakein "${CMAKE_CURRENT_BINARY_DIR}/util.py" @ONLY)
GR_PYTHON_INSTALL(
FILES __init__.py
"${CMAKE_CURRENT_BINARY_DIR}/range.py"
+ "${CMAKE_CURRENT_BINARY_DIR}/util.py"
DESTINATION ${GR_PYTHON_DIR}/gnuradio/qtgui
)
diff --git a/gr-qtgui/python/qtgui/__init__.py b/gr-qtgui/python/qtgui/__init__.py
index 224bde071e..8b60dc6dbe 100644
--- a/gr-qtgui/python/qtgui/__init__.py
+++ b/gr-qtgui/python/qtgui/__init__.py
@@ -35,3 +35,4 @@ except ImportError:
from qtgui_swig import *
from range import Range, RangeWidget
+import util
diff --git a/gr-qtgui/python/qtgui/range.py.cmakein b/gr-qtgui/python/qtgui/range.py.cmakein
index 45aa762ae3..00db509762 100755
--- a/gr-qtgui/python/qtgui/range.py.cmakein
+++ b/gr-qtgui/python/qtgui/range.py.cmakein
@@ -22,6 +22,7 @@
#
@PY_QT_IMPORT@
+import util
class Range(object):
def __init__(self, minv, maxv, step, default, min_length):
@@ -32,6 +33,7 @@ class Range(object):
self.min_length = min_length
self.find_precision()
self.find_nsteps()
+ util.check_set_qss()
def find_precision(self):
# Get the decimal part of the step
diff --git a/gr-blocks/python/grc_gnuradio/blks2/__init__.py b/gr-qtgui/python/qtgui/util.py.cmakein
index d3c8210834..ec654d9ba2 100644
--- a/gr-blocks/python/grc_gnuradio/blks2/__init__.py
+++ b/gr-qtgui/python/qtgui/util.py.cmakein
@@ -1,4 +1,7 @@
-# Copyright 2008-2011 Free Software Foundation, Inc.
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright 2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -18,13 +21,14 @@
# Boston, MA 02110-1301, USA.
#
-from selector import selector, valve
-from error_rate import error_rate
-from tcp import tcp_source, tcp_sink
+@PY_QT_IMPORT@
+from gnuradio import gr
-try:
- from packet import options, packet_encoder, packet_decoder, \
- packet_mod_b, packet_mod_s, packet_mod_i, packet_mod_f, packet_mod_c, \
- packet_demod_b, packet_demod_s, packet_demod_i, packet_demod_f, packet_demod_c
-except ImportError:
- pass # only available if gr-digital is install
+def check_set_qss():
+ app = QtWidgets.qApp
+ qssfile = gr.prefs().get_string("qtgui","qss","")
+ if(len(qssfile)>0):
+ try:
+ app.setStyleSheet(open(qssfile).read())
+ except:
+ print "WARNING: bad QSS file, %s"%(qssfile)
diff --git a/gr-trellis/examples/python/CMakeLists.txt b/gr-trellis/examples/python/CMakeLists.txt
index 76c88ee2f4..efb8d98144 100644
--- a/gr-trellis/examples/python/CMakeLists.txt
+++ b/gr-trellis/examples/python/CMakeLists.txt
@@ -22,7 +22,6 @@ include(GrPython)
GR_PYTHON_INSTALL(
PROGRAMS
test_tcm.py
- test_cpm.py
DESTINATION ${GR_PKG_TRELLIS_EXAMPLES_DIR}
)
diff --git a/gr-trellis/examples/python/test_cpm.py b/gr-trellis/examples/python/test_cpm.py
deleted file mode 100755
index 8014c8702a..0000000000
--- a/gr-trellis/examples/python/test_cpm.py
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/env python
-##################################################
-# Gnuradio Python Flow Graph
-# Title: CPM test
-# Author: Achilleas Anastasopoulos
-# Description: gnuradio flow graph
-# Generated: Thu Feb 19 23:16:23 2009
-##################################################
-
-from gnuradio import gr
-from gnuradio import trellis, digital, filter, blocks
-from grc_gnuradio import blks2 as grc_blks2
-import math
-import numpy
-from gnuradio import trellis
-from gnuradio.trellis import fsm_utils
-
-try:
- from gnuradio import analog
-except ImportError:
- sys.stderr.write("Error: Program requires gr-analog.\n")
- sys.exit(1)
-
-try:
- import scipy.stats
-except ImportError:
- print "Error: Program requires scipy (see: www.scipy.org)."
- sys.exit(1)
-
-def run_test(seed,blocksize):
- tb = gr.top_block()
-
- ##################################################
- # Variables
- ##################################################
- M = 2
- K = 1
- P = 2
- h = (1.0*K)/P
- L = 3
- Q = 4
- frac = 0.99
- f = trellis.fsm(P,M,L)
-
- # CPFSK signals
- #p = numpy.ones(L*Q)
- #p = p/sum(p)*Q/2.0;
- #q = numpy.cumsum(p)
- #q = q/q[-1]/2.0;
-
- # GMSK signals
- BT=0.3;
- tt=numpy.arange(0,L*Q)/(1.0*Q)-L/2.0;
- #print tt
- p=(0.5*scipy.special.erfc(2*math.pi*BT*(tt-0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0))-0.5*scipy.special.erfc(2*math.pi*BT*(tt+0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0)))/2.0;
- p=p/sum(p)*Q/2.0;
- #print p
- q=numpy.cumsum(p);
- q=q/q[-1]/2.0;
- #print q
-
- (f0T,SS,S,F,Sf,Ff,N) = fsm_utils.make_cpm_signals(K,P,M,L,q,frac)
- #print N
- #print Ff
- Ffa = numpy.insert(Ff,Q,numpy.zeros(N),axis=0)
- #print Ffa
- MF = numpy.fliplr(numpy.transpose(Ffa))
- #print MF
- E = numpy.sum(numpy.abs(Sf)**2,axis=0)
- Es = numpy.sum(E)/f.O()
- #print Es
-
- constellation = numpy.reshape(numpy.transpose(Sf),N*f.O())
- #print Ff
- #print Sf
- #print constellation
- #print numpy.max(numpy.abs(SS - numpy.dot(Ff , Sf)))
-
- EsN0_db = 10.0
- N0 = Es * 10.0**(-(1.0*EsN0_db)/10.0)
- #N0 = 0.0
- #print N0
- head = 4
- tail = 4
- numpy.random.seed(seed*666)
- data = numpy.random.randint(0, M, head+blocksize+tail+1)
- #data = numpy.zeros(blocksize+1+head+tail,'int')
- for i in range(head):
- data[i]=0
- for i in range(tail+1):
- data[-i]=0
-
-
-
- ##################################################
- # Blocks
- ##################################################
- random_source_x_0 = blocks.vector_source_b(data.tolist(), False)
- digital_chunks_to_symbols_xx_0 = digital.chunks_to_symbols_bf((-1, 1), 1)
- filter_interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(Q, p)
- analog_frequency_modulator_fc_0 = analog.frequency_modulator_fc(2*math.pi*h*(1.0/Q))
-
- blocks_add_vxx_0 = blocks.add_vcc(1)
- analog_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, (N0/2.0)**0.5, -long(seed))
-
- blocks_multiply_vxx_0 = blocks.multiply_vcc(1)
- analog_sig_source_x_0 = analog.sig_source_c(Q, analog.GR_COS_WAVE, -f0T, 1, 0)
- # only works for N=2, do it manually for N>2...
- filter_fir_filter_xxx_0_0 = filter.fir_filter_ccc(Q, MF[0].conjugate())
- filter_fir_filter_xxx_0_0_0 = filter.fir_filter_ccc(Q, MF[1].conjugate())
- blocks_streams_to_stream_0 = blocks.streams_to_stream(gr.sizeof_gr_complex*1, int(N))
- blocks_skiphead_0 = blocks.skiphead(gr.sizeof_gr_complex*1, int(N*(1+0)))
- viterbi = trellis.viterbi_combined_cb(f, head+blocksize+tail, 0, -1, int(N),
- constellation, digital.TRELLIS_EUCLIDEAN)
-
- blocks_vector_sink_x_0 = blocks.vector_sink_b()
-
- ##################################################
- # Connections
- ##################################################
- tb.connect((random_source_x_0, 0), (digital_chunks_to_symbols_xx_0, 0))
- tb.connect((digital_chunks_to_symbols_xx_0, 0), (filter_interp_fir_filter_xxx_0, 0))
- tb.connect((filter_interp_fir_filter_xxx_0, 0), (analog_frequency_modulator_fc_0, 0))
- tb.connect((analog_frequency_modulator_fc_0, 0), (blocks_add_vxx_0, 0))
- tb.connect((analog_noise_source_x_0, 0), (blocks_add_vxx_0, 1))
- tb.connect((blocks_add_vxx_0, 0), (blocks_multiply_vxx_0, 0))
- tb.connect((analog_sig_source_x_0, 0), (blocks_multiply_vxx_0, 1))
- tb.connect((blocks_multiply_vxx_0, 0), (filter_fir_filter_xxx_0_0, 0))
- tb.connect((blocks_multiply_vxx_0, 0), (filter_fir_filter_xxx_0_0_0, 0))
- tb.connect((filter_fir_filter_xxx_0_0, 0), (blocks_streams_to_stream_0, 0))
- tb.connect((filter_fir_filter_xxx_0_0_0, 0), (blocks_streams_to_stream_0, 1))
- tb.connect((blocks_streams_to_stream_0, 0), (blocks_skiphead_0, 0))
- tb.connect((blocks_skiphead_0, 0), (viterbi, 0))
- tb.connect((viterbi, 0), (blocks_vector_sink_x_0, 0))
-
-
- tb.run()
- dataest = blocks_vector_sink_x_0.data()
- #print data
- #print numpy.array(dataest)
- perr = 0
- err = 0
- for i in range(blocksize):
- if data[head+i] != dataest[head+i]:
- #print i
- err += 1
- if err != 0 :
- perr = 1
- return (err,perr)
-
-if __name__ == '__main__':
- blocksize = 1000
- ss=0
- ee=0
- for i in range(10000):
- (s,e) = run_test(i,blocksize)
- ss += s
- ee += e
- if (i+1) % 100 == 0:
- print i+1,ss,ee,(1.0*ss)/(i+1)/(1.0*blocksize),(1.0*ee)/(i+1)
- print i+1,ss,ee,(1.0*ss)/(i+1)/(1.0*blocksize),(1.0*ee)/(i+1)
diff --git a/gr-trellis/swig/CMakeLists.txt b/gr-trellis/swig/CMakeLists.txt
index e1ee66cba0..14012abad5 100644
--- a/gr-trellis/swig/CMakeLists.txt
+++ b/gr-trellis/swig/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2012 Free Software Foundation, Inc.
+# Copyright 2012,2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -24,10 +24,10 @@ include(GrPython)
include(GrSwig)
set(GR_SWIG_INCLUDE_DIRS
- ${GR_TRELLIS_INCLUDE_DIRS}
- ${GR_DIGITAL_INCLUDE_DIRS}
- ${GNURADIO_RUNTIME_SWIG_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS}
+ ${GR_TRELLIS_INCLUDE_DIRS}
+ ${GR_DIGITAL_INCLUDE_DIRS}
+ ${GNURADIO_RUNTIME_SWIG_INCLUDE_DIRS}
+ ${Boost_INCLUDE_DIRS}
)
set(GR_SWIG_LIBRARIES gnuradio-trellis gnuradio-digital)
@@ -36,25 +36,52 @@ if(ENABLE_GR_CTRLPORT)
list(APPEND GR_SWIG_FLAGS "-DGR_CTRLPORT")
endif(ENABLE_GR_CTRLPORT)
-# Setup swig docs to depend on includes and pull in from build directory
-set(GR_SWIG_TARGET_DEPS trellis_generated_includes)
-set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/trellis_swig_doc.i)
-set(GR_SWIG_DOC_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/trellis
- ${CMAKE_CURRENT_BINARY_DIR}/../include/gnuradio/trellis
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/trellis_swig.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/trellis_swig.py
+@ONLY)
+
+# We split up the swig files into multiple sections to minimize the
+# memory overhead. If a .i file grows too large, create a new file
+# named 'trellis_swigN.i' and add it to this list.
+#
+# Also add the line "from swig_trellisN import *" line to
+# trellis_swig.py.in.
+set(GR_SWIG_TRELLIS_IFILES
+ trellis_swig0
+ trellis_swig1
)
-set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc)
-GR_SWIG_MAKE(trellis_swig trellis_swig.i)
+foreach(swigfile ${GR_SWIG_TRELLIS_IFILES})
+ set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${swigfile}_doc.i)
+ set(GR_SWIG_DOC_DIRS
+ ${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/trellis
+ ${CMAKE_CURRENT_BINARY_DIR}/../include/gnuradio/trellis
+ )
+ set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc)
+ set(GR_SWIG_TARGET_DEPS trellis_generated_includes)
+ set(GR_SWIG_LIBRARIES gnuradio-trellis gnuradio-digital)
+ GR_SWIG_MAKE(${swigfile} ${swigfile}.i)
-GR_SWIG_INSTALL(
- TARGETS trellis_swig
+ GR_SWIG_INSTALL(
+ TARGETS ${swigfile}
DESTINATION ${GR_PYTHON_DIR}/gnuradio/trellis
-)
+ )
+
+ list(APPEND SWIGFILES ${swigfile}.i)
+ list(APPEND SWIGDOCFILES ${CMAKE_CURRENT_BINARY_DIR}/${swigfile}_doc.i)
+endforeach(swigfile)
install(
FILES
- trellis_swig.i
- ${CMAKE_CURRENT_BINARY_DIR}/trellis_swig_doc.i
+ ${SWIGFILES}
+ ${SWIGDOCFILES}
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
)
+
+# Install the Python file that pulls in the swig built files.
+GR_PYTHON_INSTALL(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/trellis_swig.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/trellis
+ COMPONENT "trellis_python"
+)
diff --git a/gr-blocks/python/grc_gnuradio/CMakeLists.txt b/gr-trellis/swig/trellis_swig.py.in
index 33c7560ea6..fac5f631e2 100644
--- a/gr-blocks/python/grc_gnuradio/CMakeLists.txt
+++ b/gr-trellis/swig/trellis_swig.py.in
@@ -1,4 +1,5 @@
-# Copyright 2011 Free Software Foundation, Inc.
+#
+# Copyright 2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -16,20 +17,7 @@
# 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(
- FILES __init__.py
- DESTINATION ${GR_PYTHON_DIR}/grc_gnuradio
-)
-
-GR_PYTHON_INSTALL(FILES
- blks2/__init__.py
- blks2/error_rate.py
- blks2/selector.py
- blks2/tcp.py
- DESTINATION ${GR_PYTHON_DIR}/grc_gnuradio/blks2
-)
+from trellis_swig0 import *
+from trellis_swig1 import *
diff --git a/gr-trellis/swig/trellis_swig0.i b/gr-trellis/swig/trellis_swig0.i
new file mode 100644
index 0000000000..9f309c5ca3
--- /dev/null
+++ b/gr-trellis/swig/trellis_swig0.i
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2012,2016 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.
+ */
+
+#define TRELLIS_API
+#define DIGITAL_API
+
+%include "gnuradio.i"
+
+//load generated python docstrings
+%include "trellis_swig0_doc.i"
+
+%include "gnuradio/digital/metric_type.h"
+%include "gnuradio/digital/constellation.h"
+%include "gnuradio/trellis/siso_type.h"
+%include "gnuradio/trellis/fsm.h"
+%include "gnuradio/trellis/interleaver.h"
+
+%{
+#include "gnuradio/trellis/constellation_metrics_cf.h"
+#include "gnuradio/trellis/permutation.h"
+#include "gnuradio/trellis/siso_combined_f.h"
+#include "gnuradio/trellis/siso_f.h"
+#include "gnuradio/trellis/encoder_bb.h"
+#include "gnuradio/trellis/encoder_bs.h"
+#include "gnuradio/trellis/encoder_bi.h"
+#include "gnuradio/trellis/encoder_ss.h"
+#include "gnuradio/trellis/encoder_si.h"
+#include "gnuradio/trellis/encoder_ii.h"
+#include "gnuradio/trellis/sccc_encoder_bb.h"
+#include "gnuradio/trellis/sccc_encoder_bs.h"
+#include "gnuradio/trellis/sccc_encoder_bi.h"
+#include "gnuradio/trellis/sccc_encoder_ss.h"
+#include "gnuradio/trellis/sccc_encoder_si.h"
+#include "gnuradio/trellis/sccc_encoder_ii.h"
+#include "gnuradio/trellis/pccc_encoder_bb.h"
+#include "gnuradio/trellis/pccc_encoder_bs.h"
+#include "gnuradio/trellis/pccc_encoder_bi.h"
+#include "gnuradio/trellis/pccc_encoder_ss.h"
+#include "gnuradio/trellis/pccc_encoder_si.h"
+#include "gnuradio/trellis/pccc_encoder_ii.h"
+#include "gnuradio/trellis/metrics_s.h"
+#include "gnuradio/trellis/metrics_i.h"
+#include "gnuradio/trellis/metrics_f.h"
+#include "gnuradio/trellis/metrics_c.h"
+%}
+
+%include "gnuradio/trellis/constellation_metrics_cf.h"
+%include "gnuradio/trellis/permutation.h"
+%include "gnuradio/trellis/siso_combined_f.h"
+%include "gnuradio/trellis/siso_f.h"
+%include "gnuradio/trellis/encoder_bb.h"
+%include "gnuradio/trellis/encoder_bs.h"
+%include "gnuradio/trellis/encoder_bi.h"
+%include "gnuradio/trellis/encoder_ss.h"
+%include "gnuradio/trellis/encoder_si.h"
+%include "gnuradio/trellis/encoder_ii.h"
+%include "gnuradio/trellis/sccc_encoder_bb.h"
+%include "gnuradio/trellis/sccc_encoder_bs.h"
+%include "gnuradio/trellis/sccc_encoder_bi.h"
+%include "gnuradio/trellis/sccc_encoder_ss.h"
+%include "gnuradio/trellis/sccc_encoder_si.h"
+%include "gnuradio/trellis/sccc_encoder_ii.h"
+%include "gnuradio/trellis/pccc_encoder_bb.h"
+%include "gnuradio/trellis/pccc_encoder_bs.h"
+%include "gnuradio/trellis/pccc_encoder_bi.h"
+%include "gnuradio/trellis/pccc_encoder_ss.h"
+%include "gnuradio/trellis/pccc_encoder_si.h"
+%include "gnuradio/trellis/pccc_encoder_ii.h"
+%include "gnuradio/trellis/metrics_s.h"
+%include "gnuradio/trellis/metrics_i.h"
+%include "gnuradio/trellis/metrics_f.h"
+%include "gnuradio/trellis/metrics_c.h"
+
+GR_SWIG_BLOCK_MAGIC2(trellis, constellation_metrics_cf);
+GR_SWIG_BLOCK_MAGIC2(trellis, permutation);
+GR_SWIG_BLOCK_MAGIC2(trellis, siso_combined_f);
+GR_SWIG_BLOCK_MAGIC2(trellis, siso_f);
+GR_SWIG_BLOCK_MAGIC2(trellis, encoder_bb);
+GR_SWIG_BLOCK_MAGIC2(trellis, encoder_bs);
+GR_SWIG_BLOCK_MAGIC2(trellis, encoder_bi);
+GR_SWIG_BLOCK_MAGIC2(trellis, encoder_ss);
+GR_SWIG_BLOCK_MAGIC2(trellis, encoder_si);
+GR_SWIG_BLOCK_MAGIC2(trellis, encoder_ii);
+GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_bb);
+GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_bs);
+GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_bi);
+GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_ss);
+GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_si);
+GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_ii);
+GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_bb);
+GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_bs);
+GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_bi);
+GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_ss);
+GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_si);
+GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_ii);
+GR_SWIG_BLOCK_MAGIC2(trellis, metrics_s);
+GR_SWIG_BLOCK_MAGIC2(trellis, metrics_i);
+GR_SWIG_BLOCK_MAGIC2(trellis, metrics_f);
+GR_SWIG_BLOCK_MAGIC2(trellis, metrics_c);
diff --git a/gr-trellis/swig/trellis_swig.i b/gr-trellis/swig/trellis_swig1.i
index 8c71a5e93c..6481aee245 100644
--- a/gr-trellis/swig/trellis_swig.i
+++ b/gr-trellis/swig/trellis_swig1.i
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 Free Software Foundation, Inc.
+ * Copyright 2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -25,41 +25,14 @@
%include "gnuradio.i"
//load generated python docstrings
-%include "trellis_swig_doc.i"
+%include "trellis_swig1_doc.i"
%include "gnuradio/digital/metric_type.h"
-%include "gnuradio/digital/constellation.h"
%include "gnuradio/trellis/siso_type.h"
%include "gnuradio/trellis/fsm.h"
%include "gnuradio/trellis/interleaver.h"
%{
-#include "gnuradio/trellis/constellation_metrics_cf.h"
-#include "gnuradio/trellis/permutation.h"
-#include "gnuradio/trellis/siso_combined_f.h"
-#include "gnuradio/trellis/siso_f.h"
-#include "gnuradio/trellis/encoder_bb.h"
-#include "gnuradio/trellis/encoder_bs.h"
-#include "gnuradio/trellis/encoder_bi.h"
-#include "gnuradio/trellis/encoder_ss.h"
-#include "gnuradio/trellis/encoder_si.h"
-#include "gnuradio/trellis/encoder_ii.h"
-#include "gnuradio/trellis/sccc_encoder_bb.h"
-#include "gnuradio/trellis/sccc_encoder_bs.h"
-#include "gnuradio/trellis/sccc_encoder_bi.h"
-#include "gnuradio/trellis/sccc_encoder_ss.h"
-#include "gnuradio/trellis/sccc_encoder_si.h"
-#include "gnuradio/trellis/sccc_encoder_ii.h"
-#include "gnuradio/trellis/pccc_encoder_bb.h"
-#include "gnuradio/trellis/pccc_encoder_bs.h"
-#include "gnuradio/trellis/pccc_encoder_bi.h"
-#include "gnuradio/trellis/pccc_encoder_ss.h"
-#include "gnuradio/trellis/pccc_encoder_si.h"
-#include "gnuradio/trellis/pccc_encoder_ii.h"
-#include "gnuradio/trellis/metrics_s.h"
-#include "gnuradio/trellis/metrics_i.h"
-#include "gnuradio/trellis/metrics_f.h"
-#include "gnuradio/trellis/metrics_c.h"
#include "gnuradio/trellis/pccc_decoder_b.h"
#include "gnuradio/trellis/pccc_decoder_s.h"
#include "gnuradio/trellis/pccc_decoder_i.h"
@@ -95,32 +68,6 @@
#include "gnuradio/trellis/sccc_decoder_combined_ci.h"
%}
-%include "gnuradio/trellis/constellation_metrics_cf.h"
-%include "gnuradio/trellis/permutation.h"
-%include "gnuradio/trellis/siso_combined_f.h"
-%include "gnuradio/trellis/siso_f.h"
-%include "gnuradio/trellis/encoder_bb.h"
-%include "gnuradio/trellis/encoder_bs.h"
-%include "gnuradio/trellis/encoder_bi.h"
-%include "gnuradio/trellis/encoder_ss.h"
-%include "gnuradio/trellis/encoder_si.h"
-%include "gnuradio/trellis/encoder_ii.h"
-%include "gnuradio/trellis/sccc_encoder_bb.h"
-%include "gnuradio/trellis/sccc_encoder_bs.h"
-%include "gnuradio/trellis/sccc_encoder_bi.h"
-%include "gnuradio/trellis/sccc_encoder_ss.h"
-%include "gnuradio/trellis/sccc_encoder_si.h"
-%include "gnuradio/trellis/sccc_encoder_ii.h"
-%include "gnuradio/trellis/pccc_encoder_bb.h"
-%include "gnuradio/trellis/pccc_encoder_bs.h"
-%include "gnuradio/trellis/pccc_encoder_bi.h"
-%include "gnuradio/trellis/pccc_encoder_ss.h"
-%include "gnuradio/trellis/pccc_encoder_si.h"
-%include "gnuradio/trellis/pccc_encoder_ii.h"
-%include "gnuradio/trellis/metrics_s.h"
-%include "gnuradio/trellis/metrics_i.h"
-%include "gnuradio/trellis/metrics_f.h"
-%include "gnuradio/trellis/metrics_c.h"
%include "gnuradio/trellis/pccc_decoder_b.h"
%include "gnuradio/trellis/pccc_decoder_s.h"
%include "gnuradio/trellis/pccc_decoder_i.h"
@@ -155,32 +102,6 @@
%include "gnuradio/trellis/sccc_decoder_combined_cs.h"
%include "gnuradio/trellis/sccc_decoder_combined_ci.h"
-GR_SWIG_BLOCK_MAGIC2(trellis, constellation_metrics_cf);
-GR_SWIG_BLOCK_MAGIC2(trellis, permutation);
-GR_SWIG_BLOCK_MAGIC2(trellis, siso_combined_f);
-GR_SWIG_BLOCK_MAGIC2(trellis, siso_f);
-GR_SWIG_BLOCK_MAGIC2(trellis, encoder_bb);
-GR_SWIG_BLOCK_MAGIC2(trellis, encoder_bs);
-GR_SWIG_BLOCK_MAGIC2(trellis, encoder_bi);
-GR_SWIG_BLOCK_MAGIC2(trellis, encoder_ss);
-GR_SWIG_BLOCK_MAGIC2(trellis, encoder_si);
-GR_SWIG_BLOCK_MAGIC2(trellis, encoder_ii);
-GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_bb);
-GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_bs);
-GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_bi);
-GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_ss);
-GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_si);
-GR_SWIG_BLOCK_MAGIC2(trellis, sccc_encoder_ii);
-GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_bb);
-GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_bs);
-GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_bi);
-GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_ss);
-GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_si);
-GR_SWIG_BLOCK_MAGIC2(trellis, pccc_encoder_ii);
-GR_SWIG_BLOCK_MAGIC2(trellis, metrics_s);
-GR_SWIG_BLOCK_MAGIC2(trellis, metrics_i);
-GR_SWIG_BLOCK_MAGIC2(trellis, metrics_f);
-GR_SWIG_BLOCK_MAGIC2(trellis, metrics_c);
GR_SWIG_BLOCK_MAGIC2(trellis, pccc_decoder_b);
GR_SWIG_BLOCK_MAGIC2(trellis, pccc_decoder_s);
GR_SWIG_BLOCK_MAGIC2(trellis, pccc_decoder_i);
diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt
index cb4fda82af..f6d956c1e1 100644
--- a/gr-uhd/CMakeLists.txt
+++ b/gr-uhd/CMakeLists.txt
@@ -22,7 +22,7 @@
########################################################################
include(GrBoost)
-find_package(UHD)
+find_package(UHD "3.5.5")
########################################################################
# Register component
diff --git a/gr-uhd/apps/uhd_app.py b/gr-uhd/apps/uhd_app.py
index 652a9fbab6..8e377f0b4d 100644
--- a/gr-uhd/apps/uhd_app.py
+++ b/gr-uhd/apps/uhd_app.py
@@ -121,6 +121,20 @@ class UHDApp(object):
antennas = [antennas[0],] * len(args.channels)
return antennas
+ def normalize_subdev_sel(self, spec):
+ """
+ """
+ if spec is None:
+ return None
+ specs = [x.strip() for x in spec.split(",")]
+ if len(specs) == 1:
+ return spec
+ elif len(specs) != self.usrp.get_num_mboards():
+ raise ValueError("Invalid subdev setting for {n} mboards: {a}".format(
+ n=len(self.usrp.get_num_mboards()), a=spec
+ ))
+ return specs
+
def async_callback(self, msg):
"""
Call this when USRP async metadata needs printing.
@@ -151,9 +165,13 @@ class UHDApp(object):
)
)
# Set the subdevice spec:
+ args.spec = self.normalize_subdev_sel(args.spec)
if args.spec:
for mb_idx in xrange(self.usrp.get_num_mboards()):
- self.usrp.set_subdev_spec(args.spec, mb_idx)
+ if isinstance(args.spec, list):
+ self.usrp.set_subdev_spec(args.spec[mb_idx], mb_idx)
+ else:
+ self.usrp.set_subdev_spec(args.spec, mb_idx)
# Set the clock and/or time source:
if args.clock_source is not None:
for mb_idx in xrange(self.usrp.get_num_mboards()):
@@ -298,8 +316,8 @@ class UHDApp(object):
tx_or_rx = tx_or_rx.strip() + " "
group = parser.add_argument_group('USRP Arguments')
group.add_argument("-a", "--args", default="", help="UHD device address args")
- group.add_argument("--spec", help="Subdevice of UHD device where appropriate")
- group.add_argument("-A", "--antenna", help="Select {xx}Antenna(s) where appropriate".format(xx=tx_or_rx))
+ group.add_argument("--spec", help="Subdevice(s) of UHD device where appropriate. Use a comma-separated list to set different boards to different specs.")
+ group.add_argument("-A", "--antenna", help="Select {xx}antenna(s) where appropriate".format(xx=tx_or_rx))
group.add_argument("-s", "--samp-rate", type=eng_arg.eng_float, default=1e6,
help="Sample rate")
group.add_argument("-g", "--gain", type=eng_arg.eng_float, default=None,
diff --git a/gr-uhd/include/gnuradio/uhd/usrp_sink.h b/gr-uhd/include/gnuradio/uhd/usrp_sink.h
index 4ccb83f595..3b5a9a60e8 100644
--- a/gr-uhd/include/gnuradio/uhd/usrp_sink.h
+++ b/gr-uhd/include/gnuradio/uhd/usrp_sink.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2015 Free Software Foundation, Inc.
+ * Copyright 2010-2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -25,28 +25,6 @@
#include <gnuradio/uhd/usrp_block.h>
-// TODO In 3.8, UHD 3.4 will be required and we can remove all these ifdefs
-#ifndef INCLUDED_UHD_STREAM_HPP
-namespace uhd {
- struct GR_UHD_API stream_args_t
- {
- stream_args_t(const std::string &cpu = "",
- const std::string &otw = "")
- {
- cpu_format = cpu;
- otw_format = otw;
- }
- std::string cpu_format;
- std::string otw_format;
- device_addr_t args;
- std::vector<size_t> channels;
- };
-}
-# define INCLUDED_UHD_STREAM_HPP
-#else
-# define GR_UHD_USE_STREAM_API
-#endif
-
namespace gr {
namespace uhd {
@@ -124,17 +102,6 @@ namespace gr {
typedef boost::shared_ptr<usrp_sink> sptr;
/*!
- * \brief DEPRECATED Make a new USRP sink block using the deprecated io_type_t.
- * \ingroup uhd_blk
- *
- * This function will be removed in the future. Please use the other make function,
- * gr::uhd::usrp_sink::make(const ::uhd::device_addr_t, const ::uhd::stream_args_t, const std::string).
- */
- static sptr make(const ::uhd::device_addr_t &device_addr,
- const ::uhd::io_type_t &io_type,
- size_t num_channels);
-
- /*!
* \param device_addr the address to identify the hardware
* \param stream_args the IO format and channel specification
* \param tsb_tag_name the name of the tag identifying tagged stream length
diff --git a/gr-uhd/include/gnuradio/uhd/usrp_source.h b/gr-uhd/include/gnuradio/uhd/usrp_source.h
index a0022b3876..552c518f1c 100644
--- a/gr-uhd/include/gnuradio/uhd/usrp_source.h
+++ b/gr-uhd/include/gnuradio/uhd/usrp_source.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2015 Free Software Foundation, Inc.
+ * Copyright 2010-2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -25,28 +25,6 @@
#include <gnuradio/uhd/usrp_block.h>
-// TODO In 3.8, UHD 3.6 will be required and we can remove all these ifdefs
-#ifndef INCLUDED_UHD_STREAM_HPP
-namespace uhd {
- struct GR_UHD_API stream_args_t
- {
- stream_args_t(const std::string &cpu = "",
- const std::string &otw = "")
- {
- cpu_format = cpu;
- otw_format = otw;
- }
- std::string cpu_format;
- std::string otw_format;
- device_addr_t args;
- std::vector<size_t> channels;
- };
-}
-# define INCLUDED_UHD_STREAM_HPP
-#else
-# define GR_UHD_USE_STREAM_API
-#endif
-
namespace gr {
namespace uhd {
@@ -83,17 +61,6 @@ namespace gr {
typedef boost::shared_ptr<usrp_source> sptr;
/*!
- * \brief DEPRECATED Make a new USRP source block using the deprecated io_type_t.
- * \ingroup uhd_blk
- *
- * This function will be removed in the future. Please use the other make function,
- * gr::uhd::make(const ::uhd::device_addr_t, const ::uhd::stream_args_t, const std::string).
- */
- static sptr make(const ::uhd::device_addr_t &device_addr,
- const ::uhd::io_type_t &io_type,
- size_t num_channels);
-
- /*!
* \param device_addr the address to identify the hardware
* \param stream_args the IO format and channel specification
* \param issue_stream_cmd_on_start enable or disable continuous streaming when flowgraph
diff --git a/gr-uhd/lib/CMakeLists.txt b/gr-uhd/lib/CMakeLists.txt
index 2427516c9a..d58f0dd01c 100644
--- a/gr-uhd/lib/CMakeLists.txt
+++ b/gr-uhd/lib/CMakeLists.txt
@@ -24,9 +24,9 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${GR_UHD_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
+ ${UHD_INCLUDE_DIRS}
${LOG4CXX_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
- ${UHD_INCLUDE_DIRS}
)
link_directories(
diff --git a/gr-uhd/lib/usrp_block_impl.cc b/gr-uhd/lib/usrp_block_impl.cc
index 7f3478c1a5..341e1a9fd8 100644
--- a/gr-uhd/lib/usrp_block_impl.cc
+++ b/gr-uhd/lib/usrp_block_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2015 Free Software Foundation, Inc.
+ * Copyright 2015-2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -245,62 +245,38 @@ void
usrp_block_impl::set_time_source(const std::string &source,
const size_t mboard)
{
-#ifdef UHD_USRP_MULTI_USRP_REF_SOURCES_API
return _dev->set_time_source(source, mboard);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
std::string
usrp_block_impl::get_time_source(const size_t mboard)
{
-#ifdef UHD_USRP_MULTI_USRP_REF_SOURCES_API
return _dev->get_time_source(mboard);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
std::vector<std::string>
usrp_block_impl::get_time_sources(const size_t mboard)
{
-#ifdef UHD_USRP_MULTI_USRP_REF_SOURCES_API
return _dev->get_time_sources(mboard);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
void
usrp_block_impl::set_clock_source(const std::string &source,
const size_t mboard)
{
-#ifdef UHD_USRP_MULTI_USRP_REF_SOURCES_API
return _dev->set_clock_source(source, mboard);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
std::string
usrp_block_impl::get_clock_source(const size_t mboard)
{
-#ifdef UHD_USRP_MULTI_USRP_REF_SOURCES_API
return _dev->get_clock_source(mboard);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
std::vector<std::string>
usrp_block_impl::get_clock_sources(const size_t mboard)
{
-#ifdef UHD_USRP_MULTI_USRP_REF_SOURCES_API
return _dev->get_clock_sources(mboard);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
double
@@ -373,21 +349,13 @@ void
usrp_block_impl::set_command_time(const ::uhd::time_spec_t &time_spec,
size_t mboard)
{
-#ifdef UHD_USRP_MULTI_USRP_COMMAND_TIME_API
return _dev->set_command_time(time_spec, mboard);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
void
usrp_block_impl::clear_command_time(size_t mboard)
{
-#ifdef UHD_USRP_MULTI_USRP_COMMAND_TIME_API
return _dev->clear_command_time(mboard);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
void
@@ -395,11 +363,7 @@ usrp_block_impl::set_user_register(const uint8_t addr,
const uint32_t data,
size_t mboard)
{
-#ifdef UHD_USRP_MULTI_USRP_USER_REGS_API
_dev->set_user_register(addr, data, mboard);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
void
diff --git a/gr-uhd/lib/usrp_block_impl.h b/gr-uhd/lib/usrp_block_impl.h
index a1bbf97826..8285bda42c 100644
--- a/gr-uhd/lib/usrp_block_impl.h
+++ b/gr-uhd/lib/usrp_block_impl.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2015 Free Software Foundation, Inc.
+ * Copyright 2015-2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
diff --git a/gr-uhd/lib/usrp_sink_impl.cc b/gr-uhd/lib/usrp_sink_impl.cc
index d8f98fdd80..6288b80cc8 100644
--- a/gr-uhd/lib/usrp_sink_impl.cc
+++ b/gr-uhd/lib/usrp_sink_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2015 Free Software Foundation, Inc.
+ * Copyright 2010-2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -31,26 +31,6 @@ namespace gr {
usrp_sink::sptr
usrp_sink::make(const ::uhd::device_addr_t &device_addr,
- const ::uhd::io_type_t &io_type,
- size_t num_channels)
- {
- //fill in the streamer args
- ::uhd::stream_args_t stream_args;
- switch(io_type.tid) {
- case ::uhd::io_type_t::COMPLEX_FLOAT32: stream_args.cpu_format = "fc32"; break;
- case ::uhd::io_type_t::COMPLEX_INT16: stream_args.cpu_format = "sc16"; break;
- default: throw std::runtime_error("only complex float and shorts known to work");
- }
-
- stream_args.otw_format = "sc16"; //only sc16 known to work
- for(size_t chan = 0; chan < num_channels; chan++)
- stream_args.channels.push_back(chan); //linear mapping
-
- return usrp_sink::make(device_addr, stream_args, "");
- }
-
- usrp_sink::sptr
- usrp_sink::make(const ::uhd::device_addr_t &device_addr,
const ::uhd::stream_args_t &stream_args,
const std::string &length_tag_name)
{
@@ -80,11 +60,7 @@ namespace gr {
usrp_sink_impl::get_usrp_info(size_t chan)
{
chan = _stream_args.channels[chan];
-#ifdef UHD_USRP_MULTI_USRP_GET_USRP_INFO_API
return _dev->get_usrp_tx_info(chan);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
void
@@ -119,11 +95,7 @@ namespace gr {
::uhd::meta_range_t
usrp_sink_impl::get_samp_rates(void)
{
-#ifdef UHD_USRP_MULTI_USRP_GET_RATES_API
return _dev->get_tx_rates(_stream_args.channels[0]);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
::uhd::tune_result_t
@@ -274,11 +246,7 @@ namespace gr {
size_t chan)
{
chan = _stream_args.channels[chan];
-#ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
return _dev->set_tx_dc_offset(offset, chan);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
void
@@ -286,11 +254,7 @@ namespace gr {
size_t chan)
{
chan = _stream_args.channels[chan];
-#ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
return _dev->set_tx_iq_balance(correction, chan);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
::uhd::sensor_value_t
@@ -318,12 +282,9 @@ namespace gr {
usrp_sink_impl::set_stream_args(const ::uhd::stream_args_t &stream_args)
{
_update_stream_args(stream_args);
-#ifdef GR_UHD_USE_STREAM_API
- if(_tx_stream)
+ if (_tx_stream) {
_tx_stream.reset();
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
+ }
}
/***********************************************************************
@@ -367,15 +328,10 @@ namespace gr {
}
}
-#ifdef GR_UHD_USE_STREAM_API
//send all ninput_items with metadata
- const size_t num_sent = _tx_stream->send
- (input_items, ninput_items, _metadata, 1.0);
-#else
- const size_t num_sent = _dev->get_device()->send
- (input_items, ninput_items, _metadata,
- *_type, ::uhd::device::SEND_MODE_FULL_BUFF, 1.0);
-#endif
+ const size_t num_sent = _tx_stream->send(
+ input_items, ninput_items, _metadata, 1.0
+ );
//if using length_tags, decrement items left to send by the number of samples sent
if(not pmt::is_null(_length_tag_key) && _nitems_to_send > 0) {
@@ -569,9 +525,7 @@ namespace gr {
bool
usrp_sink_impl::start(void)
{
-#ifdef GR_UHD_USE_STREAM_API
_tx_stream = _dev->get_tx_stream(_stream_args);
-#endif
_metadata.start_of_burst = true;
_metadata.end_of_burst = false;
@@ -586,14 +540,8 @@ namespace gr {
_metadata.time_spec = get_time_now() + ::uhd::time_spec_t(0.15);
}
-#ifdef GR_UHD_USE_STREAM_API
_tx_stream->send
(gr_vector_const_void_star(_nchan), 0, _metadata, 1.0);
-#else
- _dev->get_device()->send
- (gr_vector_const_void_star(_nchan), 0, _metadata,
- *_type, ::uhd::device::SEND_MODE_ONE_PACKET, 1.0);
-#endif
return true;
}
@@ -607,14 +555,9 @@ namespace gr {
_metadata.has_time_spec = false;
_nitems_to_send = 0;
-#ifdef GR_UHD_USE_STREAM_API
- if(_tx_stream)
+ if (_tx_stream) {
_tx_stream->send(gr_vector_const_void_star(_nchan), 0, _metadata, 1.0);
-#else
- _dev->get_device()->send
- (gr_vector_const_void_star(_nchan), 0, _metadata,
- *_type, ::uhd::device::SEND_MODE_ONE_PACKET, 1.0);
-#endif
+ }
return true;
}
diff --git a/gr-uhd/lib/usrp_sink_impl.h b/gr-uhd/lib/usrp_sink_impl.h
index d509baef90..304a02ca7b 100644
--- a/gr-uhd/lib/usrp_sink_impl.h
+++ b/gr-uhd/lib/usrp_sink_impl.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2015 Free Software Foundation, Inc.
+ * Copyright 2010-2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -37,15 +37,7 @@ namespace gr {
args_to_io_sig(const ::uhd::stream_args_t &args)
{
const size_t nchan = std::max<size_t>(args.channels.size(), 1);
-#ifdef GR_UHD_USE_STREAM_API
const size_t size = ::uhd::convert::get_bytes_per_item(args.cpu_format);
-#else
- size_t size = 0;
- if(args.cpu_format == "fc32")
- size = 8;
- if(args.cpu_format == "sc16")
- size = 4;
-#endif
return io_signature::make(nchan, nchan, size);
}
@@ -109,9 +101,7 @@ namespace gr {
//! Like set_center_freq(), but uses _curr_freq and _curr_lo_offset
::uhd::tune_result_t _set_center_freq_from_internals(size_t chan);
-#ifdef GR_UHD_USE_STREAM_API
::uhd::tx_streamer::sptr _tx_stream;
-#endif
::uhd::tx_metadata_t _metadata;
double _sample_rate;
diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc
index ab1e84ba3a..c840c43db1 100644
--- a/gr-uhd/lib/usrp_source_impl.cc
+++ b/gr-uhd/lib/usrp_source_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2015 Free Software Foundation, Inc.
+ * Copyright 2010-2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -35,26 +35,6 @@ namespace gr {
usrp_source::sptr
usrp_source::make(const ::uhd::device_addr_t &device_addr,
- const ::uhd::io_type_t &io_type,
- size_t num_channels)
- {
- //fill in the streamer args
- ::uhd::stream_args_t stream_args;
- switch(io_type.tid) {
- case ::uhd::io_type_t::COMPLEX_FLOAT32: stream_args.cpu_format = "fc32"; break;
- case ::uhd::io_type_t::COMPLEX_INT16: stream_args.cpu_format = "sc16"; break;
- default: throw std::runtime_error("only complex float and shorts known to work");
- }
-
- stream_args.otw_format = "sc16"; //only sc16 known to work
- for(size_t chan = 0; chan < num_channels; chan++)
- stream_args.channels.push_back(chan); //linear mapping
-
- return usrp_source::make(device_addr, stream_args);
- }
-
- usrp_source::sptr
- usrp_source::make(const ::uhd::device_addr_t &device_addr,
const ::uhd::stream_args_t &stream_args,
const bool issue_stream_cmd_on_start)
{
@@ -70,6 +50,7 @@ namespace gr {
io_signature::make(0, 0, 0),
args_to_io_sig(stream_args)),
usrp_block_impl(device_addr, stream_args, ""),
+ _recv_timeout(0.1), // seconds
_tag_now(false),
_issue_stream_cmd_on_start(issue_stream_cmd_on_start)
{
@@ -79,9 +60,7 @@ namespace gr {
_samp_rate = this->get_samp_rate();
_center_freq = this->get_center_freq(0);
-#ifdef GR_UHD_USE_STREAM_API
_samps_per_packet = 1;
-#endif
register_msg_cmd_handler(CMD_TAG_KEY, boost::bind(&usrp_source_impl::_cmd_handler_tag, this, _1));
}
@@ -93,11 +72,7 @@ namespace gr {
usrp_source_impl::get_usrp_info(size_t chan)
{
chan = _stream_args.channels[chan];
-#ifdef UHD_USRP_MULTI_USRP_GET_USRP_INFO_API
return _dev->get_usrp_rx_info(chan);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
void
@@ -132,11 +107,7 @@ namespace gr {
::uhd::meta_range_t
usrp_source_impl::get_samp_rates(void)
{
-#ifdef UHD_USRP_MULTI_USRP_GET_RATES_API
return _dev->get_rx_rates(_stream_args.channels[0]);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
::uhd::tune_result_t
@@ -383,11 +354,7 @@ namespace gr {
usrp_source_impl::set_auto_dc_offset(const bool enable, size_t chan)
{
chan = _stream_args.channels[chan];
-#ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
return _dev->set_rx_dc_offset(enable, chan);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
void
@@ -395,11 +362,7 @@ namespace gr {
size_t chan)
{
chan = _stream_args.channels[chan];
-#ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
return _dev->set_rx_dc_offset(offset, chan);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
void
@@ -419,11 +382,7 @@ namespace gr {
size_t chan)
{
chan = _stream_args.channels[chan];
-#ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API
return _dev->set_rx_iq_balance(correction, chan);
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
::uhd::sensor_value_t
@@ -451,12 +410,9 @@ namespace gr {
usrp_source_impl::set_stream_args(const ::uhd::stream_args_t &stream_args)
{
_update_stream_args(stream_args);
-#ifdef GR_UHD_USE_STREAM_API
- if(_rx_stream)
+ if (_rx_stream) {
_rx_stream.reset();
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
+ }
}
void
@@ -487,12 +443,10 @@ namespace gr {
usrp_source_impl::start(void)
{
boost::recursive_mutex::scoped_lock lock(d_mutex);
-#ifdef GR_UHD_USE_STREAM_API
- if(not _rx_stream){
+ if (not _rx_stream) {
_rx_stream = _dev->get_rx_stream(_stream_args);
_samps_per_packet = _rx_stream->get_max_num_samps();
}
-#endif
if(_issue_stream_cmd_on_start){
//setup a stream command that starts streaming slightly in the future
static const double reasonable_delay = 0.1; //order of magnitude over RTT
@@ -521,19 +475,13 @@ namespace gr {
outputs.push_back(&buffs[i].front());
}
while(true) {
-#ifdef GR_UHD_USE_STREAM_API
const size_t bpi = ::uhd::convert::get_bytes_per_item(_stream_args.cpu_format);
if(_rx_stream)
// get the remaining samples out of the buffers
_rx_stream->recv(outputs, nbytes/bpi, _metadata, 0.0);
else
// no rx streamer -- nothing to flush
- break;
-#else
- _dev->get_device()->recv
- (outputs, nbytes/_type->size, _metadata, *_type,
- ::uhd::device::RECV_MODE_FULL_BUFF, 0.0);
-#endif
+ break;
if(_metadata.error_code == ::uhd::rx_metadata_t::ERROR_CODE_TIMEOUT)
break;
}
@@ -560,7 +508,6 @@ namespace gr {
std::vector<std::vector<std::complex<float> > >
usrp_source_impl::finite_acquisition_v(const size_t nsamps)
{
-#ifdef GR_UHD_USE_STREAM_API
//kludgy way to ensure rx streamer exsists
if(!_rx_stream) {
this->start();
@@ -598,9 +545,6 @@ namespace gr {
}
return samps;
-#else
- throw std::runtime_error("not implemented in this version");
-#endif
}
int
@@ -609,30 +553,16 @@ namespace gr {
gr_vector_void_star &output_items)
{
boost::recursive_mutex::scoped_lock lock(d_mutex);
-#ifdef GR_UHD_USE_STREAM_API
//In order to allow for low-latency:
//We receive all available packets without timeout.
//This call can timeout under regular operation...
- size_t num_samps = _rx_stream->recv
- (output_items, noutput_items, _metadata, 0.0);
-
- //If receive resulted in a timeout condition:
- //We now receive a single packet with a large timeout.
- if(_metadata.error_code == ::uhd::rx_metadata_t::ERROR_CODE_TIMEOUT) {
- num_samps = _rx_stream->recv
- (output_items, noutput_items, _metadata, 0.1, true/*one pkt*/);
- }
-#else
- size_t num_samps = _dev->get_device()->recv
- (output_items, noutput_items, _metadata,
- *_type, ::uhd::device::RECV_MODE_FULL_BUFF, 0.0);
-
- if(_metadata.error_code == ::uhd::rx_metadata_t::ERROR_CODE_TIMEOUT) {
- num_samps = _dev->get_device()->recv
- (output_items, noutput_items, _metadata, *_type,
- ::uhd::device::RECV_MODE_ONE_PACKET, 1.0);
- }
-#endif
+ size_t num_samps = _rx_stream->recv(
+ output_items,
+ noutput_items,
+ _metadata,
+ _recv_timeout,
+ true /* one packet -> minimize latency */
+ );
//handle possible errors conditions
switch(_metadata.error_code) {
diff --git a/gr-uhd/lib/usrp_source_impl.h b/gr-uhd/lib/usrp_source_impl.h
index f6225a7e35..c1566e18d0 100644
--- a/gr-uhd/lib/usrp_source_impl.h
+++ b/gr-uhd/lib/usrp_source_impl.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2013 Free Software Foundation, Inc.
+ * Copyright 2010-2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -36,15 +36,7 @@ namespace gr {
args_to_io_sig(const ::uhd::stream_args_t &args)
{
const size_t nchan = std::max<size_t>(args.channels.size(), 1);
-#ifdef GR_UHD_USE_STREAM_API
const size_t size = ::uhd::convert::get_bytes_per_item(args.cpu_format);
-#else
- size_t size = 0;
- if(args.cpu_format == "fc32")
- size = 8;
- if(args.cpu_format == "sc16")
- size = 4;
-#endif
return io_signature::make(nchan, nchan, size);
}
@@ -123,10 +115,9 @@ namespace gr {
::uhd::tune_result_t _set_center_freq_from_internals(size_t chan);
void _cmd_handler_tag(const pmt::pmt_t &tag);
-#ifdef GR_UHD_USE_STREAM_API
::uhd::rx_streamer::sptr _rx_stream;
size_t _samps_per_packet;
-#endif
+ double _recv_timeout;
bool _tag_now;
::uhd::rx_metadata_t _metadata;
pmt::pmt_t _id;
diff --git a/gr-uhd/swig/CMakeLists.txt b/gr-uhd/swig/CMakeLists.txt
index 5cbc6c642c..866e5f1f12 100644
--- a/gr-uhd/swig/CMakeLists.txt
+++ b/gr-uhd/swig/CMakeLists.txt
@@ -28,8 +28,8 @@ set(GR_SWIG_FLAGS -DGR_HAVE_UHD) #needed to parse uhd_swig.i
set(GR_SWIG_INCLUDE_DIRS
${GR_UHD_INCLUDE_DIRS}
${GNURADIO_RUNTIME_SWIG_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS}
${UHD_INCLUDE_DIRS}
+ ${Boost_INCLUDE_DIRS}
)
if(ENABLE_GR_CTRLPORT)
diff --git a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPlatform.cmake b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPlatform.cmake
index fbbea5fee0..00a53d04d9 100644
--- a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPlatform.cmake
+++ b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPlatform.cmake
@@ -51,4 +51,12 @@ endif()
if(NOT DEFINED LIB_SUFFIX AND LIB64_CONVENTION AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
set(LIB_SUFFIX 64)
endif()
+
+########################################################################
+# Detect /lib versus /lib64
+########################################################################
+if (CMAKE_INSTALL_LIBDIR MATCHES lib64)
+ set(LIB_SUFFIX 64)
+endif()
+
set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix")
diff --git a/gr-utils/python/utils/CMakeLists.txt b/gr-utils/python/utils/CMakeLists.txt
index 46a21c1508..3ce335c4ed 100644
--- a/gr-utils/python/utils/CMakeLists.txt
+++ b/gr-utils/python/utils/CMakeLists.txt
@@ -49,6 +49,5 @@ GR_PYTHON_INSTALL(
gr_plot_short
gr_plot_qt
gr_read_file_metadata
- grcc
DESTINATION ${GR_RUNTIME_DIR}
)
diff --git a/gr-utils/python/utils/gr_plot_const b/gr-utils/python/utils/gr_plot_const
index 28f6a540da..653a2539b4 100755
--- a/gr-utils/python/utils/gr_plot_const
+++ b/gr-utils/python/utils/gr_plot_const
@@ -230,11 +230,11 @@ def main():
help="Specify where to start in the file [default=%(default)r]")
parser.add_argument("-R", "--sample-rate", type=float, default=1.0,
help="Set the sampler rate of the data [default=%(default)r]")
- parser.add_argument("file", metavar="FILE", nargs=1,
+ parser.add_argument("file", metavar="FILE",
help="Input file with complex samples")
args = parser.parse_args()
- dc = draw_constellation(args.file[0], args)
+ dc = draw_constellation(args.file, args)
if __name__ == "__main__":
try:
diff --git a/gr-utils/python/utils/gr_read_file_metadata b/gr-utils/python/utils/gr_read_file_metadata
index 2a907687d6..a05e7ad2c7 100644
--- a/gr-utils/python/utils/gr_read_file_metadata
+++ b/gr-utils/python/utils/gr_read_file_metadata
@@ -76,8 +76,8 @@ if __name__ == "__main__":
parser = ArgumentParser(conflict_handler="resolve", description=description)
parser.add_argument("-D", "--detached", action="store_true",
help="Used if header is detached.")
- parser.add_argument("file", metavar="FILE", nargs=1,
+ parser.add_argument("file", metavar="FILE",
help="Input file");
args = parser.parse_args()
- main(args.file[0], args.detached)
+ main(args.file, args.detached)
diff --git a/gr-utils/python/utils/grcc b/gr-utils/python/utils/grcc
deleted file mode 100755
index e93802f051..0000000000
--- a/gr-utils/python/utils/grcc
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/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.
-#
-
-import os
-import sys
-from argparse import ArgumentParser
-import warnings
-warnings.simplefilter('ignore')
-
-from gnuradio import gr
-
-try:
- from grc.core.Platform import Platform
-except ImportError:
- from gnuradio.grc.core.Platform import Platform
-
-
-class GRCC:
- def __init__(self, grcfile, out_dir):
- self.out_dir = out_dir
- self.platform = Platform(
- prefs_file=gr.prefs(),
- version=gr.version(),
- version_parts=(gr.major_version(), gr.api_version(), gr.minor_version())
- )
- data = self.platform.parse_flow_graph(grcfile)
-
- self.fg = self.platform.get_new_flow_graph()
- self.fg.import_data(data)
- self.fg.grc_file_path = os.path.abspath(grcfile)
- self.fg.validate()
-
- if not self.fg.is_valid():
- raise StandardError("\n\n".join(
- ["Validation failed:"] + self.fg.get_error_messages()
- ))
-
- self.gen = self.platform.Generator(self.fg, out_dir)
- self.gen.write()
-
- def exec_program(self):
- progname = self.fg.get_option('id')
- os.system("{0}/{1}.py".format(self.out_dir, progname))
-
-
-def main():
- description = "Compiles a GRC file (.grc) into a GNU Radio Python program. The program is stored in ~/.grc_gnuradio by default, but this location can be changed with the -d option."
-
- parser = ArgumentParser(description=description)
- parser.add_argument("-d", "--directory",
- default='{0}/.grc_gnuradio/'.format(os.environ["HOME"]),
- help="Specify the directory to output the compile program [default=%(default)s]")
- parser.add_argument("-e", "--execute", action="store_true", default=False,
- help="Run the program after compiling [default=%(default)s]")
- parser.add_argument('grc_file', metavar="GRC_FILE", help=".grc file to compile")
- args = parser.parse_args()
-
- try:
- g = GRCC(args.grc_file, args.directory + "/")
- except Exception as e:
- sys.stderr.write(str(e) + "\n")
- sys.stderr.write("Error during file compilation.\n")
- sys.exit(1)
-
- if args.execute:
- g.exec_program()
-
-
-if __name__ == "__main__":
- main()
diff --git a/gr-zeromq/examples/python/client.py b/gr-zeromq/examples/python/client.py
index a63a77aa0d..ca7ad1830a 100755
--- a/gr-zeromq/examples/python/client.py
+++ b/gr-zeromq/examples/python/client.py
@@ -28,8 +28,8 @@ from gnuradio import gr
from gnuradio import blocks
from gnuradio import analog
from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
import numpy
import sys
from threading import Thread
@@ -81,13 +81,13 @@ class top_block(gr.top_block):
###############################################################################
# Options Parser
###############################################################################
-def parse_options():
- """ Options parser. """
- parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
- parser.add_option("-s", "--servername", type="string", default="localhost",
+def parse_args():
+ """Argument parser."""
+ parser = ArgumentParser()
+ parser.add_argument("-s", "--servername", default="localhost",
help="Server hostname")
- (options, args) = parser.parse_args()
- return options
+ args = parser.parse_args()
+ return args
###############################################################################
# Waiter Thread
@@ -102,8 +102,8 @@ class waiter(Thread):
# Main
###############################################################################
if __name__ == "__main__":
- options = parse_options()
- tb = top_block(options)
+ args = parse_args()
+ tb = top_block(args)
try:
# keep the program running when flowgraph is stopped
while True:
diff --git a/gr-zeromq/examples/python/gui.py b/gr-zeromq/examples/python/gui.py
index ffdfdc2a75..c932549408 100755
--- a/gr-zeromq/examples/python/gui.py
+++ b/gr-zeromq/examples/python/gui.py
@@ -22,8 +22,8 @@
###############################################################################
# Imports
###############################################################################
-from optparse import OptionParser
-from gnuradio.eng_option import eng_option
+from argparse import ArgumentParser
+from gnuradio.eng_arg import eng_float, intx
import gui
import sys
import os
@@ -141,24 +141,24 @@ class gui(QtGui.QMainWindow):
###############################################################################
# Options Parser
###############################################################################
-def parse_options():
- """ Options parser. """
- parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
- parser.add_option("-s", "--servername", type="string", default="localhost",
+def parse_args():
+ """Options parser."""
+ parser = ArgumentParser()
+ parser.add_argument("-s", "--servername", default="localhost",
help="Server hostname")
- parser.add_option("-c", "--clientname", type="string", default="localhost",
+ parser.add_argument("-c", "--clientname", default="localhost",
help="Server hostname")
- (options, args) = parser.parse_args()
- return options
+ args = parser.parse_args()
+ return args
###############################################################################
# Main
###############################################################################
if __name__ == "__main__":
- options = parse_options()
+ args = parse_args()
qapp = Qt.QApplication(sys.argv)
- qapp.main_window = gui("Remote GNU Radio GUI",options)
+ qapp.main_window = gui("Remote GNU Radio GUI", args)
qapp.main_window.show()
qapp.exec_()
diff --git a/gr-zeromq/examples/python/server.py b/gr-zeromq/examples/python/server.py
index e3b7c9b928..23951664c1 100755
--- a/gr-zeromq/examples/python/server.py
+++ b/gr-zeromq/examples/python/server.py
@@ -27,8 +27,8 @@ from gnuradio import gr
from gnuradio import blocks
from gnuradio import analog
from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
+from gnuradio.eng_arg import eng_float, intx
+from argparse import ArgumentParser
import numpy
import sys
from threading import Thread
@@ -101,18 +101,18 @@ class top_block(gr.top_block):
###############################################################################
# Options Parser
###############################################################################
-def parse_options():
- """ Options parser. """
- parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
- (options, args) = parser.parse_args()
- return options
+def parse_args():
+ """Argument parser."""
+ parser = ArgumentParser()
+ args = parser.parse_args()
+ return args
###############################################################################
# Main
###############################################################################
if __name__ == "__main__":
- options = parse_options()
- tb = top_block(options)
+ args = parse_args()
+ tb = top_block(args)
try:
# keep the program running when flowgraph is stopped
while True:
diff --git a/grc/compiler.py b/grc/compiler.py
new file mode 100755
index 0000000000..b2361b86eb
--- /dev/null
+++ b/grc/compiler.py
@@ -0,0 +1,76 @@
+# Copyright 2016 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 __future__ import print_function, absolute_import
+
+import argparse
+import os
+import subprocess
+
+from gnuradio import gr
+
+from .core import Messages
+from .core.Platform import Platform
+
+
+def argument_parser():
+ parser = argparse.ArgumentParser(description=(
+ "Compile a GRC file (.grc) into a GNU Radio Python program and run it."
+ ))
+ parser.add_argument("-o", "--output", metavar='DIR', default='.',
+ help="Output directory for compiled program [default=%(default)s]")
+ parser.add_argument("-u", "--user-lib-dir", action='store_true', default=False,
+ help="Output to default hier_block library (overwrites -o)")
+ parser.add_argument("-r", "--run", action="store_true", default=False,
+ help="Run the program after compiling [default=%(default)s]")
+ parser.add_argument(metavar="GRC_FILE", dest='grc_files', nargs='+',
+ help=".grc file to compile")
+ return parser
+
+
+def main(args=None):
+ args = args or argument_parser().parse_args()
+
+ platform = Platform(
+ name='GNU Radio Companion Compiler',
+ prefs=gr.prefs(),
+ version=gr.version(),
+ version_parts=(gr.major_version(), gr.api_version(), gr.minor_version())
+ )
+ out_dir = args.output if not args.user_lib_dir else platform.config.hier_block_lib_dir
+ if os.path.exists(out_dir):
+ pass # all is well
+ elif args.save_to_lib:
+ os.mkdir(out_dir) # create missing hier_block lib directory
+ else:
+ exit('Error: Invalid output directory')
+
+ Messages.send_init(platform)
+ flow_graph = file_path = None
+ for grc_file in args.grc_files:
+ os.path.exists(grc_file) or exit('Error: missing ' + grc_file)
+ Messages.send('\n')
+
+ flow_graph, file_path = platform.load_and_generate_flow_graph(
+ os.path.abspath(grc_file), os.path.abspath(out_dir))
+ if not file_path:
+ exit('Compilation error')
+ if file_path and args.run:
+ run_command_args = flow_graph.get_run_command(file_path, split=True)
+ subprocess.call(run_command_args)
diff --git a/grc/core/Config.py b/grc/core/Config.py
index 3455a382c1..cc199a348f 100644
--- a/grc/core/Config.py
+++ b/grc/core/Config.py
@@ -32,10 +32,12 @@ class Config(object):
hier_block_lib_dir = os.environ.get('GRC_HIER_PATH', Constants.DEFAULT_HIER_BLOCK_LIB_DIR)
- def __init__(self, version, version_parts=None, prefs=None):
+ def __init__(self, version, version_parts=None, name=None, prefs=None):
self._gr_prefs = prefs if prefs else DummyPrefs()
self.version = version
self.version_parts = version_parts or version[1:].split('-', 1)[0].split('.')[:3]
+ if name:
+ self.name = name
@property
def block_paths(self):
diff --git a/grc/core/FlowGraph.py b/grc/core/FlowGraph.py
index 18a5778015..bf5bf6d93e 100644
--- a/grc/core/FlowGraph.py
+++ b/grc/core/FlowGraph.py
@@ -22,11 +22,12 @@ import time
import re
from operator import methodcaller
import collections
+import sys
from . import Messages
from .Constants import FLOW_GRAPH_FILE_FORMAT_VERSION
from .Element import Element
-from .utils import expr_utils
+from .utils import expr_utils, shlex
_parameter_matcher = re.compile('^(parameter)$')
_monitors_searcher = re.compile('(ctrlport_monitor)')
@@ -181,6 +182,16 @@ class FlowGraph(Element):
"""
return self._options_block.get_param(key).get_evaluated()
+ def get_run_command(self, file_path, split=False):
+ run_command = self.get_option('run_command')
+ try:
+ run_command = run_command.format(
+ python=shlex.quote(sys.executable),
+ filename=shlex.quote(file_path))
+ return shlex.split(run_command) if split else run_command
+ except Exception as e:
+ raise ValueError("Can't parse run command {!r}: {}".format(run_command, e))
+
##############################################
# Access Elements
##############################################
@@ -392,7 +403,7 @@ class FlowGraph(Element):
cwd=self.grc_file_path
)
if file_path: # grc file found. load and get block
- self.parent_platform.load_and_generate_flow_graph(file_path)
+ self.parent_platform.load_and_generate_flow_graph(file_path, hier_only=True)
block = self.new_block(key) # can be None
if not block: # looks like this block key cannot be found
diff --git a/grc/core/Param.py b/grc/core/Param.py
index 31393b1d79..9544d79764 100644
--- a/grc/core/Param.py
+++ b/grc/core/Param.py
@@ -29,7 +29,7 @@ from . import Constants
from .Element import Element, nop_write
# Blacklist certain ids, its not complete, but should help
-ID_BLACKLIST = ['self', 'options', 'gr', 'blks2', 'math', 'firdes'] + dir(builtins)
+ID_BLACKLIST = ['self', 'options', 'gr', 'math', 'firdes'] + dir(builtins)
try:
from gnuradio import gr
ID_BLACKLIST.extend(attr for attr in dir(gr.top_block()) if not attr.startswith('_'))
diff --git a/grc/core/Platform.py b/grc/core/Platform.py
index 1e43271dc2..73937f1299 100644
--- a/grc/core/Platform.py
+++ b/grc/core/Platform.py
@@ -90,42 +90,43 @@ class Platform(Element):
if os.path.exists(os.path.normpath(file_path)):
return file_path
- def load_and_generate_flow_graph(self, file_path):
+ def load_and_generate_flow_graph(self, file_path, out_path=None, hier_only=False):
"""Loads a flow graph from file and generates it"""
Messages.set_indent(len(self._auto_hier_block_generate_chain))
- Messages.send('>>> Loading: %r\n' % file_path)
+ Messages.send('>>> Loading: {}\n'.format(file_path))
if file_path in self._auto_hier_block_generate_chain:
Messages.send(' >>> Warning: cyclic hier_block dependency\n')
- return False
+ return None, None
self._auto_hier_block_generate_chain.add(file_path)
try:
flow_graph = self.get_new_flow_graph()
flow_graph.grc_file_path = file_path
- # Other, nested higiter_blocks might be auto-loaded here
+ # Other, nested hier_blocks might be auto-loaded here
flow_graph.import_data(self.parse_flow_graph(file_path))
flow_graph.rewrite()
flow_graph.validate()
if not flow_graph.is_valid():
raise Exception('Flowgraph invalid')
- if not flow_graph.get_option('generate_options').startswith('hb'):
+ if hier_only and not flow_graph.get_option('generate_options').startswith('hb'):
raise Exception('Not a hier block')
except Exception as e:
Messages.send('>>> Load Error: {}: {}\n'.format(file_path, str(e)))
- return False
+ return None, None
finally:
self._auto_hier_block_generate_chain.discard(file_path)
Messages.set_indent(len(self._auto_hier_block_generate_chain))
try:
- Messages.send('>>> Generating: {}\n'.format(file_path))
- generator = self.Generator(flow_graph, file_path)
+ generator = self.Generator(flow_graph, out_path or file_path)
+ Messages.send('>>> Generating: {}\n'.format(generator.file_path))
generator.write()
except Exception as e:
Messages.send('>>> Generate Error: {}: {}\n'.format(file_path, str(e)))
- return False
+ return None, None
- self.load_block_xml(generator.file_path_xml)
- return True
+ if flow_graph.get_option('generate_options').startswith('hb'):
+ self.load_block_xml(generator.file_path_xml)
+ return flow_graph, generator.file_path
def build_block_library(self):
"""load the blocks and block tree from the search paths"""
diff --git a/grc/core/generator/flow_graph.tmpl b/grc/core/generator/flow_graph.tmpl
index b8913bb087..202362c925 100644
--- a/grc/core/generator/flow_graph.tmpl
+++ b/grc/core/generator/flow_graph.tmpl
@@ -80,7 +80,7 @@ $imp
#set $class_name = $flow_graph.get_option('id')
#set $param_str = ', '.join(['self'] + ['%s=%s'%(param.get_id(), param.get_make()) for param in $parameters])
#if $generate_options == 'qt_gui'
-
+from gnuradio import qtgui
class $(class_name)(gr.top_block, Qt.QWidget):
@@ -88,6 +88,7 @@ class $(class_name)(gr.top_block, Qt.QWidget):
gr.top_block.__init__(self, "$title")
Qt.QWidget.__init__(self)
self.setWindowTitle("$title")
+ qtgui.util.check_set_qss()
try:
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
except:
diff --git a/grc/core/utils/epy_block_io.py b/grc/core/utils/epy_block_io.py
index 7a2006a833..fc631203e3 100644
--- a/grc/core/utils/epy_block_io.py
+++ b/grc/core/utils/epy_block_io.py
@@ -24,7 +24,7 @@ def _ports(sigs, msgs):
for i, dtype in enumerate(sigs):
port_type = TYPE_MAP.get(dtype.name, None)
if not port_type:
- raise ValueError("Can't map {0:!r} to GRC port type".format(dtype))
+ raise ValueError("Can't map {0!r} to GRC port type".format(dtype))
ports.append((str(i), port_type))
for msg_key in msgs:
if msg_key == 'system':
diff --git a/grc/core/utils/shlex.py b/grc/core/utils/shlex.py
new file mode 100644
index 0000000000..6b620fa396
--- /dev/null
+++ b/grc/core/utils/shlex.py
@@ -0,0 +1,47 @@
+# Copyright 2016 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 __future__ import absolute_import
+
+import re
+import shlex
+
+# back port from python3
+
+_find_unsafe = re.compile(r'[^\w@%+=:,./-]').search
+
+
+def _shlex_quote(s):
+ """Return a shell-escaped version of the string *s*."""
+ if not s:
+ return "''"
+ if _find_unsafe(s) is None:
+ return s
+
+ # use single quotes, and put single quotes into double quotes
+ # the string $'b is then quoted as '$'"'"'b'
+ return "'" + s.replace("'", "'\"'\"'") + "'"
+
+
+if not hasattr(shlex, 'quote'):
+ quote = _shlex_quote
+else:
+ quote = shlex.quote
+
+split = shlex.split
diff --git a/grc/gui/Application.py b/grc/gui/Application.py
index 5c643eafa1..e2290b3401 100644
--- a/grc/gui/Application.py
+++ b/grc/gui/Application.py
@@ -519,8 +519,9 @@ class Application(Gtk.Application):
elif action == Actions.FLOW_GRAPH_NEW:
main.new_page()
if args:
+ flow_graph = main.get_flow_graph()
flow_graph._options_block.get_param('generate_options').set_value(args[0])
- flow_graph_update()
+ flow_graph_update(flow_graph)
elif action == Actions.FLOW_GRAPH_OPEN:
file_paths = args if args else FileDialogs.OpenFlowGraph(main, page.file_path).run()
if file_paths: # Open a new page for each file, show only the first
diff --git a/grc/gui/Constants.py b/grc/gui/Constants.py
index 0a555b37c9..01ea23ed3e 100644
--- a/grc/gui/Constants.py
+++ b/grc/gui/Constants.py
@@ -19,13 +19,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
from __future__ import absolute_import
-from gi.repository import Gtk
+from gi.repository import Gtk, Gdk
from ..core.Constants import *
# default path for the open/save dialogs
-DEFAULT_FILE_PATH = os.getcwd()
+DEFAULT_FILE_PATH = os.getcwd() if os.name != 'nt' else os.path.expanduser("~/Documents")
FILE_EXTENSION = '.grc'
# name for new/unsaved flow graphs
@@ -101,6 +101,12 @@ Please consider contacting OOT module maintainer for any block in here \
and kindly ask to update their GRC Block Descriptions or Block Tree to include a module name."""
+# _SCREEN = Gdk.Screen.get_default()
+# _SCREEN_RESOLUTION = _SCREEN.get_resolution() if _SCREEN else -1
+# DPI_SCALING = _SCREEN_RESOLUTION / 96.0 if _SCREEN_RESOLUTION > 0 else 1.0
+DPI_SCALING = 1.0 # todo: figure out the GTK3 way (maybe cairo does this for us
+
+
def update_font_size(font_size):
global PORT_SEPARATION, BLOCK_FONT, PORT_FONT, PARAM_FONT, FONT_SIZE
diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py
index 0eb88952b7..09ecd48a13 100644
--- a/grc/gui/Dialogs.py
+++ b/grc/gui/Dialogs.py
@@ -90,7 +90,7 @@ class TextDisplay(SimpleTextDisplay):
# for each \b delete one char from the buffer
back_count = 0
start_iter = self.get_buffer().get_end_iter()
- while line[back_count] == '\b':
+ while len(line) > back_count and line[back_count] == '\b':
# stop at the beginning of a line
if not start_iter.starts_line():
start_iter.backward_char()
diff --git a/grc/gui/Executor.py b/grc/gui/Executor.py
index 7168c9ef46..7c01d921bc 100644
--- a/grc/gui/Executor.py
+++ b/grc/gui/Executor.py
@@ -16,12 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
from __future__ import absolute_import
+
import os
-import threading
import shlex
import subprocess
-import sys
-import re
+import threading
from distutils.spawn import find_executable
from gi.repository import GLib
@@ -39,6 +38,7 @@ class ExecFlowGraphThread(threading.Thread):
threading.Thread.__init__(self)
self.page = flow_graph_page # store page and dont use main window calls in run
+ self.flow_graph = self.page.get_flow_graph()
self.xterm_executable = xterm_executable
self.update_callback = callback
@@ -54,16 +54,9 @@ class ExecFlowGraphThread(threading.Thread):
"""
Execute this python flow graph.
"""
- run_command = self.page.flow_graph.get_option('run_command')
generator = self.page.get_generator()
-
- try:
- run_command = run_command.format(
- python=shlex_quote(sys.executable),
- filename=shlex_quote(generator.file_path))
- run_command_args = shlex.split(run_command)
- except Exception as e:
- raise ValueError("Can't parse run command {!r}: {}".format(run_command, e))
+ run_command = self.flow_graph.get_run_command(generator.file_path)
+ run_command_args = shlex.split(run_command)
# When in no gui mode on linux, use a graphical terminal (looks nice)
xterm_executable = find_executable(self.xterm_executable)
@@ -99,21 +92,3 @@ class ExecFlowGraphThread(threading.Thread):
Messages.send_end_exec(self.process.returncode)
self.page.process = None
self.update_callback()
-
-
-###########################################################
-# back-port from python3
-###########################################################
-_find_unsafe = re.compile(r'[^\w@%+=:,./-]').search
-
-
-def shlex_quote(s):
- """Return a shell-escaped version of the string *s*."""
- if not s:
- return "''"
- if _find_unsafe(s) is None:
- return s
-
- # use single quotes, and put single quotes into double quotes
- # the string $'b is then quoted as '$'"'"'b'
- return "'" + s.replace("'", "'\"'\"'") + "'"
diff --git a/grc/gui/ParamWidgets.py b/grc/gui/ParamWidgets.py
index e5657c288e..b79a85623f 100644
--- a/grc/gui/ParamWidgets.py
+++ b/grc/gui/ParamWidgets.py
@@ -20,7 +20,7 @@ import os
from gi.repository import Gtk, Gdk
-from . import Colors
+from . import Colors, Utils
class InputParam(Gtk.HBox):
@@ -35,7 +35,7 @@ class InputParam(Gtk.HBox):
self._editing_callback = editing_callback
self.label = Gtk.Label()
- self.label.set_size_request(150, -1)
+ self.label.set_size_request(Utils.scale_scalar(150), -1)
self.label.show()
self.pack_start(self.label, False, False, 0)
diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py
index 3a0f6ae6de..ca1e3c5296 100644
--- a/grc/gui/PropsDialog.py
+++ b/grc/gui/PropsDialog.py
@@ -51,7 +51,9 @@ class PropsDialog(Gtk.Dialog):
Gtk.STOCK_APPLY, Gtk.ResponseType.APPLY,
)
self.set_response_sensitive(Gtk.ResponseType.APPLY, False)
- self.set_size_request(Constants.MIN_DIALOG_WIDTH, Constants.MIN_DIALOG_HEIGHT)
+ self.set_size_request(*Utils.scale(
+ (Constants.MIN_DIALOG_WIDTH, Constants.MIN_DIALOG_HEIGHT)
+ ))
self._block = block
self._hash = 0
diff --git a/grc/gui/Utils.py b/grc/gui/Utils.py
index 782a7e3a01..38fde80465 100644
--- a/grc/gui/Utils.py
+++ b/grc/gui/Utils.py
@@ -143,3 +143,13 @@ def make_screenshot(flow_graph, file_path, transparent_bg=False):
if file_path.endswith('.pdf') or file_path.endswith('.svg'):
cr.show_page()
psurf.finish()
+
+
+def scale(coor, reverse=False):
+ factor = Constants.DPI_SCALING if not reverse else 1 / Constants.DPI_SCALING
+ return tuple(int(x * factor) for x in coor)
+
+
+def scale_scalar(coor, reverse=False):
+ factor = Constants.DPI_SCALING if not reverse else 1 / Constants.DPI_SCALING
+ return int(coor * factor)
diff --git a/grc/gui/VariableEditor.py b/grc/gui/VariableEditor.py
index 44dd2923eb..484395be8c 100644
--- a/grc/gui/VariableEditor.py
+++ b/grc/gui/VariableEditor.py
@@ -21,7 +21,7 @@ from __future__ import absolute_import
from gi.repository import Gtk, Gdk, GObject
-from . import Actions, Constants
+from . import Actions, Constants, Utils
BLOCK_INDEX = 0
ID_INDEX = 1
@@ -114,9 +114,9 @@ class VariableEditor(Gtk.VBox):
id_column = Gtk.TreeViewColumn("Id", self.id_cell, text=ID_INDEX)
id_column.set_name("id")
id_column.set_resizable(True)
- id_column.set_max_width(300)
- id_column.set_min_width(80)
- id_column.set_fixed_width(100)
+ id_column.set_max_width(Utils.scale_scalar(300))
+ id_column.set_min_width(Utils.scale_scalar(80))
+ id_column.set_fixed_width(Utils.scale_scalar(100))
id_column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
id_column.set_cell_data_func(self.id_cell, self.set_properties)
self.id_column = id_column
@@ -132,7 +132,7 @@ class VariableEditor(Gtk.VBox):
value_column.set_name("value")
value_column.set_resizable(False)
value_column.set_expand(True)
- value_column.set_min_width(100)
+ value_column.set_min_width(Utils.scale_scalar(100))
value_column.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
value_column.set_cell_data_func(self.value_cell, self.set_value)
self.value_column = value_column
diff --git a/grc/gui/canvas/block.py b/grc/gui/canvas/block.py
index 7e28a21fc2..fc8a533397 100644
--- a/grc/gui/canvas/block.py
+++ b/grc/gui/canvas/block.py
@@ -69,7 +69,7 @@ class Block(CoreBlock, Drawable):
Returns:
the coordinate tuple (x, y) or (0, 0) if failure
"""
- return self.states['_coordinate']
+ return Utils.scale(self.states['_coordinate'])
@coordinate.setter
def coordinate(self, coor):
@@ -79,6 +79,7 @@ class Block(CoreBlock, Drawable):
Args:
coor: the coordinate tuple (x, y)
"""
+ coor = Utils.scale(coor, reverse=True)
if Actions.TOGGLE_SNAP_TO_GRID.get_active():
offset_x, offset_y = (0, self.height / 2) if self.is_horizontal() else (self.height / 2, 0)
coor = (
diff --git a/grc/scripts/CMakeLists.txt b/grc/scripts/CMakeLists.txt
index 9751952118..20366e0212 100644
--- a/grc/scripts/CMakeLists.txt
+++ b/grc/scripts/CMakeLists.txt
@@ -19,7 +19,7 @@
########################################################################
GR_PYTHON_INSTALL(
- PROGRAMS gnuradio-companion
+ PROGRAMS gnuradio-companion grcc
DESTINATION ${GR_RUNTIME_DIR}
)
diff --git a/grc/scripts/gnuradio-companion b/grc/scripts/gnuradio-companion
index 21d989164f..c1ffdf28bc 100755
--- a/grc/scripts/gnuradio-companion
+++ b/grc/scripts/gnuradio-companion
@@ -1,22 +1,20 @@
#!/usr/bin/env python
-"""
-Copyright 2016 Free Software Foundation, Inc.
-This file is part of GNU Radio
-
-GNU Radio Companion 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 2
-of the License, or (at your option) any later version.
-
-GNU Radio Companion 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 this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-"""
+# Copyright 2016 Free Software Foundation, Inc.
+# This file is part of GNU Radio
+#
+# GNU Radio Companion 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 2
+# of the License, or (at your option) any later version.
+#
+# GNU Radio Companion 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 this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import os
import sys
diff --git a/grc/scripts/grcc b/grc/scripts/grcc
new file mode 100755
index 0000000000..c3a53a91a6
--- /dev/null
+++ b/grc/scripts/grcc
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+# Copyright 2016 Free Software Foundation, Inc.
+# This file is part of GNU Radio
+#
+# GNU Radio Companion 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 2
+# of the License, or (at your option) any later version.
+#
+# GNU Radio Companion 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 this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+import os
+import sys
+
+
+GR_IMPORT_ERROR_MESSAGE = """\
+Cannot import gnuradio.
+
+Is the model path environment variable set correctly?
+ All OS: PYTHONPATH
+
+Is the library path environment variable set correctly?
+ Linux: LD_LIBRARY_PATH
+ Windows: PATH
+ MacOSX: DYLD_LIBRARY_PATH
+"""
+
+
+def die(error, message):
+ msg = "{0}\n\n({1})".format(message, error)
+ exit(type(error).__name__ + '\n\n' + msg)
+
+
+def check_gnuradio_import():
+ try:
+ from gnuradio import gr
+ except ImportError as err:
+ die(err, GR_IMPORT_ERROR_MESSAGE)
+
+
+def run_main():
+ script_path = os.path.dirname(os.path.abspath(__file__))
+ source_tree_subpath = "/grc/scripts"
+
+ if not script_path.endswith(source_tree_subpath):
+ # run the installed version
+ from gnuradio.grc.compiler import main
+ else:
+ print("Running from source tree")
+ sys.path.insert(1, script_path[:-len(source_tree_subpath)])
+ from grc.compiler import main
+ exit(main())
+
+
+if __name__ == '__main__':
+ check_gnuradio_import()
+ run_main()
diff --git a/grc/tests/resources/test_compiler.grc b/grc/tests/resources/test_compiler.grc
new file mode 100644
index 0000000000..cc56acedca
--- /dev/null
+++ b/grc/tests/resources/test_compiler.grc
@@ -0,0 +1,253 @@
+<?xml version='1.0' encoding='utf-8'?>
+<?grc format='1' created='3.7.11'?>
+<flow_graph>
+ <timestamp>Thu Sep 15 12:56:40 2016</timestamp>
+ <block>
+ <key>options</key>
+ <param>
+ <key>author</key>
+ <value></value>
+ </param>
+ <param>
+ <key>window_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>category</key>
+ <value>[GRC Hier Blocks]</value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>description</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(8, 8)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>generate_options</key>
+ <value>no_gui</value>
+ </param>
+ <param>
+ <key>hier_block_src_path</key>
+ <value>.:</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>top_block</value>
+ </param>
+ <param>
+ <key>max_nouts</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>qt_qss_theme</key>
+ <value></value>
+ </param>
+ <param>
+ <key>realtime_scheduling</key>
+ <value></value>
+ </param>
+ <param>
+ <key>run_command</key>
+ <value>{python} -u {filename}</value>
+ </param>
+ <param>
+ <key>run_options</key>
+ <value>run</value>
+ </param>
+ <param>
+ <key>run</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>thread_safe_setters</key>
+ <value></value>
+ </param>
+ <param>
+ <key>title</key>
+ <value></value>
+ </param>
+ </block>
+ <block>
+ <key>blocks_add_const_vxx</key>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>const</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(360, 28)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>blocks_add_const_vxx_0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>maxoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>minoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ </block>
+ <block>
+ <key>blocks_null_sink</key>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bus_conns</key>
+ <value>[[0,],]</value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(504, 32)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>blocks_null_sink_0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>num_inputs</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ </block>
+ <block>
+ <key>blocks_vector_source_x</key>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(208, 12)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>blocks_vector_source_x_0</value>
+ </param>
+ <param>
+ <key>maxoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>minoutbuf</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>repeat</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>tags</key>
+ <value>[]</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>vector</key>
+ <value>(0, 0, 0)</value>
+ </param>
+ </block>
+ <connection>
+ <source_block_id>blocks_add_const_vxx_0</source_block_id>
+ <sink_block_id>blocks_null_sink_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blocks_vector_source_x_0</source_block_id>
+ <sink_block_id>blocks_add_const_vxx_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+</flow_graph>
diff --git a/grc/tests/test_compiler.py b/grc/tests/test_compiler.py
new file mode 100644
index 0000000000..27b5670871
--- /dev/null
+++ b/grc/tests/test_compiler.py
@@ -0,0 +1,38 @@
+# Copyright 2016 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 argparse import Namespace
+from os import path
+import tempfile
+
+from grc.compiler import main
+
+
+def test_compiler(capsys):
+ args = Namespace(
+ output=tempfile.gettempdir(),
+ user_lib_dir=False,
+ grc_files=[path.join(path.dirname(__file__), 'resources', 'test_compiler.grc')],
+ run=True
+ )
+
+ main(args)
+
+ out, err = capsys.readouterr()
+ assert not err